This is a fork of Natanielruiz's head pose detection code.
Done by Lim Zi Xiong and Bryan Wong as part of internship project.
I am writing this to guide other people and future interns on how this repo is used.
Anaconda is used to handle most packages.
Anaconda packages can be found in spec-file.txt (Explicit Version) or requirements.txt (Non-Explicit Version
To enable GPU Utilisation when running the AI model, CUDA ToolKit and cuDNN is installed.
This more specifically allows us to compile software that can utilise Nvidia GPUs.
CUDA Toolkit installation guide
cuDNN installation guide
Image can be found here Docker Repo, Use DLIB_GPU.
Dockerfile is on Alienware Laptop, it is located in a folder on the Samsung X5 Solid State Drive.
Install CUDA Toolkit + cuDNN
CUDA Toolkit installation guide
cuDNN installation guide
Install Anaconda Packages
conda create --name <env> --file conda.txt -c pytorch -c conda-forge
Activate conda environment
conda activate <env name>
Install some other packages
conda install torchvision -c pytorch
conda install scikit-learn -c conda-forge
conda install --yes -c conda-forge scikit-image
We need to install these packages manually as i cannot seem to make a working explicit environment file.
Install dlib
pip3 install dlib
Test is DLIB uses GPU, result should show True.
python .\GPUTest\DLIBTest.py
Test cuDNN Version
python .\GPUTest\testCuDNNVersion.py
Activate conda environment
conda activate <env name>
Run Code, read webcam input
python code/i_webcam.py --snapshot models/mysnap_epoch_29.pkl --face_model dlib/mmod_human_face_detector.dat --video conan-cruise.gif --fps 24
Specifying video input
python code/i.py --snapshot models/mysnap_epoch_29.pkl --face_model dlib/mmod_human_face_detector.dat --video conan-cruise.gif --fps 24