/emotion-detection-openvino

Emotion Detection REST API using OpenVINO, Flask

Primary LanguagePython

Flask OpenVINO - Emotion Detection API

This project provides a rest api, where you can send image as multipart data/ in base64 string format to 2 seperate endpoints and endpoint will provide the emotion as of the person in the image.

Getting Started

Run in Development Environment

  1. Clone the Repository
  2. Install the Dependancies using pip install -r requirements.txt
  3. Open .env file and set SERVER_ENV to DEVELOPMENT
  4. Run the server in development environment using python3 server.py

You can change the served port by using the --port 3000 argument after server.py. --debug to enable debugging and if you have a different configuration file, you can use --config <path/to/config.yaml>.

  1. To test the API you can use the integrated Swagger UI by going to the link shown in the terminal. Probably will be http://127.0.0.1:5000 or using Curl.

Run in Production Environment

  1. Clone the Repository
  2. Install the Dependancies using pip install -r requirements.txt
  3. Open .env file and set SERVER_ENV to PRODUCTION
  4. Run the server using gunicorn w -4 server:app

Endpoints

  • /emotion

    • use multipart form in postman or any other api client and add a parameter called 'imgfile' and upload your image file
  • /emotion/base64

    and execute the request. if the request was successful, you will receive a json response in the format of {"emotion": "surprise"}

Todos

  • Docker Integration
  • Elastic APM to Track the Performance
  • Better Emotion Detection Model (This model is shit.)
  • Fix Not working on Heroku