ShuangXieIrene / mobilenet-v2

Repository for "Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation".
https://arxiv.org/abs/1801.04381
73 stars 12 forks source link

image preprocessing #5

Open jiang1st opened 6 years ago

jiang1st commented 6 years ago

Thank you for releasing the pretrained model. I am wondering how to pre-process the image before putting them into the graph? In slim, there are several options, such as inception_preprocessing, vgg_preprocessing.

jiang1st commented 6 years ago

What I have tried is to:

  1. normalize BGR values from 0-255 to 0-1
  2. re-order image channels from BGR to RGB format
  3. each value minus 0.5 and multiply by 2

However, when I test the network with different figures (cat/person, etc), the output category does match the ground truth.(I match the index to the categories according to https://github.com/tensorflow/models/blob/master/research/slim/datasets/imagenet_lsvrc_2015_synsets.txt)