This repository estimates facial landmarks to identify if a person blinks or if the person is sleeping.
Before you begin, ensure you have met the following requirements:
- You have a Windows/Linux/Mac machine running Python 3.6+.
- You have installed the latest versions of
pip
andvirtualenv
orconda
(Anaconda).
To install the dependencies, you can simply follow this steps.
Clone the project repository:
git clone https://github.com/RodolfoFerro/eye-blink.git
cd eye-blink
To create and activate the virtual environment, follow these steps:
Using conda
$ conda create -n eye-blink python=3.7
# Activate the virtual environment:
$ conda activate eye-blink
# To deactivate (when you're done):
(eye-blink)$ conda deactivate
Using virtualenv
# In this case I'm supposing that your latest python3 version is 3.6+
$ virtualenv eye-blink --python=python3
# Activate the virtual environment:
$ source eye-blink/bin/activate
# To deactivate (when you're done):
(eye-blink)$ deactivate
To install the requirements using pip
, once the virtual environment is active:
(eye-blink)$ pip install -r requirements.txt
Finally, if you want to run the main script:
$ python main.py
This will start your camera and open a window with the output.
If you want to change the parameters of the blink detector, you can directly modify the specs from the tools/config.py
script.