Face Morphing (Server Side Script) - See Client Side Here.
The face morphing algorithm morphs between faces using a common set of feature points, placed by hand on each face. To morph between two faces, you need to warp both faces to a common shape so they can be blended together.
This is Flask based API Server, manages the two API Endpoints namely: POST /api/upload
and GET /api/morph/<images>
. The former accepts and a POST request to save an Image to the servers local storge (No Database Connected Yet!). The latter responds to the GET request appended with a unique image name under , which basically creates a MORPH of the two images and returns the morphed GIF. On the client repo, ReactJS has been used, however any Frontend framework can be used as per your choice (Angular, Vue etc.).
- Download the 68 facial landmarks predictor by dlib from here and extract it to the root directory. It should have the following name : shape_predictor_68_face_landmarks.dat.
- Clone the repo.
- Open terminal/CMD in repo directory.
- Create a new virtual environment by
py -m venv env
. - Activate the environment by
env\Scripts\activate
. - Intall the packages by
pip install -r requirements.txt
- Start the server by
python server.py
.
Note: The Server will run on http:https://localhost:5000, don't forget to add a proxy of this URL in your client side script.
Check and put up Issues and let me know the features which you wish to add before making a PR.