Image to image DataSetIterator using dl4j

232 views Asked by At

I would like to use DeepLearning4j to build and train a U-Net network. To do this I need a dataset iterator that feed the network with an image in input and an other image in output.

I am new to DL4j and all the examples I found explain how build datasets for image classification.

From what I understand, I need to instanciate an ImageRecordReader with my files and then create my dataset iterator using the RecordReaderDataSetIterator class.

The thing is, I don't know how to specify in the ImageRecordReader that my labels are also images.

Can someone explain me how to do it or point me to some revelant ressources?

Thanks

1

There are 1 answers

0
Kenghooi On

You will still need an ImageRecordReader, but with a custom label generator. You may customize the PathLabelGenerator class to find your output images by replacing the folder name in file paths, if your dataset is organized in the following way:

  • dataDir/input/img.png
  • dataDir/output/img.png