{"id":15020352,"url":"https://github.com/hriddhidey/visage","last_synced_at":"2025-05-02T22:31:29.545Z","repository":{"id":57458341,"uuid":"101393581","full_name":"hriddhidey/visage","owner":"hriddhidey","description":"Add virtual makeup to picture of a face.","archived":false,"fork":false,"pushed_at":"2018-05-26T14:22:24.000Z","size":70796,"stargazers_count":108,"open_issues_count":0,"forks_count":28,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-17T18:26:07.799Z","etag":null,"topics":["face","face-detection","image-processing","lipstick","makeup","opencv","picture","python","virtual","visage"],"latest_commit_sha":null,"homepage":null,"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/hriddhidey.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":"2017-08-25T10:29:54.000Z","updated_at":"2024-11-12T05:29:27.000Z","dependencies_parsed_at":"2022-09-06T12:41:51.230Z","dependency_job_id":null,"html_url":"https://github.com/hriddhidey/visage","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hriddhidey%2Fvisage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hriddhidey%2Fvisage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hriddhidey%2Fvisage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hriddhidey%2Fvisage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hriddhidey","download_url":"https://codeload.github.com/hriddhidey/visage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252116299,"owners_count":21697350,"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":["face","face-detection","image-processing","lipstick","makeup","opencv","picture","python","virtual","visage"],"created_at":"2024-09-24T19:54:57.239Z","updated_at":"2025-05-02T22:31:24.536Z","avatar_url":"https://github.com/hriddhidey.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Visage\nAdd virtual makeup to a picture of a face.\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cimg width='300' text='Before' alt=\"Plain human face.\" src=\"https://user-images.githubusercontent.com/11678594/30020825-ef9a1d74-9182-11e7-93f3-90a218de516b.png\"\u003e \u003c/td\u003e\n\u003ctd\u003e \u003cimg width='300' text='After' alt=\"Human face with makeup.\" src=\"https://user-images.githubusercontent.com/11678594/30020826-efe4d6ca-9182-11e7-9b59-0324abdf7219.png\"\u003e \u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003eImage without makeup.\u003c/td\u003e\n\u003ctd\u003eImage with lipstick and eyeliner.\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cbr /\u003e\n\n\n## Installation \n\n### _MacOS_\n\n1. You need **\u003e=Python2.7** and `pip` to get this working. MacOS comes with Python2.7 installed by default. If you don't have `pip`, follow these steps to get it - \t\n\t* `curl -O https://bootstrap.pypa.io/get-pip.py`\n\t* `sudo python get-pip.py`\n\t* `pip install --upgrade pip`\n\n\n2. Install **Cmake, Boost, and Boost-Python** - `brew install cmake boost boost-python`\n\u003e If you don't have [Homebrew](https://brew.sh/), copy paste the following in your terminal to get it - \n`/usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"`\n\n3. See Step 4 - Generic.\n\n\u003cbr /\u003e\n\n### _Linux_\n\n1. You will need **\u003e=Python2.7** and `pip` to get this working.\nKindly figure out how to get the same for your distribution.\n\n2. You need Cmake, and Boost-Python. To get the same, use `yum` or `apt-get` as you please.\n```\nsudo yum install cmake boost boost-devel \n```\n\u003e*Note:* You will need C++11 compiler for Cmake. CentOS does not come with the same out of the box. Follow [**this link's instructions**](https://hiltmon.com/blog/2015/08/09/c-plus-plus-11-on-centos-6-dot-6/) to get it.\n\n\u003e*Note:* Kindly raise issues if you face setup problems on your Linux distributions. I will ammend the instructions to resolve the same.\n\n3. See Step 4 - Generic.\n\n\u003cbr /\u003e\n\n### _Generic_\n\n4. Kindly consider using a **virtual environment** for development. Check out [**this link**](http://docs.python-guide.org/en/latest/dev/virtualenvs/) for detailed explanations on how to do that. Follow these steps to get up and running quickly -\n```\npip install virtualenv\nvirtualenv my_project\ncd my_project \u0026\u0026 source bin/activate\n```\nNow you can install your python modules and run your code in an isolated chamber. Once you're done, run `deactivate` to close the virtual environment.\n\n5. Install the python module requirements by running - `pip install pyvisage`\n\u003e_Note_: If you are not using `virtualenv`, you might need `sudo` to make this work.\n\n\u003cbr /\u003e\n\n## Usage\n\nThe module is named `visage`, and consists of two classes - `Detect Features` and `ApplyMakeup`. You can import, and access their functions to either selectively detect face only, or apply lipstick directly. Kindly read the [Wiki](https://github.com/hriddhidey/visage/wiki) for detailed usage.\n\nExample - \n\u003e_Note_: You will need a working internet connection the first time you run this, as it will download a predictor file to your project folder the first time.\n```\nfrom visage import ApplyMakeup\nAM = ApplyMakeup()\noutput_file = AM.apply_lipstick('input.jpg',170,10,30) # (R,G,B) - (170,10,30)\n```\nThis assumes you have a front-facing image of a human face saved in your current directory as `input.jpg`.\n\n\u003cbr /\u003e\n\n## Guidelines for Image\n\nCertain best practices to be followed to ensure optimal detection and application -\n* Positioning: Face the camera directly and position yourself so that your face fills the about 50-70% of the frame. Avoid extreme angles and poses.\n* Expressions: Preferably maintain a neutral expression. Smiles will be detected comfortably, as long as the shape of the mouth and lips aren't too contorted. Remove any dark glasses or tinted lenses, and keep both eyes open for proper application of eyeliner.\n* Lighting: For increased visibility, avoid bright backlighting ( such as the sun, or other bright light sources ), and glare, by taking your photographs under an even light. \n* Orientation: Kindly ensure an upright orientation in portrait mode.\n\u003cimg width=\"300\" alt=\"screen shot 2017-08-08 at 12 51 54 pm\" src=\"https://user-images.githubusercontent.com/11678594/30049806-9e7d90bc-9239-11e7-9db0-57825c1c4928.png\"\u003e\n\n* Focus \u0026 Movement: Image focus and blur can have similar effects on performance as low resolution. Thus, make sure your captured image is not blurry. If the camera is having difficulty focusing, you might be too close or too far from the device.\n\n\u003cbr /\u003e\n\n## Attributions\nI would like to thank [Davis E. King](https://github.com/davisking) who built [dlib](http://dlib.net/), for the documentation and sample codes provided, which were a great help in building this.\n\n\u003cbr /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhriddhidey%2Fvisage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhriddhidey%2Fvisage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhriddhidey%2Fvisage/lists"}