Giter Site home page Giter Site logo

rajdeep2804 / darknet_yolo_tutorial Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 9.2 MB

This repo acts like a training guide for yolo object detection model for custom data.

License: Other

CMake 1.85% Makefile 0.26% PowerShell 1.37% C# 0.27% Batchfile 0.58% Python 4.51% Shell 0.68% C 63.29% C++ 12.56% Cuda 14.63%
yolo darknet tutorial training yolov3 object-detection

darknet_yolo_tutorial's Introduction

Darknet_yolo_tutorial

Training Framework

A generalised training framework consisting of all kinds of models like Yolo, RCNN etc. with default model configurations.

Description

This repo acts like a training guide for yolo object detection model got custom data.

Testing CUDA,

To test that CUDA works, go to the CUDA demo suite directory: cd /usr/local/cuda/extras/demo_suite/ ./deviceQuery

Executing darknet

Download the yolov3 weights in Darknet dir: wget https://pjreddie.com/media/files/yolov3.weights

Make Sure in Makefile 'gpu == 1'. From darknet dir run make

For Testing Darknet: ./darknet detect cfg/yolov3.cfg yolov3.weights data/dog.jpg

Custom Training,

Copy "yolov3.cfg" file from cfg to custom_data/cfg dir, and rename to yolov3-custom.cfg

Making changes in yolov3-custom.cfg file:

The maximum number of iterations for which our network should be trained is set with the param max_batches=4000. Also update steps=3200,3600 which is 80%, 90% of max_batches, you can set value based on your training requirements.

classes param in the yolo layers to based on number of classes you are workning with like for one or 2 class at line numbers: 610, 696, 783.

Similarly we will need to update the filters param based on the classes count filters=(classes + 5) * 3. For a single class we should set filters=18 at line numbers: 603, 689, 776.

Updating custom_data dir,

Updating "custom.names" file : Mention all class name,

Updating "detector.names" file :

classes=1 train=custom_data/train.txt //Path to text file of images path for training. valid=custom_data/test.txt // Path to text file of images path for testing. names=custom_data/custom.names //Path to the class names backup=backup/ //path to save weights

Test.txt need to store the path of each image used for testing Train.txt need to store the path of each image used for training

Command to initialise training,

./darknet detector detector train custom_data/detector.data custom_data/cfg/yolov3-custom.cfg yolov3.weights

Evaluating your training,

./darknet detector test custom_data/detector.data custom_data/cfg/yolov3-custom.cfg backup/yolov3_final.weights -ext_output -out eval.json < eval.txt
./darknet detector map data/obj.data custom_data/cfg/yolov3-custom.cfg backup/yolov3_final.weights
./darknet detector recall data/obj.data custom_data/cfg/yolov3-custom.cfg backup/yolov3_final.weights

#note eval.json will store all the output bounding box for each input image path stored in the eval.txt, //eval.txt will be prepared exactly like test.txt/train.txt

darknet_yolo_tutorial's People

Contributors

rajdeep2804 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.