jonbakerfish commented on issue #10935: When are the images converted to 
range(0,1) in pre-trained resnet50_v2 on imagenet?
URL: 
https://github.com/apache/incubator-mxnet/issues/10935#issuecomment-388846795
 
 
   Hi @chinakook,
   If you run this code:
   
       im = mx.nd.random_uniform(shape=(3, 10, 10)) * 255
       im_ = mx.nd.image.normalize(im, mean=(0.485, 0.456, 0.406), std=(0.229, 
0.224, 0.225))
       print im_.min(),im_.max() 
   
   you will get something like:
   
       [-1.89502692]
       <NDArray 1 @cpu(0)> 
       [ 1131.16967773]
       <NDArray 1 @cpu(0)>
   
   I think the mean and std are for images which are in range (0,1), not for 
the images in range (0,255). So before doing `image.normalize`, `im=im/255` 
should be done somewhere else.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to