Pytorch_Retinaface
Pytorch_Retinaface copied to clipboard
Input is not normalized to [-1, 1]
Hi, Why the input is not normalized to -1.~1. ?
img -= (104, 117, 123)
When I add the following code, and train & validate
img[0, :, :] = img[0, :, :] / 57. #b
img[1, :, :] = img[1, :, :] / 57.
img[2, :, :] = img[2, :, :] / 58.
no normalized, long side of image resized to 640. Easy: 0.875 Medium: 0.806 Hard: 0.504
normalized to [-1, 1] Easy: 0.880 Medium: 0.818 Hard: 0.521
When it gets converted to a tensor, the default type is float and the default action in Python will normalise it. However, it won't do this automatically in C++.
So, yes, it is already normalised -1 to 1 on input to the model.
When it gets converted to a tensor, the default type is float and the default action in Python will normalise it. However, it won't do this automatically in C++.
So, yes, it is already normalised -1 to 1 on input to the model.
do u know why use this code:
img -= (104,117,123)?
That's the mean being subtracted from the image as an unsigned char array, prior to normalisation. That BGR value becomes the zero of the normalised values.
I've found the actual mean value of the image appears to work slightly better, especially on highly contrasted images. However, as a constant this value is great.
That's the mean being subtracted from the image as an unsigned char array, prior to normalisation. That BGR value becomes the zero of the normalised values.
I've found the actual mean value of the image appears to work slightly better, especially on highly contrasted images. However, as a constant this value is great.
yes, before delete this line, always get some wrong box(not face). delet this line will get better performance.
torch.from_numpy()? This line wouldn't convert to -1-1 or 0-1.
It is not normalized.
The inputs are the range of [-104:151, -117:138, -123:132]. They aren't normalised to 1.