- https://github.com/ageitgey/face_recognition/blob/master/face_recognition/api.py#L213
- https://www.pyimagesearch.com/2018/06/18/face-recognition-with-opencv-python-and-deep-learning/
- https://github.com/huytranvan2010/Face-Recognition-with-OpenCV-Python-DL
- Setting python in your computer https://www.python.org/downloads/
- Setting visual c++ (can use visual studio) (contain Window SDK, C++ complier, ... all necessary portion for setup dlib)
- Open project and cd to the root folder
- Setting virtual environment
python -m venv venv
cd .\venv\Scripts\
.\Activate.ps1
- Setting necessary lib (if run in machine that has GPU, can remove dlib and face_recognition in requirements.txt file)
pip install -r requirements.txt
- Run app
py .\app.py
- Setup cuda toolkit và cuDNN : https://www.youtube.com/watch?v=lw5dpTl0yZE
- cd to venv/Lib folder
- Setting dlib with GPU
git clone https://github.com/davisking/dlib.git
cd dlib
mkdir build
cd build
cmake .. -DDLIB_USE_CUDA=1 -DUSE_AVX_INSTRUCTIONS=1
cmake --build .
cd ..
python setup.py install --set USE_AVX_INSTRUCTIONS=1 --set DLIB_USE_CUDA=1
- Setup face_recognition
pip install face_recognition
- After setup, if have error when run app, go to file init.py of dlib folder just install and edit the code that add GPU
if 'ON' == 'ON':
- https://mtuseeq.medium.com/how-to-deploy-flask-app-on-windows-server-using-fastcgi-and-iis-73d8139d5342 ( note: because use venv to run project so FastCGI also need to install in venv)
- Need change identity of application pool from 'ApplicationPoolIdentity' to 'LocalSystem'
- Maybe need to change handlemapping in IIS: https://www.youtube.com/watch?v=aJfHVXg-Tu8&ab_channel=TechieBlogging (7:20)