Created
March 2, 2017 08:05
-
-
Save codingPingjun/aabe39e7c8423246bc8bb88e79f7db27 to your computer and use it in GitHub Desktop.
Providing Data for Segmentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_arrays_from_file(path): | |
while 1: | |
f = open(path) | |
for line in f: | |
# create numpy arrays of input data | |
# and labels, from each line in the file | |
x, y = process_line(line) | |
img = load_images(x) | |
yield (img, y) | |
f.close() | |
model.fit_generator(generate_arrays_from_file('/my_file.txt'), | |
samples_per_epoch=10000, nb_epoch=10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment