Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when any two cameras have different numbers of people #8

Open
letian-zhang opened this issue Sep 11, 2021 · 3 comments
Open

Error when any two cameras have different numbers of people #8

letian-zhang opened this issue Sep 11, 2021 · 3 comments

Comments

@letian-zhang
Copy link

letian-zhang commented Sep 11, 2021

Hi, I have run your code on the dataset Shelf. However, when the target camera and reference camera have different numbers of people, (e.g. there are 3 people in the target camera and there are 2 people in the reference camera), an error will happen in line 65 of mvmppe.py file.

poses_dist = torch.sum((pt - pr) ** 2, dim=-1) # [B, Npt, Npf, Nj, Nd]

Is there any solution to solve this problem?

@jiahaoLjh
Copy link
Owner

Hi,
Can you elaborate more on what error has happened?

@letian-zhang
Copy link
Author

For example, there are two views at the same time.
Capture

The 500th frames of Camera0 and Camera1 have different numbers of people (e.g., 2 people in Camera0 and 4 people in Camaera1). In the code 'mvmppe.py' lines 63 and 64, the codes reshape the 2D target pose and 2D reference pose.

pt = poses_2d_target.reshape(batch_size, num_persons, 1, num_joints, num_depth_levels, 2) # [B, Npt, 1, Nj, Nd, 2]
pr = poses_2d_ref.reshape(batch_size, 1, num_persons, num_joints, 1, 2) # [B, 1, Npr, Nj, 1, 2]

The parameter 'num_persons' is the number of people in Camera0. However, there are 4 people in Camera1. When reshaping poses_2d_ref (Camera1) with parameter 'num_persons = 2', there is a error "RuntimeError: shape '[1, 1, 2, 17, 1, 2]' is invalid for input of size 136".

@jiahaoLjh
Copy link
Owner

The num_persons here is not the number of pose detections in each frame. It’s the maximum number of persons which you can see in the config files as “MAX_NUM_PERSONS”. Views with less than “MAX_NUM_PERSONS” pose detections will have dummy poses (all zeros) padded to the same shape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants