Skip to content

Commit a82807f

Browse files
nzw0301fchollet
authored andcommitted
Update for PPM format (keras-team#7750)
1 parent fa97c50 commit a82807f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/templates/preprocessing/image.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Generate batches of tensor image data with real-time data augmentation. The data
8686
- __flow_from_directory(directory)__: Takes the path to a directory, and generates batches of augmented/normalized data. Yields batches indefinitely, in an infinite loop.
8787
- __Arguments__:
8888
- __directory__: path to the target directory. It should contain one subdirectory per class.
89-
Any PNG, JPG or BMP images inside each of the subdirectories directory tree will be included in the generator.
89+
Any PNG, JPG, BMP or PPM images inside each of the subdirectories directory tree will be included in the generator.
9090
See [this script](https://gist.github.com/fchollet/0830affa1f7f19fd47b06d4cf89ed44d) for more details.
9191
- __target_size__: tuple of integers `(height, width)`, default: `(256, 256)`.
9292
The dimensions to which all images found will be resized.

keras/preprocessing/image.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def load_img(path, grayscale=False, target_size=None):
333333
return img
334334

335335

336-
def list_pictures(directory, ext='jpg|jpeg|bmp|png'):
336+
def list_pictures(directory, ext='jpg|jpeg|bmp|png|ppm'):
337337
return [os.path.join(root, f)
338338
for root, _, files in os.walk(directory) for f in files
339339
if re.match(r'([\w]+\.(?:' + ext + '))', f)]

0 commit comments

Comments
 (0)