aurora95 / Keras-FCN

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

SegDataGenerator Normalization Fix #49

Closed Richarizardd closed 8 months ago

Richarizardd commented 7 years ago

Removing preprocess_input from SegDataGenerator when creating image batch, as the images are already normalized.

Let me know if this change makes sense!

ahundt commented 7 years ago

Could you link to the line where the preprocessing is already done?

ahundt commented 6 years ago

@Richarizardd would you mind explaining why this change is necessary?

Richarizardd commented 6 years ago

Hi @ahundt , sorry for the delay!

On line 258, you are standardizing the image by calling "self.seg_data_generator.standardize". Thus, I am not sure if it is useful to standardize the image again on line 284 using "preprocess_input" from keras.imagenet_utils.

ahundt commented 6 years ago

The standardize function has a bunch of boolean flags, if they're all false no changes should be made when standardize is called. In that case I think the preprocess code would be correct, but I didn't walk through the logic in much detail so if I misunderstood I'd appreciate an additional comment!