Giter VIP home page Giter VIP logo

yolo_tutorial's Introduction

Yolo tutorial

This is the code i used in my tutorial of Yolo algorithm.
Link to YouTube video:
https://www.youtube.com/watch?v=MKF1NHGgFfk
The head of Yolo v3, v4, tiny algorithms works roughly the same, the main change is in the 'back-bone' which is feature extractor.
So experiment on them to find which one works the best for you.
You can manipulate live thresholds(confidence-CONF, intersection of union-IOU) and accessories(anchor boxes, grids) using keyboard on the image and see how it affects detection. Keyboard keys:

  • 'w'/'W' - IOU + 0.01/0.1
  • 's'/'S' - IOU - 0.01/0.1
  • 'd'/'D' - CONF + 0.01/0.1
  • 'a'/'A' - CONF - 0.01/0.1
  • 'b' - show/hide anchor boxes ON/OFF
  • 'g' - show hide grid and center of object ON/OFF
  • 'space' - pause/unpause
  • 'v' - record video ON/OFF
  • 'p' - screen shot
  • 'r' - image ratio ON/OFF
  • '3' - yolov3
  • '4' - yolov4
  • '#' - yolov3-tiny
  • '$' - yolov4-tiny
  • '[' - subtract 32 pixels to the width
  • ']' - add 32 pixels to the width
  • 't' - show class and probability on box ON/OFF
  • 'T' - show text on the left

If you'll click capital letter(left SHIFT + letter) gain/loss will be 0.1

Demo of the keyboard steering

demo(1)

You can run detection on:

  • images and videos from your pc/laptop
  • directly from camera
  • from most of the images on the web just by passing the link of them.

You can compare 4 algorithms on different input sizes(320, 416(most popular), 620, any integer multiple of 32):

  • Yolov3
  • Yolov3-tiny
  • Yolov4
  • Yolov4-tiny

Google Colab notebook

If you first want to give it a try before installing check the Google colab version. You can do there everything that you could do on your machine but only on image from the web and without the keyboard commands, you need to initialize instance of class Detetcion with right parameters.
Link to colab notebook:
https://colab.research.google.com/github/MaxMLgh/YOLO_tutorial/blob/master/Google_Colab_Yolo_Tutorial.ipynb image

Instalation on your machine

First clone this repository using git

git clone https://github.com/MaxMLgh/YOLO_tutorial.git

Or simply download and unpack the ZIP file(change folder name from 'yolo_tutorial-master' to 'yolo_tutorial' for convenience. Then enter the repository.

Installing using conda(recommended)

conda create --name yolo_tutorial python=3.8
conda activate yolo_tutorial
pip install opencv-python==4.5.1.48 numpy==1.19.2 pafy youtube-dl jupyter
python -m ipykernel install --user --name yolo_tutorial --display-name "yolo_tutorial"

Installing using pip

pip install opencv-python==4.5.1.48 numpy==1.19.2 jupyter pafy youtube-dl

Links to weights

In order to run detection you must download weights you want to use for neural network(click on the name of the model below) and place them in folder 'net' in the repository. IMPORTANT, make sure the names are exactly the same as in the images below(eg. yolov4.weights, not yolov4(1).weights) image image

How to run

Make sure you are the in yolo_tutorial repository (and your venv yolo_tutorial is activated for anaconda installation). Type 'jupyter notebook' in cmd and notebook will open in your browser. You can run cells using Shift+Enter. If you want to use camera detection make sure you have it plugged in.

yolo_tutorial's People

Contributors

aniketgurav avatar maxmlgh 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.