def load_test_images(limit=None, neighbors=5): image_specs = [] xs = [] for path in glob.glob('../../test/*.png')[:limit]: image_number = os.path.basename(path)[:-len('.png')] patches, shape = clean.x_from_image(path, neighbors) image_specs.append((image_number, shape)) xs.append(patches) return image_specs, xs
def load_training(limit=None, neighbors=2): xs = [] ys = [] for path in glob.glob('../train/*.png')[:limit]: patches, _ = clean.x_from_image(path, neighbors) solutions = clean.y_from_image(path, neighbors) xs.extend(patches) ys.extend(solutions) return xs, ys
def load_training(limit=None, neighbors=2): xs = [] ys = [] for path in glob.glob('../../train/*.png')[:limit]: patches, _ = clean.x_from_image(path, neighbors) solutions = clean.y_from_image(path, neighbors) xs.extend(patches) ys.extend(solutions) return xs, ys