Skip to content

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

License

Notifications You must be signed in to change notification settings

tarunnsingh/morph-server

Repository files navigation

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 storage (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:
  • CMD - py -m venv env
  • terminal - python3 -m venv env
  1. Activate the environment by:
  • CMD - env\Scripts\activate
  • terminal - source env/bin/activate
  1. Intall the packages by pip install -r requirements.txt
  2. Start the server by python app.py.

Important Note: As of now, use pip version 9.0.1 for properly installing all the dependencies.

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.