Repository contains source code for thermal camera laboratory advanced and additional task "paper, rock, scissors gesture recognition". Laboratory is part of "Introduction to Image Processing" (pl. "Wprowadzenie do Przetwarzania Obrazu") university subject at Poznan University of Technology.
"Paper, rock, scissors" thermal dataset consists of about 150 images for each class and the same quantity belongs to class other. The dataset is available online and can be downloaded from Google Drive.
Project consists of three steps:
- collect data,
- train classification model,
- check and evaluate trained model. It is possible to skip task 1 and use prepared dataset.
In order to collect new data examples, one can use gesture_capture.py
script which contains a pipeline for saving images for the specified category.
Save keys are at the top of the script and by default are as follow:
PAPER_KEY = 'p'
ROCK_KEY = 'r'
SCISSORS_KEY = 's'
OTHER_KEY = 'o'
Run script with command:
python3 gesture_capture.py
For training SqueezeNet classification model one can use Jupyter Notebook and local machine or utilize online Google Colab Notebook.
For evaluation purposes, the gesture_recognition.py
script was prepared. It takes as an input a path to model and ensures continuous classification of gestures in input thermal image. After training (and downloading model) run script with command:
python3 gesture_recognition.py --model_path <PATH TO MODEL>
Example results are presented below.