2

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

Ali
  • 55
  • 2
  • 10
  • 2
    did you try tiny versions of yolov3? they're good enough for detecting LP. Besides you can work with smaller images like 416*416 (LPs are still obvious in this size). – MeiH Jan 07 '20 at 10:13
  • @MH304 I don't know. How can I use tiny version of yolo3? do I have to use another pre-trained weight? or change the config file for training? – Ali Jan 07 '20 at 10:58
  • 1
    Just use another *.cfg file (tiny_3Layers is good). No need to change the configuration (although if your classes number is different, you must change the number of filters in the layer before the yolo layer in the cfg file). All of them work with the same weight file. – MeiH Jan 07 '20 at 11:44

2 Answers2

2

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.

  • Yes, but I have to increase the speed with CPU too. What is a proper network resolution? and how can I use tiny version of yolo3? Do I have to use another pre-trained weight? or change the config file for training? and can I increase the speed by using 1 channel (grayscale image)? – Ali Jan 07 '20 at 11:09
  • 1
    You any resolution as long as it still detect the plate. From my experience, YOLO works well until object is around 30 pixels. Tiny requires indeed another training file. You can find many info about it here: https://github.com/AlexeyAB/darknet#how-to-train-tiny-yolo-to-detect-your-custom-objects . 1 channel image won't help speed. – Steve Zaretti Jan 07 '20 at 11:29
0

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.

nxexo007
  • 37
  • 2