Git Product home page Git Product logo

self-driving-with-yolo's Introduction

Self-driving training with YOLO

Demo

YOLOv4 YOLOv3
1627216237257 1627544679170

Dataset

截圖 2021-08-03 21 18 55

AP

截圖 2021-08-03 03 45 54

class AP in YOLOv4 AP in YOLOv3 TP&FP in YOLOv4 TP&FP in YOLOv3
car ap = 73.09% ap = 69.30% TP = 15977, FP = 5767 TP = 15037, FP = 6829
truck ap = 61.61% ap = 51.89% TP = 573, FP = 232 TP = 469, FP = 244
pedestrian ap = 42.53% ap = 24.20% TP = 2192, FP = 1392 TP = 1213, FP = 1242
bicyclist ap = 41.32% ap = 15.66% TP = 93, FP = 63 TP = 51, FP = 94
light ap = 51.58% ap = 42.93% TP = 2298, FP = 739 TP = 1793, FP = 706

Conclusion: More significant improvement in low AP classes.

mAP

截圖 2021-08-03 03 42 48

for 10,000 iterations

YOLOv4 YOLOv3
mean average precision ([email protected]) = 54.02 % mean average precision ([email protected]) = 40.80 %

Classes

截圖 2021-08-03 21 15 21

  1. car: with 101314 labels
  2. truck: with 6313 labels
  3. pedestrian: with 10637 labels
  4. bicyclist: with 1442 labels
  5. light: with 12700 labels

Training Log

YOLOv4 YOLOv3
chart 2 chart

Conclusion: The speed of convergence in YOLOv4 is much faster than that in YOLOv3

Weights

YOLOv4 YOLOv3
yolov4-obj_10000.weights yolov3-obj_10000.weights

How To Use

Environment

  • VM: Google Colaboratory
  • GPU: NVIDIA T4 Tensor GPU
  • NVIDIA-SMI 470.42.01 Driver Version: 460.32.03 CUDA Version: 11.2
  • nvcc: NVIDIA (R) Cuda compiler driver
  • Cuda compilation tools, release 11.0, V11.0.221
  • Build cuda_11.0_bu.TC445_37.28845127_0

Speed

截圖 2021-08-03 03 37 19

YOLOv4 YOLOv3
Quality: 1080p AVG FPS = 14.6 AVG FPS = 16.1
Quality: 720p AVG FPS = 33.1 AVG FPS = 33.0
Quality: 360p AVG FPS = 45.2 AVG FPS = 43.4
mAP 54.02 % 40.80 %
YOLOv4 YOLOv3
Quality: 1080p Click Me Click Me
Quality: 720p Click Me Click Me
Quality: 360p Click Me Click Me
mAP 54.02 % 40.80 %

Video of comparison between YOLOv4 & YOLOv3

Google Colab

Link

Tutorial

檢查環境用指令

  1. verify CUDA version: /usr/local/cuda/bin/nvcc --version
  2. check GPU info: nvidia-smi

配置Darknet環境

clone AlexeyAB/darknet repo

git clone https://github.com/AlexeyAB/darknet

change makefile to have GPU and OPENCV enabled

sed -i 's/GPU=0/GPU=1/' Makefile
sed -i 's/CUDNN=0/CUDNN=1/' Makefile
sed -i 's/OPENCV=0/OPENCV=1/' Makefile

Build darknet environment

make

配置config檔

  • change line batch to batch=64
  • change line subdivisions to subdivisions=16
  • change line max_batches to (classes*2000, but not less than number of training images and not less than 6000), f.e. max_batches=6000 if you train for 3 classes
  • change line steps to 80% and 90% of max_batches, f.e. steps=4800,5400
  • set network size width=416 height=416 or any value multiple of 32:
  • change line classes=80 to your number of objects in each of 3 [yolo]-layers
  • change [filters=255] to filters=(classes + 5)x3 in the 3 [convolutional] before each [yolo] layer, keep in mind that it only has to be the last [convolutional] before each of the [yolo] layers

準備好以下檔案

  1. train.txt
  2. test.txt
  3. obj.data
  4. obj.names
  5. pre-trained.weights

Start training

./darknet detector train <your_path_of_obj.data> <your_path_of_cfg> <your_path_of_weights> -chart chart.png

  • -chart chart.png: 可保存訓練過程

Run your custom object detection

修改cfg

sed -i 's/batch=64/batch=1/' <your_path_of_cfg>
sed -i 's/subdivisions=16/subdivisions=1/' <your_path_of_cfg>

Detect

./darknet detector test <your_path_of_obj.data> <your_path_of_cfg> <your_path_of_weights> <your_path_of_input_picture>

計算mAP

./darknet detector map <your_path_of_obj.data> <your_path_of_cfg> <your_path_of_weights>

Citation

@misc{bochkovskiy2020yolov4,
      title={YOLOv4: Optimal Speed and Accuracy of Object Detection}, 
      author={Alexey Bochkovskiy and Chien-Yao Wang and Hong-Yuan Mark Liao},
      year={2020},
      eprint={2004.10934},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}
@InProceedings{Wang_2021_CVPR,
    author    = {Wang, Chien-Yao and Bochkovskiy, Alexey and Liao, Hong-Yuan Mark},
    title     = {{Scaled-YOLOv4}: Scaling Cross Stage Partial Network},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2021},
    pages     = {13029-13038}
}

References

self-driving-with-yolo's People

Contributors

dec880126 avatar

Stargazers

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