{"id":20431448,"url":"https://github.com/eladrich/pix2vertex.pytorch","last_synced_at":"2025-04-07T19:13:52.970Z","repository":{"id":44333431,"uuid":"260274047","full_name":"eladrich/pix2vertex.pytorch","owner":"eladrich","description":"An official pyTorch port of the pix2vertex paper from ICCV2017","archived":false,"fork":false,"pushed_at":"2022-07-09T05:06:19.000Z","size":5398,"stargazers_count":193,"open_issues_count":8,"forks_count":23,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-31T18:18:49.499Z","etag":null,"topics":["deep-learning","iccv","pytorch","reconstruction"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eladrich.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":"2020-04-30T17:24:45.000Z","updated_at":"2024-12-06T08:48:56.000Z","dependencies_parsed_at":"2022-08-29T06:51:07.473Z","dependency_job_id":null,"html_url":"https://github.com/eladrich/pix2vertex.pytorch","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/eladrich%2Fpix2vertex.pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eladrich%2Fpix2vertex.pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eladrich%2Fpix2vertex.pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eladrich%2Fpix2vertex.pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eladrich","download_url":"https://codeload.github.com/eladrich/pix2vertex.pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247713258,"owners_count":20983683,"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":["deep-learning","iccv","pytorch","reconstruction"],"created_at":"2024-11-15T08:11:55.598Z","updated_at":"2025-04-07T19:13:52.008Z","avatar_url":"https://github.com/eladrich.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unrestricted Facial Geometry Reconstruction Using Image-to-Image Translation - Official PyTorch Implementation\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/eladrich/pix2vertex.pytorch/mybinder?filepath=reconstruct_pipeline.ipynb)\n[![PyPI version](https://badge.fury.io/py/pix2vertex.svg)](https://badge.fury.io/py/pix2vertex)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\n[[Arxiv]](https://arxiv.org/pdf/1703.10131.pdf) [[Video]](https://www.youtube.com/watch?v=6lUdSVcBB-k)\n\n\nEvaluation code for Unrestricted Facial Geometry Reconstruction Using Image-to-Image Translation. Finally ported to PyTorch!\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"examples/jupyter_gif.gif\" width=\"425px\"/\u003e \u003cimg src=\"examples/3dprint.jpg\" width=\"425px\"/\u003e\n \u003c/p\u003e\n\n\n## Recent Updates\n\n**`2020.10.27`**: Added STL support\n\n**`2020.05.07`**: Added a wheel package!\n\n**`2020.05.06`**: Added [myBinder](https://mybinder.org/v2/gh/eladrich/pix2vertex.pytorch/mybinder?filepath=reconstruct_pipeline.ipynb) version for quick testing of the model\n\n**`2020.04.30`**: Initial pyTorch release\n\n# What's in this release?\n\nThe [original pix2vertex repo](https://github.com/matansel/pix2vertex) was composed of three parts\n - A network to perform the image to depth + correspondence maps trained on synthetic facial data\n - A non-rigid ICP scheme for converting the output maps to a full 3D Mesh  \n - A shape-from-shading scheme for adding fine mesoscopic details\n\n\n This repo currently contains our image-to-image network with weights and model to `PyTorch` and a simple `python` postprocessing scheme.\n - The released network was trained on a combination of synthetic images and unlabeled real images for some extra robustness :)\n\n## Installation\nInstallation from PyPi\n```bash\n    $ pip install pix2vertex\n```\nInstallation from source\n```bash\n    $ git clone https://github.com/eladrich/pix2vertex.pytorch.git\n    $ cd pix2vertex.pytorch\n    $ python setup.py install\n```\n## Usage\nThe quickest way to try `p2v` is using the `reconstruct` method over an input image, followed by visualization or STL creation.\n```python\n import pix2vertex as p2v\n from imageio import imread\n\n image = imread(\u003csome image file\u003e)\n result, crop = p2v.reconstruct(image)\n\n# Interactive visualization in a notebook\n p2v.vis_depth_interactive(result['Z_surface'])\n\n# Static visualization using matplotlib\np2v.vis_depth_matplotlib(crop, result['Z_surface'])\n\n# Export to STL\np2v.save2stl(result['Z_surface'], 'res.stl')\n```\nFor a more complete example see the `reconstruct_pipeline` notebook. You can give it a try without any installations using our [binder port](https://mybinder.org/v2/gh/eladrich/pix2vertex.pytorch/mybinder?filepath=reconstruct_pipeline.ipynb).\n\n### Pretrained Model\nModels can be downloaded from these links:\n- [pix2vertex model](https://drive.google.com/open?id=1op5_zyH4CWm_JFDdCUPZM4X-A045ETex)\n- [dlib landmark predictor](http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2) - note that the dlib model has its own license.\n\nIf no model path is specified the package automagically downloads the required models.\n\n\n## TODOs\n- [x] Port Torch model to PyTorch\n- [x] Release an inference notebook (using [K3D](https://github.com/K3D-tools/K3D-jupyter))\n- [x] Add requirements\n- [x] Pack as wheel\n- [x] Ported to MyBinder\n- [x] Add a simple method to export a stl file for printing\n- [ ] Port the Shape-from-Shading method used in our matlab paper\n- [ ] Write a short blog about the revised training scheme\n\n## Citation\nIf you use this code for your research, please cite our paper \u003ca href=\"https://arxiv.org/pdf/1703.10131.pdf\"\u003eUnrestricted Facial Geometry Reconstruction Using Image-to-Image Translation\u003c/a\u003e:\n\n```\n@article{sela2017unrestricted,\n  title={Unrestricted Facial Geometry Reconstruction Using Image-to-Image Translation},\n  author={Sela, Matan and Richardson, Elad and Kimmel, Ron},\n  journal={arxiv},\n  year={2017}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feladrich%2Fpix2vertex.pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feladrich%2Fpix2vertex.pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feladrich%2Fpix2vertex.pytorch/lists"}