From fb0c476982be135511926419bfcba5e351db3374 Mon Sep 17 00:00:00 2001 From: adynsydeeznuts Date: Mon, 31 Mar 2025 18:37:34 +1000 Subject: [PATCH 1/5] Update Documentation.md to give instructions on annotation --- Documentation.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Documentation.md b/Documentation.md index 875f42c..5457da7 100644 --- a/Documentation.md +++ b/Documentation.md @@ -29,6 +29,31 @@ 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 'create new task' option. +- Name the task after the gesture you picked in step 1 +- Select 'add label' and give it an appropriate name +- Now follow the prompt to upload the files and upload the photos associated with your gesture (enter the folder for you gesture and hit CTRL + A to select them all, then upload) +- Now just select 'submit and open' + +### Step 3 + +- In the navbar up the top, select 'jobs' then select your job +- 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 + ## File Structure For the YOLO model, the following file structure is required: From 33f8261d09a542db901e264a5e8f8a34d4330cbb Mon Sep 17 00:00:00 2001 From: sryu1 <95025816+sryu1@users.noreply.github.com> Date: Tue, 1 Apr 2025 09:58:32 +1000 Subject: [PATCH 2/5] Update annotation guide --- Documentation.md | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/Documentation.md b/Documentation.md index 5457da7..65c664d 100644 --- a/Documentation.md +++ b/Documentation.md @@ -30,23 +30,35 @@ This project focuses on detecting distinct live hand gestures. A Machine Learnin - 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 +- 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 'create new task' option. -- Name the task after the gesture you picked in step 1 -- Select 'add label' and give it an appropriate name -- Now follow the prompt to upload the files and upload the photos associated with your gesture (enter the folder for you gesture and hit CTRL + A to select them all, then upload) -- Now just select 'submit and open' +- 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 @@ -54,6 +66,14 @@ git clone https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition --depth=1 - 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: From 2725028ab9007422d1f30c859dd2511c48adda07 Mon Sep 17 00:00:00 2001 From: sryu1 <95025816+sryu1@users.noreply.github.com> Date: Mon, 7 Apr 2025 12:24:09 +1000 Subject: [PATCH 3/5] Update Documentation.md --- Documentation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation.md b/Documentation.md index 65c664d..8410255 100644 --- a/Documentation.md +++ b/Documentation.md @@ -55,14 +55,14 @@ git clone https://huggingface.co/datasets/CNGR/CN_Gesture_Recognition --depth=1 - 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 +- 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 +- 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 From 6d92450c6166197eafbd380ef8c8d1e4f29aca52 Mon Sep 17 00:00:00 2001 From: sryu1 <95025816+sryu1@users.noreply.github.com> Date: Mon, 7 Apr 2025 22:33:49 +1000 Subject: [PATCH 4/5] add initial training code --- yolo_train.ipynb | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/yolo_train.ipynb b/yolo_train.ipynb index e69de29..78b5ef4 100644 --- a/yolo_train.ipynb +++ b/yolo_train.ipynb @@ -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 +} From 15f2fb024916a8c87cd02989301b43ec80dc0f22 Mon Sep 17 00:00:00 2001 From: sryu1 <95025816+sryu1@users.noreply.github.com> Date: Mon, 7 Apr 2025 22:49:46 +1000 Subject: [PATCH 5/5] Reupdate gesture examples --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 253585b..24ebe34 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,12 @@ A Code Network **Gesture Recognition Software** project implemented in **Python* | Gesture | Example | Gesture | Example | | ------- | --------| ------- | --------| -| Thumbs up | | Thumbs down | | -| Sign of the Horns (Rock Sign) | | Vulcan Salute | | -| Palm/Stop | | Fist Bump | | -| Fist | | Peace | | -| Heart Fingers | | Heart Hands | | -| Chef's Kiss | | Okay | | +| Thumbs up | | Thumbs down | | +| Horns Sign | | Vulcan Salute | | +| Palm/Stop | | Fist Bump | | +| Fist | | Peace | | +| Heart Fingers | | Heart Hands | | +| Chef's Kiss | | Okay | | ## 🚀 Installation