This repository contains the codes used in the paper "Underwater Gesture Recognition Using Classical Computer Vision and Deep Learning Techniques". The codes are divided into three groups: one for each model used in the paper.
-
Scripts (adopted from Kushal Vyas’ implementation of Bag of Visual Words: https://github.com/kushalvyas/Bag-of-Visual-Words-Python)
-
To test:
- Put train images in
./images/train folder
; this is needed to get the classes to be used in testing - Put test images in
./images/test folder
- Put
kmeans_cluster_3.sav
,mega_histogram_3.pkl
,svm_train_3.pkl
,and vstack_3.pkl
in the same directory as Bag.py and helpers.py (Link to pretrained weights: https://drive.google.com/open?id=1hSaZwRpbtOqFYep7Z4jW2kkKizEHoVqO) 4. Runpython Bag.py
- Put train images in
-
Dependencies:
-OpenCV 3.4.2.17 (OpenCV-contrib-python==3.4.2.17), scikit-learn 0.20.3
- To test:
- Put test images in
./images/test
folder 2. Puthog_svm.joblib
pre-trained model in./models
folder (Link to pretrained weights: https://drive.google.com/open?id=1pirGWIkZqWXBNSwQKuTdLpmMKowYrOUK) - Create
./results/
folder, where the csv containing the target classes and predictions will be saved - Run testing.py
- Put test images in
- To visualize sample correct and incorrect predictions per class:
- Create
./visualization/
folder, which will contain the sample images with predictions - Run
visualize_predictions.py
- Create
- Dependencies:
-OpenCV 4.1.0.25 (opencv-contrib-python==4.1.0.25), scikit-learn 0.21.0
- To test:
- Place the test in
./images/test
folder - Put the pre-trained model
resnet50_CNN_caddy.pickle
in the same directory as classifier_withtest.py (https://drive.google.com/file/d/1EQxRwaFTZVlmVlTZDVx5Y1fcLAxjL6Qj/view?usp=sharing) - Run
classifier_withtest.py
- Place the test in
- Dependencies:
- pytorch 0.4.0
- cuda 9.0
- Link to train images: https://drive.google.com/open?id=1JCXaT9PSnyJ4KgTzlumMrmwALVt-2V_t
- Link to test images: https://drive.google.com/open?id=1ducpYZnC9dQznG90HbiyZSX3CYCR8UbR