AlignedReID-Re-Production-Pytorch icon indicating copy to clipboard operation
AlignedReID-Re-Production-Pytorch copied to clipboard

What are the operations to perform on input images in inference?

Open cppntn opened this issue 7 years ago • 2 comments

I want to perform inference with pretrained models to a custom dataset, to obtain global and local features. What are the operations that have to be done on the image? Like mean subtraction, scale multiplication, resize, and RGB or BGR input channels. Thanks

cppntn avatar Nov 19 '18 16:11 cppntn

Hi, the inference pre-process looks like following

  • Read the image using PIL.Image, np.asarray(Image.open(im_path)). The output is with shape [H, W, 3], in RGB order.
  • Scale the image by 1./255
  • Normalize it using im_mean = [0.486, 0.459, 0.408] and im_std = [0.229, 0.224, 0.225]
  • Transpose the image to shape [3, H, W], and then add a new axis to have shape [1, 3, H, W].
  • Transform from numpy to pytorch Variable for network input.

huanghoujing avatar Nov 25 '18 07:11 huanghoujing

I want to perform inference with pretrained models to a custom dataset, to obtain global and local features. What are the operations that have to be done on the image? Like mean subtraction, scale multiplication, resize, and RGB or BGR input channels. Thanks

Hi, have you implemented the inference you said ? hope you can tell me how to infer images,thanks

MichaelWU0726 avatar Mar 16 '21 12:03 MichaelWU0726