Giter VIP home page Giter VIP logo

s15yolov9's Introduction

YOLOV9 model trained on custom dataset.

Trained to detect tabla (Indian classical musical instrument)

Original Repo

Usage

Clone the repo in a jupityer note book or where ever you are going to train:

[email protected]:walnashgit/S15YoloV9.git

The custom data set is in the folder tabla. If using a different dataset, follow the folder structue same as the one here and update the data.yaml file accordingly.

Move to the root folder and install the requirements:

%cd S15YoloV9
!pip install -r requirements.txt -q

Download one of the weights from the below. This repo is trained on yolov9-e.pt

#!wget https://github.com/WongKinYiu/yolov9/releases/download/v0.1/yolov9-c.pt
!wget https://github.com/WongKinYiu/yolov9/releases/download/v0.1/yolov9-e.pt
# !wget https://github.com/WongKinYiu/yolov9/releases/download/v0.1/gelan-c.pt
#!wget https://github.com/WongKinYiu/yolov9/releases/download/v0.1/gelan-e.pt

Base on the weight downloaded use below code to start training:

# train yolov9 models
!python train_dual.py \
--batch 8 --epochs 25 --img 640 --device 0 --min-items 0 --close-mosaic 15 \
--data /content/S15YoloV9/tabla/data.yaml \
--weights /content/S15YoloV9/yolov9-e.pt \
--cfg /content/S15YoloV9/models/detect/yolov9-e.yaml \
--hyp hyp.scratch-high.yaml
# train gelan models
!python train.py \
--batch 8 --epochs 25 --img 640 --device 0 --min-items 0 --close-mosaic 15 \
--data /content/S15YoloV9/tabla/data.yaml \
--weights /content/S15YoloV9/yolov9-e.pt \
--cfg /content/S15YoloV9/models/detect/gelan-c.yaml \
--hyp hyp.scratch-high.yaml

Note the cfg file should be based on the model weight being used. Adjust batch size to suit the available memory.

The results of trainig are stored in runs/train/exp. The trained model weight is in runs/train/exp/weights/best.pt.

To viualise the validation images:

from IPython.display import Image
Image(filename=f"/content/S15YoloV9/runs/train/exp/val_batch0_pred.jpg", width=1000)

image

To run trained model on validation or any other test dataset:

!python detect.py \
--img 1280 --conf 0.1 --device 0 \
--weights /content/S15YoloV9/runs/train/exp/weights/best.pt \
--source /content/S15YoloV9/tabla/valid/images

The training results are stored in runs/detect/exp

Ref video for training.

Read the Readme from the original repo for details about the model

Check out this video to understand the architecture.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.