0

I'm trying to use the keras ImageDataGenerator.flow_from_dataframe() method to generate image data on the fly as the dataset I'm working on is too large to load into memory in one go.

The source image data files are DICOM files, not supported by the flow_from_dataframe() method.

Is it possible to (easily) extend flow_from_dataframe() to handle DICOM (or other unsupported) images/input?

Perhaps a custom pre-processing function could be run on each unsupported file, returning a normalised (windowed/photometric corrected) numpy array, then allowing the ImageDataGenerator instance to proceed.

I could edit the source on my own installation but a general solution that can be used on vanilla keras is preferred, to ensure portability to other platforms (especially Kaggle)!!

Amit Joshi
  • 15,448
  • 21
  • 77
  • 141
moo
  • 1,597
  • 1
  • 14
  • 29

1 Answers1

1

A solution to this can be found on the Keras github issue tracker/feature requests: https://github.com/keras-team/keras/issues/13665

A custom data generator can be created based on keras.utils.Sequence as a superclass.

moo
  • 1,597
  • 1
  • 14
  • 29