MEBOW icon indicating copy to clipboard operation
MEBOW copied to clipboard

About inference on single image

Open Wjt0403 opened this issue 3 years ago • 3 comments

Hi, I am trying to write a demo to inference on a single image, I use the follwing code:

  • img = Image.open(img_path) img = data_transform(img) img = torch.unsqueeze(img, dim=0) when i tried to see the output with:
  • model(img) I have the following bug:
  • RuntimeError: The size of tensor a (107) must match the size of tensor b (108) at non-singleton dimension 3 do you know why do I have this problem? Thanks.

Wjt0403 avatar Feb 07 '22 03:02 Wjt0403

uh, I have figured out the problem, i have to resize my input image according to my config file

Wjt0403 avatar Feb 07 '22 03:02 Wjt0403

well, I have a new question, what if the test image contains more than one person? how to get the predict classes for both of them?

Wjt0403 avatar Feb 07 '22 07:02 Wjt0403

Hi @Wjt0403 can u tell me how you perform the data_transform

marcosvcr avatar Aug 15 '22 19:08 marcosvcr