Git Product home page Git Product logo

realtimeconedetection's Introduction

Real-time Traffic Cones Detection For Automatic Racing

1.Dataset Preparation

First I refered datasets from Apollo, BDD100K, SUN, but they failed to meet the demands in quantity for YOLO training.

Finally I downloaded this dataset, with about 260 photos of traffic cones, combined with photos taken by Xiaomi. Since annotation in this dataset is incomplete, I labeled them manually using the tool provided in labelImg.

Dataset now available at my jbox, in PASCAL VOC format, and YOLOv3 format.

example of label

2.Training YOLOv3

At first I want to detect cones in simple graphic method, that is, using Hough Transform to find convex cones in the image, and then identifying them based on color, shape or so.

simple graphic method

However, considering the complex background on lane while real-time driving, this method appears to be inaccurate. Then I took SVM+HOG into account, which is also frequently-used in feature detection.

But SVM failed in speed. YOLO(You Only Look Once) network performs well both in spped and accuracy(reaching 70 fps), so finally I choose YOLOv3. (Before this choice I considered YOLOv2, but failed in compiling CUDA env.)

After 500 epochs of training, total loss has been reduced to a fairly low level (min=0.011), with precision up to 0.887. However in the detection valid task, nothing can be detected. I've opened an issue.

What's more, exploding gradient problem happened, as shown below:

text text

After fixing 2 bugs mentioned in issue127, now pretty good results.

3.Performance

text As is shown above, after transforming to another impletation and modifying parameters, the exploding gradient problem has been solved. In this single-class network, total loss can be as low as 0.03, with mAP reaching 98%, recall 98%, precision 99%.

As for speed, testing single images(not video stream) on 1080Ti is about 60 fps. Haven't tested on tx2 yet. To accelerate, consider tiny-yolov3 or turn down the input size.

texttexttext

In addition, the model just detects traffic cone, regardless of its color. So for each cone detected, we extract the half bottom of the bounding box's perpendicular and calculate its average RGB value, and decide which color the cone is(red, green, blue, yellow, dontknow). It only works well for standing cones, inclination or white reflective tape may affect accuracy. And mapping from sampling RGB to color name also depends on color and shape of cones in actual games. Counter-example like: text

4.Have a Try!

  • Test:

    • Download weights file best.pt and put it in weights/.
    • Put the images you want to detect in data/samples/.
    • Run detect.py.
  • Train:

    • Edit your own dirs in convert_yolov3.py and run it.
    • Run train.py.
  • Improve color decision:

    • edit utils/utils.py/plot_one_box().

realtimeconedetection's People

Contributors

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