The code within the teste_de_conceito
folder consists of tests conducted to assess the feasibility of various implementation methods for the proposed solutions.
The combination that yielded the best results involved analyzing the face with MediaPipe and extracting the 468 landmarks. From these landmarks, the eye region was selected.
For each eye's corresponding image, a histogram analysis of the image colors was performed after applying some filters to attempt to determine the positions of the iris and pupil. The result was that the pupil is reasonably easy and consistent to obtain, however, the iris is not. Therefore, an additional step will be added to the analysis process using another MediaPipe algorithm that extracts the iris position from a face.
- Python 3.9
- pipenv
I use the pipenv
package manager. If you do not have it installed, run pip install pipenv
.
To execute the program:
pipenv shell
pipenv install
python main.py [arguments]
It is FORBIDDEN to place folders containing the '.' character in their name inside the /raw directory for batch processing.
THE VIDEOS MUST BE NAMED record.avi
OR record.mp4
.
The script accepts several command-line arguments to configure its global options. Below are the available options and their descriptions.
Argument | Description | Accepted Values | Default Value |
---|---|---|---|
-showprocess |
Defines whether the process will be displayed. | s (yes), n (no) | n |
-drawbb |
Defines whether the bounding box will be drawn. | s (yes), n (no) | n |
-drawir |
Defines whether the iris will be drawn. | s (yes), n (no) | n |
-drawpu |
Defines whether the pupil will be drawn. | s (yes), n (no) | n |
-drawpp |
Defines whether the passed positions will be drawn. | s (yes), n (no) | s |
-drawmp |
Defines whether the mask points will be drawn. | s (yes), n (no) | n |
-drawheadpose |
Defines whether the head direction vector will be shown. | s (yes), n (no) | n |
-draweyegaze |
Defines whether the gaze direction vectors of both eyes will be shown. | s (yes), n (no) | n |
-showwarn |
Defines whether warnings will be displayed. | s (yes), n (no) | s |
-multicore |
Defines whether multicore processing will be used. | s (yes), n (no) | n |
-overwrite |
Defines whether existing files will be overwritten. If -multicore is s, the default is s. Otherwise, it is n. |
s (yes), n (no) | n |
-path |
Defines the path to the files. | string | "./vds" |
python main.py -showprocess s -drawbb n -path "./meus_arquivos"
Note: If an invalid argument is provided for an option, the script will print an error message and terminate its execution.
python visualization_generator/main.py <path to the csv file with the extracted data> [optional --verbose]
This will create a visualizations
folder in the same directory as the csv file you provided, and it will save the visualizations inside.
pipenv run pyinstaller --onefile --paths [your_path] ./main.py --add-data '[your_path]\Lib\site-packages\mediapipe\modules:mediapipe/modules' --add-data '[your_path]\Lib\site-packages\mediapipe\python\solutions:mediapipe/solutions'
Replace [your_path]
with the appropriate path for your environment.