Giter VIP home page Giter VIP logo

darknet_for_colab's Introduction

Custom Darknet for training YOLOv4 on Google Colab with custom dataset

Setup darknet environment in Colab Notebook

To enable GPU backend for your notebook: Runtime->Change runtime type->Hardware Accelerator->GPU

# run these command line from notebook cell

!git clone https://github.com/quangnhat185/darknet_for_colab.git
%cd darknet_for_colab
!make
!chmod +x ./darknet

Tuning parameters from Colab environment

Double click on yolov4_config.pyto edit model parameters. More details about the meaning of each parameter can be found here


Generate YOLOv4 config and test file

!python yolov4_setup.py

Train with YOLOv4

!./darknet detector train data/yolov4.data cfg/yolov4_custom_train.cfg {weights_path} -map

Predict with YOLOv4

  • Image (predicted image is saved at predictions.jpg:

    %cp data/yolov4.data cfg/coco.data
    !./darknet detect cfg/yolov4_custom_test.cfg {weights_path} {img_path}
    
  • Video:

    usage: darknet_video.py [-h] -v VIDEO [-c CONFIG] -w WEIGHTS [-l LABEL]
                    [-m META] [-o OUTPUT]
    
    optional arguments:
      -h, --help            show this help message and exit
      -v VIDEO, --video VIDEO
                            Path to input video
      -c CONFIG, --config CONFIG
                            Path to yolo config file
      -w WEIGHTS, --weights WEIGHTS
                            Path to yolo weight
      -l LABEL, --label LABEL
                            Path to label file
      -m META, --meta META  Path to metaPath
      -o OUTPUT, --output OUTPUT
                            Path to output file  
    
    !python darknet_video.py -v {video path} -c cfg/yolov4_custom_test.cfg -w {weights_path}  -o output.mp4
    

Tutorial

YOLOv4 in Google Colab: Train your Custom Dataset (Traffic Signs) with ease

License

License

MIT License

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.