This is a web app integrated with ML models to recognize human faces and identify genders.
- Install Anaconda Python
- Install virtural environment
python3 -m pip install --user virtualenv
- Create virtual environment
python3 -m venv flask
- Activate virtual environment
source flask/bin/activate
- Install dependencies in requirement.txt
pip install -r requirements.txt
- Install OpenCV
pip install opencv-python
- Read input image
- Convert image to greyscale
- Extract/Crop the face using haar cascase classifier
- Data normalization (min max)
- Resize image to (100,100)
- Flatten image to (1x10000)
- Subtract mean
- Get the eigen image
- Pass to ML model - SVM
- Generate the prediction and score
- Mark the output on the image
- Install flask
python3 -m pip install Flask
- How to run the web app
python main.py
- Set the development mode
export FLASK_ENV=development
- Create a Heroku account
- Install Heroku CLI
- Create Procfile
echo "web: gunicorn app:app" > Procfile
- Install Gunicorn
python3 -m pip install gunicorn
- Install dependencies
python3 -m pip freeze > requirements.txt
- Create the application
heroku create face-recognition-classify
- Push
git push heroku master