{"id":20444866,"url":"https://github.com/snapchat/meshpose","last_synced_at":"2025-10-26T23:15:39.517Z","repository":{"id":259032358,"uuid":"866026408","full_name":"Snapchat/MeshPose","owner":"Snapchat","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-21T14:23:17.000Z","size":14512,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-26T18:21:23.378Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Snapchat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-01T14:21:05.000Z","updated_at":"2025-03-14T07:28:20.000Z","dependencies_parsed_at":"2024-10-22T17:04:45.237Z","dependency_job_id":null,"html_url":"https://github.com/Snapchat/MeshPose","commit_stats":null,"previous_names":["snapchat/meshpose"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snapchat%2FMeshPose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snapchat%2FMeshPose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snapchat%2FMeshPose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Snapchat%2FMeshPose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Snapchat","download_url":"https://codeload.github.com/Snapchat/MeshPose/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248648718,"owners_count":21139344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T10:09:28.300Z","updated_at":"2025-10-26T23:15:39.421Z","avatar_url":"https://github.com/Snapchat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MeshPose: Unifying DensePose and 3D Body Mesh reconstruction\n\nInference and Evaluation code for the paper **MeshPose: Unifying DensePose and 3D Body Mesh reconstruction (CVPR 2024)**\n\n[![report](https://img.shields.io/badge/Project-Page-blue)](https://meshpose.github.io/)\n[![report](https://img.shields.io/badge/ArXiv-Paper-red)](https://arxiv.org/abs/2406.10180)\n\n![Example Image](assets/screenshots_from_video_demos.png)\n\n## Installation\n\n```\ngit clone https://github.com/Snapchat/MeshPose.git\n\nconda create -n meshpose python=3.11\nconda activate meshpose\n\npip install -r requirements.txt\n```\n\nPlease download the model weights and place them in `./checkpoints` via the links in `./checkpoints/checkpoints.md`\n\nThe code has been tested on Ubuntu and Mac (on both GPU and CPU-only machines).\n\n## Run Demo \nTo run MeshPose on an image with a bounding box:\n```\npython3 inference.py\n```\nThis will plot the front and side view of the predicted vertices on top of the original image.\n\n## Run Video Demo\nTo run MeshPose on a video using a simple person detector/tracker:\n```\npython3 video_demo.py --input_video assets/4812014-hd_1920_1080_30fps.mp4 --do_rendering\n```\nThis will render the meshes of all detected persons on top of the original video. \nIt will also save the predicted vertices for every frame in a json-file.\n\nTo use the ``--do_rendering`` option, ``densepose_eval`` must be installed in the ``third_party`` directory (see below).\n\n## Run Image Folder Demo\nTo run MeshPose on an image folder using a simple person detector/tracker:\n```\npython3 images_demo.py --input_folder assets/example_images --do_rendering\n```\nThis will render the meshes of all detected persons on top of each original image. \nIt will also save the predicted vertices for each image in a json-file.\n\nTo use the ``--do_rendering`` option, ``densepose_eval`` must be installed in the ``third_party`` directory (see below).\n\n## MeshPose Evaluation on the DensePose Benchmark\n\n### Data and Benchmark Preparation\n\nClone `densepose_eval` in `third_party`\n```\ncd third_party\ngit clone https://github.com/MeshPose/densepose_eval.git\n```\nand follow its [installation instructions](https://github.com/MeshPose/densepose_eval?tab=readme-ov-file#installation).\n\nDownload the `densepose minival` dataset and the UV data into `./DensePose_COCO` according to the instructions in [`./DensePose_COCO/densepose_dataset.md`](https://github.com/Snapchat/MeshPose/blob/main/DensePose_COCO/densepose_dataset.md).\n\n\n### MeshPose Inference on Densepose Minival\nThe following command will run meshpose on each instance in the evaluation dataset and save the results in `output/model_predictions.json`\n```\npython3 inference_coco.py --output_model_predictions output/model_predictions.json\n```\n\n### Evaluation of MeshPose Mesh Alignment on the DensePose Benchmark\n```\npython3 evaluate_densepose.py --input_model_predictions output/model_predictions.json --output_densepose_score output/densepose_predictions.txt\n```\n\n## General Human Mesh Recovery Evaluation on the DensePose Benchmark\nTo evaluate another Human Mesh Recovery method on DensePose, create a json file (`my_mesh_predictions.json`) with the following structure:\n```\n[\n            {'image_id': $image_id_0,  # int\n             'id': $instance_id_0,  # int\n             'smpl_z': $verts_z_0,  # (6980, )\n             'smpl_xy_proj': $verts_xy_proj_0}  # (6980, 2),\n             \n            {'image_id': $image_id_1,  # int\n             'id': $instance_id_1,  # int\n             'smpl_z': $verts_z_1,  # (6980, )\n             'smpl_xy_proj': $verts_xy_proj_1}  # (6980, 2),\n        ...\n\n]\n\n```\nThis is a list of dictionaries, each dictionary corresponding to an instance in `DensePose_COCO/densepose_coco_2014_minival.json`.\n```\nimage_id: the COCO image_id of the image containing the instance\nid: the COCO id of the instance\nsmpl_z: a list containing the depth of each vertex (Normalized in (-1, 1))\nsmpl_xy_proj: a list of tuples (x,y) corresponding to the projection of the mesh on the original image\n```\n\nPlease make sure that the `smpl_xy_proj` coordinates are aligned with the original image.\n\nNote: To accelerate this, you can skip instances that don't have a `'dp_masks'` field, as they don't contain DensePose annotations and don't contribute to the metrics.\n\nOnce `my_mesh_predictions.json` is ready, the system can be evaluated via:\n\n```\npython3 evaluate_densepose.py --input_model_predictions my_mesh_predictions.json --output_densepose_score output/my_mesh_predictions.txt\n```\n\nResults are saved in `output/my_mesh_predictions.txt`. We report the `GPSM AR` and `GPSM AP` quantities.\n\n## Citing\n```\n@InProceedings{Le_2024_CVPR,\n    author    = {Le, Eric-Tuan and Kakolyris, Antonis and Koutras, Petros and Tam, Himmy and Skordos, Efstratios and Papandreou, George and G\\\"uler, Riza Alp and Kokkinos, Iasonas},\n    title     = {MeshPose: Unifying DensePose and 3D Body Mesh Reconstruction},\n    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},\n    month     = {June},\n    year      = {2024},\n    pages     = {2405-2414}\n}\n```\n\n## Contact\n\nFor questions about this work please contact [akakolyris@snap.com](akakolyris@snap.com) or [e.le@cs.ucl.ac.uk](e.le@cs.ucl.ac.uk)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnapchat%2Fmeshpose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnapchat%2Fmeshpose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnapchat%2Fmeshpose/lists"}