Simple flask app that provides api endpoint for ipd distance measurement.
- Flask
- NumPy
- OpenCV-Python
- Dlib
- Shape predictor file (shape_predictor_68_face_landmarks.dat)
-
Clone the repository:
git clone https://github.com/sammigul/ipd-flask.git
-
Installing packages
pip install flask numpy opencv-python
-
Installing dlib (depends on the python version for ver 3.11 this file that I provided in the repo is required)
pip install dlib-19.24.1-cp311-cp311-win_amd64.whl
- This file can be downloadeed from this github repository
- Place this in the root of repository
- Setting the Environment Variables
set FLASK_APP=app.py
set FLASK_ENV=development
-
Running the App
flask run -p PORTNO # Replace PORTNO with the desired port number (default is 5000)
OR use this command if flask is not set in path variable
python -m flask run -p PORTNO # Replace PORTNO with the desired port number (default is 5000)
Send an HTTP POST request to http://127.0.0.1:5000/measure_ipd, server will return the ipd distance in millimetres