aurora95 / Keras-FCN

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

a small bug. #26

Open chalar opened 7 years ago

chalar commented 7 years ago

Hi,

First of all, I want to thank you for sharing your code. I use your code for my one of my projects. I made several updates according to my needs. But I believe one of them critical for the rest of the community. I normalized my samples between 0 and 1, then sample wise zero mean and normalization.

example code: train_datagen = SegDataGenerator(rescale=1./255, samplewise_center=True, samplewise_std_normalization=True,..)

I realized that you call preprocess_input() function at line 284

batch_x = preprocess_input(batch_x)

This line causes an additional zero-center by mean (it assumes that we have a non standardized 0-255 ranged image): x[:, :, :, 0] -= 103.939 x[:, :, :, 1] -= 116.779 x[:, :, :, 2] -= 123.68

since we already applied x = self.seg_data_generator.standardize(x) at line 258, we need to remove line 284. (or it should be done in standardize() function if needed )

ahundt commented 7 years ago

@caglarsenaras can you submit a pull request for this?

ahundt commented 6 years ago

@caglarsenaras How did performance change with/without this modification? If it improved I should be able to make the change.