Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,51 @@ This project focuses on detecting distinct live hand gestures. A Machine Learnin
- Upload images to the [Hugging face repository](https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/tree/main)
- Depending on the gestures you captured add to the respective folder

## Data Annotation

### Step 1

- Clone the HuggingFace repository using the following command:

``` bash
git clone https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition --depth=1
```

- This will download all the pictures from our dataset, organised into their respective folders.
- It would be wise to just select one gesture (folder) to work on at a time

### Step 2

- Go to cvat.ai and log in with your GitHub account (or another way, but GitHub will be convenient since we've already been using it a lot).
- On the landing page, select Projects, and press the blue plus button, then create new project.
- Name the project after the gesture you picked in step 1.
- Select 'add label' and give it an appropriate name (of your gesture) and press continue
- Submit and open
- On the next screen, press the blue button and this will create a new task
- Name the task after the gesture you picked in step 1 and add `_train` to the end
- For subset, select 'Train'
- Now follow the prompt to upload the files and upload the photos associated with your gesture, however, do **NOT** upload all. Leave the last three images in your folder unuploaded to be used for validation.
- Select submit and continue
- After uploading is complete, go back to projects, and double click on your project. Press the blue button again and add another task.
- Name the task after the gesture you picked in step 1 and add `_val` to the end
- For subset, select 'Validation'
- Upload the remaining files you have not yet uploaded.
- Press submit and continue

### Step 3

- In the navbar up the top, select 'jobs' then select your job (please note that you'll have to do step 3 twice, one for test, another for val)
- You should see one of the pictures of your gesture. On the sidebar to the left, select the rectangle icon and make sure the label is set to the one you created.
- Draw a new rectangle that highlights the section of the image that your gesture is in. (Note that you can press 'N' to start and stop the rectangle drawing process, and 'F' to progress to the next image. Utilising this will drastically improve the speed at which you annotate

### Step 4

- Return to Projects on the navbar
- Press on the three dots on your project and select `Export dataset`
- Select export format as `Ultralytics YOLO Detection 1.0` and export.
- Once complete
- Exported dataset can be found under the `Requests` navbar, and click on the three dots with the most recent requets, and press download.

## File Structure

For the YOLO model, the following file structure is required:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ A Code Network **Gesture Recognition Software** project implemented in **Python*

| Gesture | Example | Gesture | Example |
| ------- | --------| ------- | --------|
| Thumbs up | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/thumbs_up/WIN_20250317_18_48_48_Pro.jpg" width="200"> | Thumbs down | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/thumbs_down/IMG_5097.jpeg" width="200"> |
| Sign of the Horns (Rock Sign) | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/devil_horns/IMG_4961.jpeg" width="200"> | Vulcan Salute | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/vulcan/IMG_6498.jpg" width="200"> |
| Palm/Stop | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/palm/Photo%20on%2024-03-25%20at%206.24%E2%80%AFPM%20%232.jpeg" width="200"> | Fist Bump | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/fist_bump/IMG_4952.jpeg" width="200"> |
| Fist | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/fist_up/20250323_111104.jpg" width="200"> | Peace | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/peace/IMG_5095.jpeg" width="200"> |
| Heart Fingers | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/heart_finger/IMG_5107.jpeg" width="200"> | Heart Hands | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/heart_hands/WIN_20250324_12_19_04_Pro.jpg" width="200"> |
| Chef's Kiss | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/chef_kiss/IMG_5083.jpeg" width="200"> | Okay | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/okay/IMG_5013.jpeg" width="200"> |
| Thumbs up | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/thumbs_up/thumbs_up0.jpeg" width="200"> | Thumbs down | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/thumbs_down/thumbs_down10.jpeg" width="200"> |
| Horns Sign | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/horns_sign/horns_sign0.jpeg" width="200"> | Vulcan Salute | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/vulcan_salute/vulcan_salute0.jpeg" width="200"> |
| Palm/Stop | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/palm/palm12.jpeg" width="200"> | Fist Bump | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/fist_bump/fist_bump10.jpeg" width="200"> |
| Fist | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/fist_up/fist_up0.jpeg" width="200"> | Peace | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/peace/peace0.jpeg" width="200"> |
| Heart Fingers | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/heart_fingers/heart_fingers0.jpeg" width="200"> | Heart Hands | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/heart_hands/heart_hands10.jpeg" width="200"> |
| Chef's Kiss | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/chefs_kiss/chefs_kiss11.jpeg" width="200"> | Okay | <img src="https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition/resolve/main/okay/okay0.jpeg" width="200"> |

## 🚀 Installation

Expand Down
59 changes: 59 additions & 0 deletions yolo_train.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "e1ecbc84",
"metadata": {},
"outputs": [],
"source": [
"%pip install -r requirements.txt"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "18883ba2",
"metadata": {},
"outputs": [],
"source": [
"import ultralytics\n",
"ultralytics.checks()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a50eb0ab",
"metadata": {},
"outputs": [],
"source": [
"from ultralytics import YOLO\n",
"model = YOLO(\"yolo12n.pt\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5b1e12c5",
"metadata": {},
"outputs": [],
"source": [
"model.train(data=\"data.yaml\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python",
"version": "3.12.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}