YanchaoYang / FDA

Fourier Domain Adaptation for Semantic Segmentation
501 stars 81 forks source link

Subtract mean 2 times #29

Closed bobvo23 closed 3 years ago

bobvo23 commented 3 years ago

The readme notes that we should subtract the mean after the Fourier conversion. However, I notice that the mean of the images are subtracted in the dataset class, method _getitem.

https://github.com/YanchaoYang/FDA/blob/b9a0cdf0bcc9b787c00e39df73eda5673706f219/data/gta5_dataset.py#L58

And during the train loop, the mean is subtracted again:

https://github.com/YanchaoYang/FDA/blob/b9a0cdf0bcc9b787c00e39df73eda5673706f219/train.py#L81

May anyone shed some lights for this approach? Thank you for your help in advance.

bobvo23 commented 3 years ago

I figured it out, the mean of the dataset class is set to zero. IMG_MEAN = np.array((0.0, 0.0, 0.0)