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
Projection of estimated SMPL/SMPL-X mesh on Image #56
Comments
Hi, thanks for your interest in PyMAF-X. |
Yes, I put the dictionary in the wrong argument while I was writing here. It should be About the resolution, I did not notice about the resolution used in PyMAF-X and I was just considering the resolution of my own images. I adjusted my way to visualize the projected points to May I ask if I am correct about the domain of the projected vertices being [-112, +112]? Meanwhile, may I ask if there would be a recommended way to do the projection without using the renderer in smplx_demo.py script? Thank you very much for your help. |
The demo code of PyMAF/PyMAF-X first detects the person in the image, then crops a new image based on the detected person bounding box. So, I think the reprojected points should not be simply rescaled to the original image. |
I found the parameters to re-create the projection without using the renderer provided in the code (only when IWP camera mode is not used). Following "SPEC: Seeing People in the Wild with an Estimated Camera", PyMAF(-X) seems to model the camera translation Translating to the variables used in ````demo_smplx.py```, the parameters of the perspective camera are:
With these parameters, I can re-create the projection with other rendering libraries, e.g., PyTorch3D. I am doing this because there are other values about the estimated SMPL(-X) models I would like to render, and finding out the camera parameters is needed. The parameters might need to be adjusted to adapt to the underlying camera spaces if even other rendering libraries are used. Hope this will help others who are working on some similar problems. Last but not least, thank you very much for the amazing work @HongwenZhang ! |
Yeah, the reprejection result is now correct. Glad to hear that you have figured it out! @tommycwh |
Thank you very much for your amazing work. I would like to ask a question about how to project a mesh estimated by PyMAF/PyMAF-X back on the input image.
It seems that PyMAF projects the predicted joints using the projection(...) function and the predicted camera parameters as in here. I guess this function is also applicable to a set of vertices too, instead of just joints.
Implementation of projection(...) in smpl branch:
PyMAF/utils/geometry.py
Lines 241 to 255 in fb21d10
I want to project a SMPL-X mesh estimated by PyMAF-X on the input image too. However, I do not see the projection(...) function being used in the demo_smplx.py script. Also, I found the implementation of the projection(...) function somewhat different from its counterpart in the smpl branch.
Excerpt of projection(...) in smplx branch:
PyMAF/utils/geometry.py
Lines 379 to 401 in 18a68d8
Can I just use this function in this way,
projection(dict(cam_sxy=pred_joints), pred_cam)
, to convert the predictions from PyMAF-X to the input of projection(...)? Or how should I use this function to get a correct projection?Here is an example in which I project the estimated smplx vertices by:
projection(dict(cam_sxy=smplx_verts), pred_cam)
.smplx_verts
has shape(1,10475,3)
andpred_cam
has shape(1,3)
. The dimensions of the input image are(512,512)
. The (x and y) coordinates of the projected vertices range from -106.73 to 98.63. I am guessing that the domains of coordinates are like [-W/2, +W/2] and [-H/2, +H/2], so I rescale the projects coordinates byx*2+256
andy*2+256
. Here are the input image (left) and the projection vertices (right) I get.Am I doing the projection correctly? Although the projection somewhat aligns with the actual human shape on the image, I am not sure if I am just putting the projected points at this location by luck or not. Also, the projection is a little bit smaller than the actual shape, and I am not sure if this is just because it is an estimation using SMPL-X, or if I am not projecting the shape correctly.
Thank you!
The text was updated successfully, but these errors were encountered: