diff --git a/Documentation.md b/Documentation.md index 875f42c..8410255 100644 --- a/Documentation.md +++ b/Documentation.md @@ -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: 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 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 +}