ftx / morph-server

Flask Server for Face-Morp webapp. This server exposes api-endpoints to generate morphed GIFs of the incoming images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Face Morphing (Server Side Script) - See Client Side Here.

Project Demo 🤓

IMAGE ALT TEXT HERE

What is Morphing? 🤔

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.

About this Server. 🧐

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.).

Steps for Local Deployment of server: 🚀

  1. 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.
  2. Clone the repo.
  3. Open terminal/CMD in repo directory.
  4. Create a new virtual environment by py -m venv env.
  5. Activate the environment by env\Scripts\activate.
  6. Intall the packages by pip install -r requirements.txt
  7. Start the server by python server.py.

Note: The Server will run on http://localhost:5000, don't forget to add a proxy of this URL in your client side script.

Contribute

Check and put up Issues and let me know the features which you wish to add before making a PR.

Leave a ⭐ if you found this helpful.

About

Flask Server for Face-Morp webapp. This server exposes api-endpoints to generate morphed GIFs of the incoming images.

License:MIT License


Languages

Language:Python 92.3%Language:HTML 7.7%