Code Monkey home page Code Monkey logo

morph-server's Introduction

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.

morph-server's People

Contributors

asi309 avatar dependabot[bot] avatar jabhishek87 avatar mehta-raghav avatar tarunnsingh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

morph-server's Issues

Update Documentation

While going through the readme, I found minor changes and I would like to update them, like including the pip version for successful installation, etc.

Dockerize this Server

Is your feature request related to a problem? Please describe.
This is with reference to this issue on the client repo. It would be better to dockerize this server, so that it can be deployed which would be a cake walk. Currently this Flask app shows error while deploying to HEROKU etc. As this uses CMake, DLib, OpenCV etc. which are often known for their compatibility issues.

Describe the solution you'd like
Create a Docker File, which when built EXPOSES a port to the API Endpoints.

Describe alternatives you've considered
I have tried this but while installing SYS REQ, CMake Fails giving error that Boost was not found.

FROM python:3.6.0

RUN python -m pip install pip==9.0.1

RUN apt-get update && apt-get install libboost-all-dev

WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
EXPOSE 5000

ENTRYPOINT [ "python" ]
CMD [ "app.py" ]

Additional context
This Server uses python 3.6.0 and pip 9.0.1.

Add a Database for Storing Images.

image

Suggestion: Can Use FLASK-SQL-Alchemy
Currently the Server saves all the images and morphs in a local storage of the server folder itself. Implementing a database would help in optimizing speeds of different operations and also enable the path to create more feature like saving morphs for different users etc.

Python Env

Hello,

I test to dockerize your server in docker, but i have a problem to pip install cmake.
Can you provide me your version of python and pip ?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.