dpressel/rude-carnie

scale of one of the image crops in multi_crop_batch seems to be off

nitred opened this issue · 1 comments

I'm using the gender classification script:
python guess.py --class_type gender --model_type inception --model_dir ./21936 --requested_step 14999 --filename ./test.jpg

In the make_multi_crop_batch function, a batch of cropped images is being created from the image file. Every image crop seems to be standardized except for the one that is horizontally flipped (i.e. flip_left_right) on line 152.

I printed out one pixel (3 channels) for each of the evaluated image crops. Here's how they look like:

standardized_original:   [1.5681903 1.5681903 1.5681903]
flip_left_right:         [236. 236. 236.]  # scale is around 256, i.e. not standardized
standardized_crop1:      [1.4424354 1.4424354 1.4424354]
standardized_crop1_flip: [-1.2171873 -1.2171873 -1.2171873]
standardized_crop2:      [0.92570674 0.92570674 0.92570674]
standardized_crop2_flip: [1.5456676 1.5456676 1.5456676]
standardized_crop3:      [1.455786 1.455786 1.455786]
standardized_crop3_flip: [-0.8199551 -0.8199551 -0.8199551]
standardized_crop4:      [-0.29447666 -0.29447666 -0.29447666]
standardized_crop4_flip: [-0.48242104 -0.48242104 -0.48242104]
standardized_crop5:      [1.4569467 1.4569467 1.4569467]
standardized_crop5_flip: [0.35454485 0.35454485 0.35454485]

I'm currently using a pre-trained model (checkpoint) that was provided in the readme. I have a couple of doubts on what the effects of this are?

  1. Is this expected behavior?
  2. Has the pre-trained model been trained using the make_multi_crop_batch? If so, how do you think this affects the performance of the pre-trained model?
  3. How would you suggest I proceed if this isn't expected behavior? Should I now start standardizing the the flip_left_right image or should I drop it from the list of crops?
  1. nope, its a bug! fixed here: 972daf6

  2. no its not used for training, its only used by guess.py, no need to worry

  3. just pull from the repo, should be fixed. LMK if there is still an issue!

Thanks!