{"id":21264283,"url":"https://github.com/rickdgray/cg","last_synced_at":"2025-07-30T08:04:32.041Z","repository":{"id":147928884,"uuid":"337549905","full_name":"rickdgray/CG","owner":"rickdgray","description":"Computer Graphics","archived":false,"fork":false,"pushed_at":"2021-06-25T19:52:49.000Z","size":14252,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-15T07:47:16.261Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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/rickdgray.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":"2021-02-09T22:09:49.000Z","updated_at":"2021-06-25T19:52:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"d34eb4f6-dc8c-465b-8f76-4253f632bfa3","html_url":"https://github.com/rickdgray/CG","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rickdgray/CG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickdgray%2FCG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickdgray%2FCG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickdgray%2FCG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickdgray%2FCG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rickdgray","download_url":"https://codeload.github.com/rickdgray/CG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickdgray%2FCG/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267834738,"owners_count":24151634,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-21T05:01:26.580Z","updated_at":"2025-07-30T08:04:32.005Z","avatar_url":"https://github.com/rickdgray.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# COSC 6372 Computer Graphics\n# 3D Mesh Generation and Landmark Transfer\nThis project will take flat images of human faces and generate 3D meshes, then transfer landmarks from other faces to distort the mesh.\n\n### Setting up the environment\nThere's a lot. You _must_ have an NVIDIA GPU; it will not run without one. I also strongly recommend running on a modern linux distribution, though hypothetically it will run on other operating systems.\nRunning from a live linux session instead of a standard installation will almost certainly not work.\nThis was built and ran on Ubuntu 20 with a GTX 1080.\n\nFirst, verify you have python3 and pip3 installed:\n```bash\nsudo apt install python3 python3-pip\n```\n\nThen, you will need to install the nvidia cuda toolkit. This generator was built on the Pytorch3D library which requires version 10.2. The latest version (11.3 at time of writing) is not backwards compatible.\n\nOn Ubuntu 20, running\n```bash\nsudo apt install nvidia-cuda-toolkit\n```\ninstalled the correct version, but this will depend on the repository. See the [CUDA archive](https://developer.nvidia.com/cuda-toolkit-archive) for installing older versions if necessary.\n\nYou can test that it is running properly by running the following command:\n```bash\nnvidia-smi\n```\n\nThen you may run\n```bash\npip3 install -r requirements.txt\n```\nto install the requisite python packages. Note that the torch version is 1.7.1 and torchvision is 0.8.2 exclusively. Later versions are not backwards compatible with Pytorch3D, so these specific versions must be installed.\n\nFinally, you can run \n```bash\npip3 install fvcore ioPath\nexport FORCE_CUDA=1\npip3 install \"git+https://github.com/facebookresearch/pytorch3d.git\"\n```\nto install [pytorch3d](https://github.com/facebookresearch/pytorch3d).\n\nIt is recommended to set the environment variable `FORCE_CUDA` to `1` so that compilation will fail if the cuda toolkit is not installed properly.\n\n### Setting up model and input\nThis project builds on the [DECA](https://arxiv.org/abs/2012.04012) library and the [FLAME](https://flame.is.tue.mpg.de/home) generic models. We will use DECA's trained neural network and the generic mesh from FLAME to generate our _base faces_.\n\nTo do so, these two files must be prepared:\n  1. The 'generic_model.pkl' file unzipped into the data folder from the [FLAME 2020](https://flame.is.tue.mpg.de/downloads) model pack\n  2. The [DECA trained model](https://drive.google.com/file/d/1rp8kdyLPvErw2dTmqtjISRVvQLj6Yzje/view?usp=sharing) copied directly into the data folder as a .tar. It is not a standard tarball and tar will not decompress it.\n\nOnce the files are in place, a simple photo of a source face may be placed into the 'input/faces' folder and a source face for landmark transfer may be placed in the 'input/transfer' folder for processing. Photos cropped to around the face with a straight on view produce the best results.\n\nFinally, to generate a mesh and renders, you can simply run\n```bash\npython3 gen_faces.py\n```\nfrom the root folder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickdgray%2Fcg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frickdgray%2Fcg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickdgray%2Fcg/lists"}