facebookresearch / frankmocap

A Strong and Easy-to-use Single View 3D Hand+Body Pose Estimator
Other
2.14k stars 374 forks source link

Get the head bbox coordinates from the SMPL-X predicted vertices #152

Closed oscarlorente closed 3 years ago

oscarlorente commented 3 years ago

Hello, I'm using frankmocap to get the SMPL-X model of a man, but I also need to detect his head using the corresponding SMPL-X prediction. So far, I've been able to identify the vertices corresponding to the head (using the SMPL-X - FLAME correspondences from here) and plot it using your openGL renderer:

Screenshot from 2021-08-23 14-35-56

However, I'm interested in getting the head's bbox coordinates, that is, knowing the pixels on which the SMPL-X vertices are projected. I'm not sure how to get them from the renderer code, any ideas?

penincillin commented 3 years ago

Basically, you need to project the head vertices to image space and obtain head bbox from the projected 2D head vertices. You can check the code here, where pred_vertices_img is already aligned to the image space. You can directly take the [x, y] coordinates to obtain the projected 2D vertices. Since you already know how to select out head vertices, you just need to do that again to pred_vertices_img to obtain the head vertices in image space and then obtain 2D head bbox.

oscarlorente commented 3 years ago

That works like a charm, thank you very much!

ruyiwei-cas commented 2 years ago

@oscarlorente

ruyiwei-cas commented 2 years ago

@oscarlorente How did you get this picture and how to paste the RGB information into the generated mesh. image