Closed Youskrpig closed 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 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 useimage-mean
rather than(image-mean)/std
.
Thanks for your reply.
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))