Ali
Ali

Reputation: 55

How to increase the speed of object detection using YOLO in C#.net

I want to detect License Plate region by YOLO V3. I've used darknet to create Weights for this purpose. After training a weight file was created. The size of this file was 234 MB and I used darknet53.conv.74 file and 650 images for train.

The Config file (yolov3.cfg) is

# Testing
# batch=64
# subdivisions=8
# Training
batch=64
subdivisions=64
width=608
height=608
channels=3
momentum=0.9
decay=0.0005
angle=0
saturation = 1.5
exposure = 1.5
hue=.1

learning_rate=0.001
burn_in=1000
max_batches = 4000
policy=steps
steps=3200,3600
scales=.1,.1
....

After that I used Alturos.Yolo 2.6.2 NuGet in C#.NET

YoloWrapper yoloWrapper;
private void Form_Load(object sender, EventArgs e)
{
   yoloWrapper = new YoloWrapper("yolov3.cfg", "yolov3.weights", "voc.names");
}

private void btnDetect_Click(object sender, EventArgs e)
{
   var items = yoloWrapper.Detect(path);
   ...
}

The problem is speed. it takes about 3 seconds to detect License Plate region.

Do you have any solution for increasing the detection speed?

CPU Usage Image

Upvotes: 2

Views: 7594

Answers (2)

nxexo007
nxexo007

Reputation: 37

we used also a tiny version of yolo to detecting pallets: https://www.sydesoft.de/kuenstliche-intelligenz.html

this works on cpu in one second.

Upvotes: 0

Steve Zaretti
Steve Zaretti

Reputation: 198

As you have trained by yourself, I guess you already know neural network need GPU to run faster. Anyway, for faster detection you should either reduce resolution of network or use a tiny variant of YOLO. Today, the strongest and fastest variant is presented here: yolo_v3_tiny_pan3.cfg. Others most recent darknet models are available here. Some other network, like mobilenet, are more optimized to works faster on CPU.

Anyway, these alternative networks requires AlexeyAB darknet implementation to works, so you will need to recompiler darknet of your c# wrapper.

Upvotes: 2

Related Questions