AlignedReID-Re-Production-Pytorch
AlignedReID-Re-Production-Pytorch copied to clipboard
What are the operations to perform on input images in inference?
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, 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]andim_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.
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