anibali / margipose

3D monocular human pose estimation
Apache License 2.0
98 stars 20 forks source link

Expected input image dimensions for MargiPose #33

Closed sunmengnan closed 2 years ago

sunmengnan commented 2 years ago

when inferring on my own imgs, RuntimeError: Given groups=1, weight of size 192 192 3 3, expected input[1, 384, 4, 4] to have 192 channels, but got 384 channels instead. Any idea how to fix it?

anibali commented 2 years ago

What is the shape of the input tensor that you are feeding into the model?

sunmengnan commented 2 years ago

What is the shape of the input tensor that you are feeding into the model?

It is 3x116x55

anibali commented 2 years ago

Please resize and pad your input to match the expected input dimensions of the model. Refer to infer_single.py:

https://github.com/anibali/margipose/blob/master/src/margipose/bin/infer_single.py#L58-L66

sunmengnan commented 2 years ago

Please resize and pad your input to match the expected input dimensions of the model. Refer to infer_single.py:

https://github.com/anibali/margipose/blob/master/src/margipose/bin/infer_single.py#L58-L66

Does the input shape have to be 3x256x256?

anibali commented 2 years ago

That size is guaranteed to work, I think that other spatial dimensions could result in size mismatches further down the model due to not being divisible by 2, etc. Also, make sure that you add a batch dimension (even if it is just 1). So your input should be 1x3x256x256 for a single image. Again, refer to the script.

sunmengnan commented 2 years ago

That size is guaranteed to work, I think that other spatial dimensions could result in rounding errors. Also, make sure that you add a batch dimension (even if it is just 1). So your input should be 1x3x256x256. Again, refer to the script.

Thank you for your help. Closing...