dgschwend/zynqnet

Image Pixel Values Range

Opened this issue · 8 comments

Hi David

I want to ask You that If i convert the hexadecimal values from the "indata.bin" file into the corresponding floating point values then What range of the values should I expect ? . At the moment I am getting the range of the pixels values in negative and positive both. Is there any defined range of pixel values e.g. (0, 255) or (-255, 255) etc. Hoping for an early response. Thanks

Best Regards
Khan

Good question! As you can see in the conversion script https://github.com/dgschwend/zynqnet/blob/master/tools/convert_jpeg_to_indata_bin.py, Zynqnet expects inputs between 0-255, but with the ImageNet mean vales [104, 117, 123] subtracted.

I.e. the floating-point range will be approximately -123 to +151, depending on the channel (R/G/B)

CHW order is correct. Beware of BGR color channels.
See the linked script for the conversion from JPG -> indata.bin, it says all about the conversion.
Why are you trying to interpret the binary file, by the way?

Hi David

Please Answer the Above question.

One More question is that why are you subtracting the mean values for the ImageNet image Set. Can You please explain the reason behind tat. Thanks for your time. Keenly looking forward for your reply.

Your assumptions are correct.

The network has been trained with mean-subtracted images, therefore needs mean-subtraction also during inference. There‘s some debate whether this is necessary in the Deep Learning community, but it‘s standard in the DIGITS framework I trained the network with.