aurora95 / Keras-FCN

Keras-tensorflow implementation of Fully Convolutional Networks for Semantic Segmentation(Unfinished)
MIT License
650 stars 268 forks source link

SegDataGenerator questions #22

Open ahundt opened 7 years ago

ahundt commented 7 years ago

Questions by @mptorr in https://github.com/fchollet/keras/issues/6538#issuecomment-301342345

I was going to try your SegDataGenerator however wanted to ask 2 things about it, as they may pertain to your request for features/suggestions:

[1] it appears it currently does not support pixelwise weighting to compensate for class imbalance. This would be an important feature to me, as most of my segmentation tasks will have disproportionately over/under-represented classes. Currently I balance classes using Keras' sample_weighting as temporal, however without data augmentation due to my issues above. Since the sample weighting matches each pixel in the image/mask pair, it would need to be appropriately transformed to match augmented images/masks. Let me know if I'm overlooking this feature in SegDataGenerator.

It isn't there yet unfortunately. Suggestions/pull requests are welcome.

[2] I'm a bit confused on how SegDataGenerator loads images. The comment in the class perhaps could be reworded (or have examples) for the most important arguments. I also didn't understand how to use this info: for a file name 2011_002920.jpg, each row should contain 2011_002920. Of course, this lack of understanding may reflect my own limitations, but just thought it could help development.

SegDataGenerator expects the data to be in pascal_voc format, since the images are in jpg and the labels are in png the authors decided to put neither in the dataset list txt files. If you walk through the process in the README.md you'll end up with a folder properly set up for running which makes things much more clear.

Fahim-F commented 7 years ago

Hi My work is semantic segmentation. if I want to increase the number of the images that my network can see, (something like data augmentation), is there any prepared code for doing this? Something like the "ImageDataGenerator" of the keras does.

Zundock commented 6 years ago

Is this still needed? or have the features of SegDataGenerator been implemented into the Keras ImageDataGenerator? I am doing an implementation of U-net for semantic segmentation and was hoping to use the Keras ImageDataGenerator. Then I can across this repo and it is the first I read about the Keras ImageDataGenerator not handling segmentation.