xingyizhou / pytorch-pose-hg-3d

PyTorch implementation for 3D human pose estimation
GNU General Public License v3.0
613 stars 143 forks source link

pre processing for mpii dataset for 2d version #33

Closed udion closed 5 years ago

udion commented 5 years ago

Hi @xingyizhou ,

I was trying out the 2D pre-trained model given by you on mpii images,

I'm getting the following error

Traceback (most recent call last):
  File "demo.py", line 37, in <module>
    main()
  File "demo.py", line 26, in main
    output = model(input_var)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 106, in forward
    hg = self.hourglass[i](x)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 45, in forward
    low2 = self.low2(low1)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 45, in forward
    low2 = self.low2(low1)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 45, in forward
    low2 = self.low2(low1)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 56, in forward
    return up1 + up2
RuntimeError: The size of tensor a (15) must match the size of tensor b (14) at non-singleton dimension 2

I think there is some preprocessing to be done on mpii, any clues?

(P.S : I adopted the demo.py from 3D version)

udion commented 5 years ago

@xingyizhou

Actually, I tried it with the H3.6M dataset as well, I am getting the similar error, so reason might be something else. Any clues???

Traceback (most recent call last):
  File "demo.py", line 37, in <module>
    main()
  File "demo.py", line 26, in main
    output = model(input_var)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 106, in forward
    hg = self.hourglass[i](x)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 45, in forward
    low2 = self.low2(low1)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 45, in forward
    low2 = self.low2(low1)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 45, in forward
    low2 = self.low2(low1)
  File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 56, in forward
    return up1 + up2
RuntimeError: The size of tensor a (7) must match the size of tensor b (6) at non-singleton dimension 3
xingyizhou commented 5 years ago

Hi, I haven’t cropped the input to 256x256 in the demo code. The input should be resized before running the demo.

On Thu, Aug 2, 2018 at 12:25 PM uddeshya notifications@github.com wrote:

@xingyizhou https://github.com/xingyizhou

Actually, I tried it with the H3.6M dataset as well, I am getting the similar error, so reason might be something else. Any clues???

Traceback (most recent call last): File "demo.py", line 37, in main() File "demo.py", line 26, in main output = model(input_var) File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in call result = self.forward(*input, kwargs) File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 106, in forward hg = self.hourglassi File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in call result = self.forward(*input, *kwargs) File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 45, in forward low2 = self.low2(low1) File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in call result = self.forward(input, kwargs) File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 45, in forward low2 = self.low2(low1) File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in call result = self.forward(*input, *kwargs) File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertain_pose_estimate/src/models/hg.py", line 45, in forward low2 = self.low2(low1) File "/home/udion/anaconda3/envs/DeepCV3.5/lib/python3.5/site-packages/torch/nn/modules/module.py", line 325, in call result = self.forward(input, **kwargs) File "/media/udion/a2c5c487-f939-4b82-a348-86b3d1bdb024/udion_home/Projects/Uncertainpose

estimate/src/models/hg.py", line 56, in forward return up1 + up2 RuntimeError: The size of tensor a (7) must match the size of tensor b (6) at non-singleton dimension 3

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/xingyizhou/pytorch-pose-hg-3d/issues/33#issuecomment-410040149, or mute the thread https://github.com/notifications/unsubscribe-auth/AIc1B4JkYmVz_GWD91gRVlbNgO0So-M8ks5uM1I2gaJpZM4Vszb8 .

--

-- Best Regards, Xingyi Zhou Department of Computer Science The University of Texas at Austin

udion commented 5 years ago

@xingyizhou , so you mean in case of H3.6M (which is 224X224), it should be blown up to (256X256) ?

xingyizhou commented 5 years ago

Yes.

On Thu, Aug 2, 2018 at 1:04 PM uddeshya notifications@github.com wrote:

@xingyizhou https://github.com/xingyizhou , so you mean in case of H3.6M (which is 224X224), it should be blown up to (256X256) ?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/xingyizhou/pytorch-pose-hg-3d/issues/33#issuecomment-410050787, or mute the thread https://github.com/notifications/unsubscribe-auth/AIc1B5lhxuS-K-jfcyhucFNsubNZLxG5ks5uM1s3gaJpZM4Vszb8 .

--

-- Best Regards, Xingyi Zhou Department of Computer Science The University of Texas at Austin

udion commented 5 years ago

@xingyizhou , yeah, that worked, but I am getting this new error

Traceback (most recent call last):
  File "demo.py", line 42, in <module>
    main()
  File "demo.py", line 33, in main
    reg = (output[-1].data).cpu().numpy().reshape(pred.shape[0], 1)
ValueError: total size of new array must be unchanged

I believe it has to do with the fact that demo was written for 3d pose, and now i'm using 2d model, what should I change?

udion commented 5 years ago

oh, that must be -1, instead of 1 that is

reg = (output[-1].data).cpu().numpy().reshape(pred.shape[0], -1)

it's working. Thanks @xingyizhou Awesome work.

udion commented 5 years ago

@xingyizhou oh btw, I had tried to extend your work to do action recognition and complete the pipeline (estimation + recognition)

https://github.com/udion/pose2action

xingyizhou commented 5 years ago

Thanks for the extension @udion !