{"id":20545972,"url":"https://github.com/rtjoa/deep-face-morph","last_synced_at":"2026-04-15T18:01:52.314Z","repository":{"id":37652476,"uuid":"270154138","full_name":"rtjoa/deep-face-morph","owner":"rtjoa","description":"Compares significant features in faces with a convolutional autoencoder and PCA.","archived":false,"fork":false,"pushed_at":"2022-11-22T18:59:14.000Z","size":4587,"stargazers_count":2,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T08:43:41.376Z","etag":null,"topics":["autoencoder","machine-learning","pca","principal-component-analysis","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rtjoa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-07T01:17:42.000Z","updated_at":"2025-02-06T02:45:28.000Z","dependencies_parsed_at":"2023-01-21T13:00:21.286Z","dependency_job_id":null,"html_url":"https://github.com/rtjoa/deep-face-morph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rtjoa/deep-face-morph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtjoa%2Fdeep-face-morph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtjoa%2Fdeep-face-morph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtjoa%2Fdeep-face-morph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtjoa%2Fdeep-face-morph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rtjoa","download_url":"https://codeload.github.com/rtjoa/deep-face-morph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtjoa%2Fdeep-face-morph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31853279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["autoencoder","machine-learning","pca","principal-component-analysis","python"],"created_at":"2024-11-16T01:55:01.511Z","updated_at":"2026-04-15T18:01:52.296Z","avatar_url":"https://github.com/rtjoa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deep Face Morph\n\nCompares significant features in faces with a convolutional autoencoder and principal component analysis (PCA).\n\n## Getting started\n\nInstall with `requirements.txt` (recommended) or the following commands in an Anaconda environment:\n\n```\nconda install python=3.7\nconda install numpy\nconda install tensorflow\nconda install pillow\nconda install bs4\npip install opencv-python\n```\n\nTo download and preprocess the training data (from an archive.org capture of famousbirthdays.com), run `scraper.py` then `preprocessor.py`.\n\nTrain the model and run the main application with `deep_face_morph.py`.\n\n## Model Overview\n\nA convolutional autoencoder is trained on the images, then PCA is performed on their latent space representations.\n\n\u003cimg src='assets/model.png' width='530'/\u003e\n\n## Convolutional Autoencoder\n\nThe encoder and decoder models are trained together, using the input images as labels.\n\nThis incentivizes the autoencoder to find a low-dimensional encoding from which it can reconstruct the original images as accurately as possible.\n\n\u003cimg src='assets/convolutional-autoencoder.png' width='500'/\u003e\n\n## Principal Component Analysis\n\nApplying PCA to the latent vectors identifies a new set of meaningful features.\n\nBelow shows the manipulation of the feature with the fourth-highest eigenvalue, which seems to control lighting from the side. The picture was taken in a room with purple lighting, which it accounts for realistically.\n\n\u003cimg src='assets/component.gif' width='128'/\u003e\n\nBelow is the feature with the seventh-highest eigenvalue, seemingly corresponding to horizontal rotation. Recall that these features were all \"discovered\" by the model.\n\n\u003cimg src='assets/component2.gif' width='128'/\u003e\n\nComparing these features can be used to find lookalikes: as they are extracted from images of faces, many should correspond to facial structure.\n\nIn the future, lookalikes can be improved by weighting features based on how consistent they are between photographs of the same person.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtjoa%2Fdeep-face-morph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtjoa%2Fdeep-face-morph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtjoa%2Fdeep-face-morph/lists"}