Use of the YOLO algorithm framework One (beginner)

Source: Internet
Author: User

YOLO official framework using C write, performance, YOLO algorithm, I do not introduce too much. Let me briefly explain how this framework is used. The default here is that YOLO2,YOLO1 is nearly obsolete.
Environment recommended for Ubuntu or CentOS

Yolo is a near-real-time framework, in the 1-core CPU, the recognition of a picture in the 6s-12s, in fact, or in the absence of a cache environment, if it is in the camera real-time acquisition of recognition estimates can reach about 10s processing speed. If you use the GPU for processing, of course, the time is much shorter. In the crossing network information, some nouns do not understand, but called on the Titanx processing speed is 40-60 pictures per second, the recognition accuracy of 78.6%; on the Coco Dev test set, the identification accuracy is 48.1% on the VOC 2007. So it seems that the speed is really fast.

https://www.youtube.com/on the YOLO camera real-time recognition of the video, you can go up to search, for the domestic wall, token helpless.

1,yolo principle
The YOLO papers are relatively complex and have to be patient enough to see. Here the address is posted first:
https://arxiv.org/abs/1612.08242

2,yolo Installation
1, install the Reserve library
1) Install the Git tool
Yum Install git
2) Install BUNZIP2
Yum Install-y bzip2
3) Installing GCC
Yum Install "gcc-c++.x86_64"

2. Download the installation package

1) Download and compile the installation package

git clone https://github.com/pjreddie/darknetcd darknet make

2) Download pre-trained hyper-parameters, also weights

wget https://pjreddie.com/media/files/yolo.weights

Next, let's look at the table of contents:

3) Perform forecasts

./darknet Detect Cfg/yolo.cfg yolo.weights data/dog.jpg

The data directory is a picture, the output of the result:

The picture is a bit repetitive and we see the result:

The probability of a dog being detected is 82%.

The probability of detecting a car is 28*, but there is no car

The probability of detecting a kache is 64%.

The probability of detecting a bicycle is 85%

Of course the probability is high is correct, the probability is low indeed no

In fact, he will generate a picture and identify the object

predictions.png is to generate a forecast diagram

Let's look at the picture:

This proves that we have installed YOLO successfully!

3, image detection

1) Single Image detection

Single image detection, we have already demonstrated:

./darknet Detect Cfg/yolo.cfg yolo.weights data/dog.jpg

General Service operation is slow 6s-12s, the GPU will be turned on much faster, will generate Predictions.png, the figure will identify the object identified.

Dog.jpg is the image to be tested, can be replaced by the rest of the test.

2) Multi-image detection

./darknet Detect cfg/yolo.cfg yolo.weightslayer Filters size Input Output0Conv +  3X3/1   416X416X3-416X416X +    1Max2X2/2   416X416X +-208X208X +    .......    inConv425  1X1/1     -X -x1024 -X -X425    -detectionloading weights from yolo.weights ... Done!Enter Image Path:

Multi-image detection and single-image detection is similar, but will continue to prompt you to enter the image path for detection

You can data/hourses.jpg,

After detection, he continues to prompt you to continue to enter the picture path:

Stop input:CTRL + C to exit

3) Set the threshold for the detected window

This is generally not necessary to set, the default threshold is at. 25 or above, when you can pass

-thresh <val> to set, if set to 0, then:

0

The result is:

This is not necessary at all.

4,tiny YOLO

Tiny Yolo is a faster YOLO model, but the accuracy is very low, can be considered carefully, the reference link is:

https://pjreddie.com/darknet/imagenet/#reference

You can try to test it with tiny's weight VOC set:

wget https://pjreddie.com/media/files/tiny-yolo-voc.weights./darknet Detector Test cfg/ Voc.data cfg/tiny-yolo-voc.cfg tiny-yolo-voc.weights data/dog.jpg

Although the accuracy is poor, but the processing speed of 200 sheets per second

5, real-time monitoring via camera

Real-time monitoring and recognition through the camera, so that you can see the results of the test in real time, but need the appropriate equipment to support the hardware must have a camera, but also to compile cuda and OpenCV, you can execute the following commands:

./darknet Detector Demo Cfg/coco.data cfg/yolo.cfg yolo.weights

This will identify the identified object on each frame of the display.

Need to use OPENV to connect to your computer's camera, whether the camera can be used is not a big problem, if you have multiple cameras, you must specify a camera:-C <num> default to 0 first camera.

If you have a video file, OpenCV can read video, then you can:

file>

can be dynamically monitored, it is recommended to go over the wall, on YouTube to see Yolo Video.

Reference Address: https://pjreddie.com/darknet/yolo/

Paper Address: https://arxiv.org/abs/1612.08242

Use of the YOLO algorithm framework One (beginner)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.