{"id":21512013,"url":"https://github.com/strvcom/strv-ml-mask2face","last_synced_at":"2025-04-09T18:22:01.111Z","repository":{"id":97728316,"uuid":"292036881","full_name":"strvcom/strv-ml-mask2face","owner":"strvcom","description":"Virtually remove a face mask to see what a person looks like underneath","archived":false,"fork":false,"pushed_at":"2021-05-15T13:28:36.000Z","size":25578,"stargazers_count":64,"open_issues_count":10,"forks_count":21,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-23T20:22:23.522Z","etag":null,"topics":["autoencoder","computer-vision","convolutional-neural-network","deep-learning","face-mask","inpainting","machine-learning","python","resnet","tensorflow2","unet"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/strvcom.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":"2020-09-01T15:32:26.000Z","updated_at":"2025-03-22T10:02:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"2621c595-24a4-4887-9e46-19a528421182","html_url":"https://github.com/strvcom/strv-ml-mask2face","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/strvcom%2Fstrv-ml-mask2face","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strvcom%2Fstrv-ml-mask2face/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strvcom%2Fstrv-ml-mask2face/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strvcom%2Fstrv-ml-mask2face/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strvcom","download_url":"https://codeload.github.com/strvcom/strv-ml-mask2face/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085650,"owners_count":21045192,"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":["autoencoder","computer-vision","convolutional-neural-network","deep-learning","face-mask","inpainting","machine-learning","python","resnet","tensorflow2","unet"],"created_at":"2024-11-23T22:25:35.765Z","updated_at":"2025-04-09T18:22:01.098Z","avatar_url":"https://github.com/strvcom.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mask2face\n\nCan you virtually remove a face mask to see what a person looks like underneath? Our Machine Learning team proves it’s possible via an image inpainting-based ML solution. [Here](https://www.strv.com/blog/mask2face-how-we-built-ai-that-shows-face-beneath-mask-engineering) is exactly how our engineers approached the problem — from the preconditions to the implementation, results and future improvements.\n\n**Check out [the article](https://www.strv.com/blog/mask2face-how-we-built-ai-that-shows-face-beneath-mask-engineering) for a more in-depth explanation**\n\n![Example Result 1](images/result_1.png)\n![Example Result 2](images/result_2.png)\n**Examples of results** (input | expected output | actual output)\n\n## How to run this project\nResults can be replicated by following those steps:\n\n### How to setup ENV\n- If your **system does not have an Nvidia CUDA device available**, please comment `tensorflow-gpu==2.2.0` in the _environment.yml_ file.\n- If you are running MacOS, change `tensorflow==2.2.0` to `tensorflow==2.0.0` in the _environment.yml_ file.\n- Use [Conda ENV Manager](https://towardsdatascience.com/a-guide-to-conda-environments-bc6180fc533) to create new ENV: `conda env create -f environment.yml`\n- Activate the ENV: `conda activate mask2face`\n\n### Get Data\n- Download [Labeled Faces in the Wild data](http://vis-www.cs.umass.edu/lfw/lfw-deepfunneled.tgz) and unzip its content into _data_ folder or use `mask2face.ipynb` that will download it automatically.\n- You can get better results using larger dataset or dataset with higher quality images. For example [CelebA dataset](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html) contains over 200 000 high quality images. \n\n### Configuration\nYou can configure the project using the `configuration.json`. Some of the items are set up and should not be changed. However, changing some of the following items can be useful. \n- `input_images_path`: Path to dataset with images that are input for the DataGenerator. If you want to use a different dataset than the default one, set the path to it here.\n- `train_data_path`: Path where are training images generated and where training algorithm is looking for training data.\n- `test_data_path`: Path where are testing images generated.\n- `train_image_count`: Number of training image pairs generated by DataGenerator.\n- `test_image_count`: Number of testing image pairs generated by DataGenerator.\n- `train_data_limit`: Number of training image pairs used for model training.\n- `test_data_limit`: Number of testing image pairs used for model testing.\n\n### Train the model\n- Run Jupyter server in the ENV: `jupyter notebook`\n- Follow instructions in the _mask2face_ notebook\n\n### Known Issues\n- There might be a memory leak when training the model \n- Performance on real-world data might not be optimal - follow our [tips](https://www.strv.com/blog/mask2face-how-we-built-ai-that-shows-face-beneath-mask-engineering#ideas-for-additional-improvements) to get possible results on real-world data\n- **If you encounter any other issues, please, let us know; we are happy to help**\n\n## Final Notes\nIf you’re considering our help, you may be interested in our other past work—like the [custom AI solution we built for Cinnamon in just four months](https://www.strv.com/blog/strv-cinnamon-building-custom-ai-solutions-in-4-months). And if you’re a fellow engineer, please feel free to reach out to us with any questions or share your work results. We’re always happy to start up a discussion. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrvcom%2Fstrv-ml-mask2face","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrvcom%2Fstrv-ml-mask2face","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrvcom%2Fstrv-ml-mask2face/lists"}