Spaces:
Running
Running
| tsdk_version: 6.11.0 | |
| python_version: '3.10' | |
| app_file: app.py | |
| title: Virtual Makeup | |
| emoji: ๐ | |
| sdk: gradio | |
| sdk_version: 6.11.0 | |
| # Virtual-Makeup | |
| Python, OpenCV based virtual tryon for makeup lip-color, blush, foundation ~~and prolly eyewear too~~ | |
| These python scripts add "make up" on to an input. The input is either a static image of a person's face or live webcam feed. | |
| Currently only lipcolor and face blush is supported and the color of defaults to `rgb(157, 0, 153)` but it can be changed. | |
| # How to use | |
| 1. Clone this repository | |
| 2. Create a virtual environment using `python3 -m venv env` or anyother way of creating virtual envs | |
| 3. Install the requirements using `pip install -r requirements.txt` | |
| 4. To try the makeup process on the included model.jpg comment out the video capture code and uncomment the static image code and run `python main.py` | |
| # Sample outputs from ths implementation | |
| Original Sample |Blush Applied | |
| :-------------------------:|:-------------------------: | |
|  |  | |
| Original Sample |Lip Color applied | |
| :-------------------------:|:-------------------------: | |
|  |  | |
| Original Sample |Foundation applied | |
| :-------------------------:|:-------------------------: | |
|  |  | |
| ## How it works | |
| Using mediapipe I detect 468 facial landmarks and and pull out the required landmarks (lips and cheek landmarks) and after that I use simple image processing techniques to achieve the end result | |
| ## File structure | |
| `main.py` -> Primary file, reads the input image and applies the makeup | |
| `api.py` -> Contains the fastapi endpoints | |
| `landmarks.py` -> Contains all the functionality for the landmarks (detection, normalization etc) | |
| `sample.py` -> A sample script that uses `python-requests` to demonstrate the endpoints | |
| `utils.py` -> Contains utility functions. | |
| ## Fast API | |
| Provides openapi spec by default, run using `uvicorn api:app` and navigate to localhost:8000/docs to view the openapi spec or to localhost:8000/redoc to view the redoc spec. Currently two API Endpoints are supported `apply-makeup` and `apply-feature` (Needs Fix, doesn't work as of now) |