yun-liu / RCF-PyTorch

Richer Convolutional Features for Edge Detection
Other
69 stars 10 forks source link

Question about normalize #1

Closed Youskrpig closed 2 years ago

Youskrpig commented 2 years ago

Hi, thanks for your great work. I was wondering how is self.mean calculated? and why not (image-mean)/std which could be replaced by transforms.normalize.

self.mean = np.array([104.00698793, 116.66876762, 122.67891434], dtype=np.float32) img = (img - self.mean).transpose((2, 0, 1))

yun-liu commented 2 years ago

Thanks for your question! Here, self.mean is the mean BGR values for the training images in the ImageNet dataset. The code in this repository strictly follows the Caffe implementation, and the ImageNet-pretrained model is also converted from the Caffe model. Hence, we follow Caffe to use image-mean rather than (image-mean)/std.

Youskrpig commented 2 years ago

Thanks for your question! Here, self.mean is the mean BGR values for the training images in the ImageNet dataset. The code in this repository strictly follows the Caffe implementation, and the ImageNet-pretrained model is also converted from the Caffe model. Hence, we follow Caffe to use image-mean rather than (image-mean)/std.

Thanks for your reply.