{"id":2780819,"url":"https://github.com/hassony2/manopth","last_synced_at":"2025-08-06T00:31:44.101Z","repository":{"id":44846159,"uuid":"175451875","full_name":"hassony2/manopth","owner":"hassony2","description":"MANO layer for PyTorch, generating hand meshes as a differentiable layer","archived":false,"fork":false,"pushed_at":"2023-04-21T09:43:19.000Z","size":241,"stargazers_count":569,"open_issues_count":18,"forks_count":98,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-06-11T16:55:13.185Z","etag":null,"topics":["hand","layer","mano","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hassony2.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}},"created_at":"2019-03-13T15:46:47.000Z","updated_at":"2024-06-11T05:38:04.000Z","dependencies_parsed_at":"2022-07-19T18:03:25.199Z","dependency_job_id":null,"html_url":"https://github.com/hassony2/manopth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassony2%2Fmanopth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassony2%2Fmanopth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassony2%2Fmanopth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassony2%2Fmanopth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hassony2","download_url":"https://codeload.github.com/hassony2/manopth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":215732737,"owners_count":15922927,"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":["hand","layer","mano","pytorch"],"created_at":"2024-01-29T11:44:56.861Z","updated_at":"2024-08-17T07:31:02.526Z","avatar_url":"https://github.com/hassony2.png","language":"Python","funding_links":[],"categories":["Conference Papers","Python"],"sub_categories":["2019 CVPR"],"readme":"Manopth\n=======\n\n[MANO](http://mano.is.tue.mpg.de) layer for [PyTorch](https://pytorch.org/) (tested with v0.4 and v1.x)\n\nManoLayer is a differentiable PyTorch layer that deterministically maps from pose and shape parameters to hand joints and vertices.\nIt can be integrated into any architecture as a differentiable layer to predict hand meshes.\n\n![image](assets/mano_layer.png)\n\nManoLayer takes **batched** hand pose and shape vectors and outputs corresponding hand joints and vertices.\n\nThe code is mostly a PyTorch port of the original [MANO](http://mano.is.tue.mpg.de) model from [chumpy](https://github.com/mattloper/chumpy) to [PyTorch](https://pytorch.org/).\nIt therefore builds directly upon the work of Javier Romero, Dimitrios Tzionas and Michael J. Black.\n\nThis layer was developped and used for the paper *Learning joint reconstruction of hands and manipulated objects* for CVPR19.\nSee [project page](https://github.com/hassony2/obman) and [demo+training code](https://github.com/hassony2/obman_train).\n\n\nIt [reuses](https://github.com/hassony2/manopth/blob/master/manopth/rodrigues_layer.py) [part of the great code](https://github.com/MandyMo/pytorch_HMR/blob/master/src/util.py) from the  [Pytorch layer for the SMPL body model](https://github.com/MandyMo/pytorch_HMR/blob/master/README.md) by Zhang Xiong ([MandyMo](https://github.com/MandyMo)) to compute the rotation utilities !\n\nIt also includes in `mano/webuser` partial content of files from the original [MANO](http://mano.is.tue.mpg.de) code ([posemapper.py](mano/webuser/posemapper.py), [serialization.py](mano/webuser/serialization.py), [lbs.py](mano/webuser/lbs.py), [verts.py](mano/webuser/verts.py), [smpl_handpca_wrapper_HAND_only.py](mano/webuser/smpl_handpca_wrapper_HAND_only.py)).\n\nIf you find this code useful for your research, consider citing:\n\n- the original [MANO](http://mano.is.tue.mpg.de) publication:\n\n```\n@article{MANO:SIGGRAPHASIA:2017,\n  title = {Embodied Hands: Modeling and Capturing Hands and Bodies Together},\n  author = {Romero, Javier and Tzionas, Dimitrios and Black, Michael J.},\n  journal = {ACM Transactions on Graphics, (Proc. SIGGRAPH Asia)},\n  publisher = {ACM},\n  month = nov,\n  year = {2017},\n  url = {http://doi.acm.org/10.1145/3130800.3130883},\n  month_numeric = {11}\n}\n```\n\n- the publication this PyTorch port was developped for:\n\n```\n@INPROCEEDINGS{hasson19_obman,\n  title     = {Learning joint reconstruction of hands and manipulated objects},\n  author    = {Hasson, Yana and Varol, G{\\\"u}l and Tzionas, Dimitris and Kalevatykh, Igor and Black, Michael J. and Laptev, Ivan and Schmid, Cordelia},\n  booktitle = {CVPR},\n  year      = {2019}\n}\n```\n\nThe training code associated with this paper, compatible with manopth can be found [here](https://github.com/hassony2/obman_train). The release includes a model trained on a variety of hand datasets.\n\n# Installation\n\n## Get code and dependencies\n\n- `git clone https://github.com/hassony2/manopth`\n- `cd manopth`\n- Install the dependencies listed in [environment.yml](environment.yml)\n  - In an existing conda environment, `conda env update -f environment.yml`\n  - In a new environment, `conda env create -f environment.yml`, will create a conda environment named `manopth`\n\n## Download MANO pickle data-structures\n\n- Go to [MANO website](http://mano.is.tue.mpg.de/)\n- Create an account by clicking *Sign Up* and provide your information\n- Download Models and Code (the downloaded file should have the format `mano_v*_*.zip`). Note that all code and data from this download falls under the [MANO license](http://mano.is.tue.mpg.de/license).\n- unzip and copy the `models` folder into the `manopth/mano` folder\n- Your folder structure should look like this:\n```\nmanopth/\n  mano/\n    models/\n      MANO_LEFT.pkl\n      MANO_RIGHT.pkl\n      ...\n  manopth/\n    __init__.py\n    ...\n```\n\nTo check that everything is going well, run `python examples/manopth_mindemo.py`, which should generate from a random hand using the MANO layer !\n\n## Install `manopth` package\n\nTo be able to import and use `ManoLayer` in another project, go to your `manopth` folder and run `pip install .`\n\n\n`cd /path/to/other/project`\n\nYou can now use `from manopth import ManoLayer` in this other project!\n\n# Usage \n\n## Minimal usage script\n\nSee [examples/manopth_mindemo.py](examples/manopth_mindemo.py)\n\nSimple forward pass with random pose and shape parameters through MANO layer\n\n```python\nimport torch\nfrom manopth.manolayer import ManoLayer\nfrom manopth import demo\n\nbatch_size = 10\n# Select number of principal components for pose space\nncomps = 6\n\n# Initialize MANO layer\nmano_layer = ManoLayer(mano_root='mano/models', use_pca=True, ncomps=ncomps)\n\n# Generate random shape parameters\nrandom_shape = torch.rand(batch_size, 10)\n# Generate random pose parameters, including 3 values for global axis-angle rotation\nrandom_pose = torch.rand(batch_size, ncomps + 3)\n\n# Forward pass through MANO layer\nhand_verts, hand_joints = mano_layer(random_pose, random_shape)\ndemo.display_hand({'verts': hand_verts, 'joints': hand_joints}, mano_faces=mano_layer.th_faces)\n```\n\nResult :\n\n![random hand](assets/random_hand.png)\n\n## Demo \n\nWith more options, forward and backward pass, and a loop for quick profiling, look at [examples/manopth_demo.py](examples/manopth_demo.py).\n\nYou can run it locally with:\n\n`python examples/manopth_demo.py`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhassony2%2Fmanopth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhassony2%2Fmanopth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhassony2%2Fmanopth/lists"}