Code Monkey home page Code Monkey logo

alpr-unconstrained's People

Contributors

sergiomsilva avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alpr-unconstrained's Issues

How can I train my own model?

Hi~
Thanks for providing this project, and the effect of recognizing plate license is so good.
Now, I want to train my own weights to detect chinese character, how can I train my own arguments ?
Thanks a lot !

Error while training the detector

Hello, I have this error when I am training the detector. What is this?
File "alpr-unconstrained/train-detector.py", line 78, in
YY = labels2output_map(llp,pts,dim,model_stride)

File "alpr-unconstrained/src/sampler.py", line 27, in labels2output_map
iou = IOU_centre_and_dims(mn/MN,label.wh(),label.cc(),label.wh())

File "alpr-unconstrained/src/utils.py", line 112, in IOU_centre_and_dims
return IOU(cc1-wh1/2.,cc1+wh1/2.,cc2-wh2/2.,cc2+wh2/2.)

File "alpr-unconstrained/src/utils.py", line 103, in IOU
assert((wh1>=.0).all() and (wh2>=.0).all())
AssertionError

I do not understand

problems about ocr dataset

Hello, I'm now trying to train the ocr model using my dataset, but the trained model just doesn't work. I want to know if my annotations are right. Every LP image has several bounding boxes. There's an example:

  • class_id x y w h
    33 0.0970149253731 0.443069306931 0.0985074626866 0.509900990099
    16 0.222388059701 0.457920792079 0.10447761194 0.490099009901
    9 0.361194029851 0.457920792079 0.113432835821 0.490099009901
    32 0.597014925373 0.487623762376 0.107462686567 0.519801980198
    2 0.741791044776 0.502475247525 0.110447761194 0.509900990099
    16 0.877611940299 0.512376237624 0.101492537313 0.509900990099
    I just use darknet to train your ocr network, so could you give me some hints? Plus, can you tell me how many training LP images you used for ocr network?

test error

run.sh: line 74: 26548 Aborted (core dumped) python license-plate-detection.py $2 data/lp-detector/wpod-net.h5
layer filters size input output
0 conv 32 3 x 3 / 1 240 x 80 x 3 -> 240 x 80 x 32 0.033 BFLOPs
1 max 2 x 2 / 2 240 x 80 x 32 -> 120 x 40 x 32
2 conv 64 3 x 3 / 1 120 x 40 x 32 -> 120 x 40 x 64 0.177 BFLOPs
3 max 2 x 2 / 2 120 x 40 x 64 -> 60 x 20 x 64
4 conv 128 3 x 3 / 1 60 x 20 x 64 -> 60 x 20 x 128 0.177 BFLOPs
5 conv 64 1 x 1 / 1 60 x 20 x 128 -> 60 x 20 x 64 0.020 BFLOPs
6 conv 128 3 x 3 / 1 60 x 20 x 64 -> 60 x 20 x 128 0.177 BFLOPs
7 max 2 x 2 / 2 60 x 20 x 128 -> 30 x 10 x 128
8 conv 256 3 x 3 / 1 30 x 10 x 128 -> 30 x 10 x 256 0.177 BFLOPs
9 conv 128 1 x 1 / 1 30 x 10 x 256 -> 30 x 10 x 128 0.020 BFLOPs
10 conv 256 3 x 3 / 1 30 x 10 x 128 -> 30 x 10 x 256 0.177 BFLOPs
11 conv 512 3 x 3 / 1 30 x 10 x 256 -> 30 x 10 x 512 0.708 BFLOPs
12 conv 256 3 x 3 / 1 30 x 10 x 512 -> 30 x 10 x 256 0.708 BFLOPs
13 conv 512 3 x 3 / 1 30 x 10 x 256 -> 30 x 10 x 512 0.708 BFLOPs
14 conv 80 1 x 1 / 1 30 x 10 x 512 -> 30 x 10 x 80 0.025 BFLOPs
15 detection
mask_scale: Using default '1.000000'
Loading weights from data/ocr/ocr-net.weights...Done!
Performing OCR...
rm: cannot remove '/tmp/output/_lp.png': No such file or directory
rm: cannot remove '/tmp/output/
_lp.txt': No such file or directory
rm: cannot remove '/tmp/output/*_str.txt': No such file or directory

run.sh: line 74: 26548 Aborted (core dumped) python license-plate-detection.py $2 data/lp-detector/wpod-net.h5
layer filters size input output
0 conv 32 3 x 3 / 1 240 x 80 x 3 -> 240 x 80 x 32 0.033 BFLOPs
1 max 2 x 2 / 2 240 x 80 x 32 -> 120 x 40 x 32
2 conv 64 3 x 3 / 1 120 x 40 x 32 -> 120 x 40 x 64 0.177 BFLOPs
3 max 2 x 2 / 2 120 x 40 x 64 -> 60 x 20 x 64
4 conv 128 3 x 3 / 1 60 x 20 x 64 -> 60 x 20 x 128 0.177 BFLOPs
5 conv 64 1 x 1 / 1 60 x 20 x 128 -> 60 x 20 x 64 0.020 BFLOPs
6 conv 128 3 x 3 / 1 60 x 20 x 64 -> 60 x 20 x 128 0.177 BFLOPs
7 max 2 x 2 / 2 60 x 20 x 128 -> 30 x 10 x 128
8 conv 256 3 x 3 / 1 30 x 10 x 128 -> 30 x 10 x 256 0.177 BFLOPs
9 conv 128 1 x 1 / 1 30 x 10 x 256 -> 30 x 10 x 128 0.020 BFLOPs
10 conv 256 3 x 3 / 1 30 x 10 x 128 -> 30 x 10 x 256 0.177 BFLOPs
11 conv 512 3 x 3 / 1 30 x 10 x 256 -> 30 x 10 x 512 0.708 BFLOPs
12 conv 256 3 x 3 / 1 30 x 10 x 512 -> 30 x 10 x 256 0.708 BFLOPs
13 conv 512 3 x 3 / 1 30 x 10 x 256 -> 30 x 10 x 512 0.708 BFLOPs
14 conv 80 1 x 1 / 1 30 x 10 x 512 -> 30 x 10 x 80 0.025 BFLOPs
15 detection
mask_scale: Using default '1.000000'
Loading weights from data/ocr/ocr-net.weights...Done!
Performing OCR...
rm: cannot remove '/tmp/output/_lp.png': No such file or directory
rm: cannot remove '/tmp/output/
_lp.txt': No such file or directory
rm: cannot remove '/tmp/output/*_str.txt': No such file or directory

I have tried #4 this method but still reported this error

label tool

Hi ,do you use label tool to perform the labeling on the vehicle number plate on the image before perform the training ? Because I am doing detection on Car sticker 's license car number.

Description of data inside "*_lp.txt"

licence-plate-detection.py returns *_lp.png & *_lp.txt,
can you describe data inside *_lp.txt.

sample data:
4,0.864626,0.946707,0.937679,0.855598,0.571571,0.515678,0.573691,0.629584,,

cannot test

when I run the run.sh and print 3 paraments, the result is bash: samples/03009.jpg: cannot execute binary file: Exec format error,how could I do? help

No 'O' character

Hello! I'm trying to understand why there is no 'O' letter in names? Is it because of no so big difference between 'O' and 'Q'?

The license-plate-ocr.py don't work

when i am running the test, vehicle-detection.py and licendr-plate-detection.py is ok but license-plate-ocr.py can't recognize character (python3 and opencv3.4)
I got this:
mask_scale: Using default '1.000000'
Loading weights from data/ocr/ocr-net.weights...Done!
Performing OCR...
Scanning ./tmp/output/03058_1car_lp.png
No characters found
Scanning ./tmp/output/03071_0car_lp.png
No characters found
Scanning ./tmp/output/03057_0car_lp.png
No characters found
Scanning ./tmp/output/03009_0car_lp.png
No characters found
Scanning ./tmp/output/03016_0car_lp.png
No characters found
Scanning ./tmp/output/03066_1car_lp.png
No characters found
Scanning ./tmp/output/03033_0car_lp.png
No characters found
Scanning ./tmp/output/03025_0car_lp.png
No characters found

Alpr on video

I want to run this code on video please guide me on how to implement it...
Thanks.

Bounding box on license plates

Hi! I was trying to get a bounding box surrounding the license plates that were found on the image. Could you please explain the output of the model that detects license plates? I also do not understand the reconstruct function too well, if you could give some input on this as well it would be really helpful.

Thanks a lot in advance!

Can i use it on video too?

Can i use it on video too?
I think it would be possible if vehicle -detection.py, license-plate-detection.py, and license-plate-ocr.py were combined and the image input change like video demo.py from oiginal yolo.

Is there anything that can help?

have some problems after running

hello,I have some problems after running, can you help me answer it?
Traceback (most recent call last):
File "vehicle-detection.py", line 7, in
import darknet.python.darknet as dn
ImportError: No module named darknet.python.darknet
Using TensorFlow backend.
Searching for license plates using WPOD-NET
Traceback (most recent call last):
File "license-plate-ocr.py", line 7, in
import darknet.python.darknet as dn
ImportError: No module named darknet.python.darknet
Traceback (most recent call last):
File "gen-outputs.py", line 30, in
Lcar = lread(detected_cars_labels)
File "/home/toor/alpr-unconstrained-master/alpr-unconstrained-master/src/label.py", line 54, in lread
with open(file_path,'r') as fd:
IOError: [Errno 2] No such file or directory: '/tmp/output/03009_cars.txt'

how to train?

hello,Thank you very much for sharing the training code, but the training data has a TXT file. What does the number in the file mean? and how do you label it?

1
2

OCR network seems not working

hi,
Thanks for sharing your work! I tried to test the project using run.sh, everything was OK except that the OCR network output "No characters found" for each plate image; I tried to adjust the detection threshold but it didn't work. So what seems the problem and how should I solve it?

Following is the output of run.sh. Plate images have been extracted successfully, but characters are not detected. So is there any thing (like image pre-processing) missing before I input images into the OCR net?

Press any key to continue...
layer filters size input output
0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32 0.299 BFLOPs
1 max 2 x 2 / 2 416 x 416 x 32 -> 208 x 208 x 32
2 conv 64 3 x 3 / 1 208 x 208 x 32 -> 208 x 208 x 64 1.595 BFLOPs
3 max 2 x 2 / 2 208 x 208 x 64 -> 104 x 104 x 64
4 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BFLOPs
5 conv 64 1 x 1 / 1 104 x 104 x 128 -> 104 x 104 x 64 0.177 BFLOPs
6 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BFLOPs
7 max 2 x 2 / 2 104 x 104 x 128 -> 52 x 52 x 128
8 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BFLOPs
9 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BFLOPs
10 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BFLOPs
11 max 2 x 2 / 2 52 x 52 x 256 -> 26 x 26 x 256
12 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BFLOPs
13 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BFLOPs
14 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BFLOPs
15 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BFLOPs
16 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BFLOPs
17 max 2 x 2 / 2 26 x 26 x 512 -> 13 x 13 x 512
18 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BFLOPs
19 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BFLOPs
20 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BFLOPs
21 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BFLOPs
22 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BFLOPs
23 conv 1024 3 x 3 / 1 13 x 13 x1024 -> 13 x 13 x1024 3.190 BFLOPs
24 conv 1024 3 x 3 / 1 13 x 13 x1024 -> 13 x 13 x1024 3.190 BFLOPs
25 route 16
26 conv 64 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 64 0.044 BFLOPs
27 reorg / 2 26 x 26 x 64 -> 13 x 13 x 256
28 route 27 24
29 conv 1024 3 x 3 / 1 13 x 13 x1280 -> 13 x 13 x1024 3.987 BFLOPs
30 conv 125 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 125 0.043 BFLOPs
31 detection
mask_scale: Using default '1.000000'
Loading weights from data/vehicle-detector/yolo-voc.weights...Done!
Searching for vehicles using YOLO...
Scanning samples/03009.jpg
2 cars found
Scanning samples/03016.jpg
1 cars found
Scanning samples/03025.jpg
1 cars found
Scanning samples/03033.jpg
1 cars found
Scanning samples/03057.jpg
1 cars found
Scanning samples/03058.jpg
2 cars found
Scanning samples/03066.jpg
3 cars found
Scanning samples/03071.jpg
1 cars found
Using TensorFlow backend.
2018-09-12 01:32:41.038583: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-09-12 01:32:41.175064: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1356] Found device 0 with properties:
name: TITAN X (Pascal) major: 6 minor: 1 memoryClockRate(GHz): 1.607
pciBusID: 0000:06:00.0
totalMemory: 11.90GiB freeMemory: 11.57GiB
2018-09-12 01:32:41.309589: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1356] Found device 1 with properties:
name: TITAN X (Pascal) major: 6 minor: 1 memoryClockRate(GHz): 1.531
pciBusID: 0000:0b:00.0
totalMemory: 11.90GiB freeMemory: 11.22GiB
2018-09-12 01:32:41.310954: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1435] Adding visible gpu devices: 0, 1
2018-09-12 01:32:41.831018: I tensorflow/core/common_runtime/gpu/gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-09-12 01:32:41.831073: I tensorflow/core/common_runtime/gpu/gpu_device.cc:929] 0 1
2018-09-12 01:32:41.831092: I tensorflow/core/common_runtime/gpu/gpu_device.cc:942] 0: N Y
2018-09-12 01:32:41.831108: I tensorflow/core/common_runtime/gpu/gpu_device.cc:942] 1: Y N
2018-09-12 01:32:41.831697: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 11199 MB memory) -> physical GPU (device: 0, name: TITAN X (Pascal), pci bus id: 0000:06:00.0, compute capability: 6.1)
2018-09-12 01:32:41.984898: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:1 with 10866 MB memory) -> physical GPU (device: 1, name: TITAN X (Pascal), pci bus id: 0000:0b:00.0, compute capability: 6.1)
Searching for license plates using WPOD-NET
Processing output/03033_0car.png
Bound dim: 476, ratio: 1.606780
Processing output/03058_1car.png
Bound dim: 372, ratio: 1.288136
Processing output/03009_1car.png
Bound dim: 608, ratio: 3.037433
Processing output/03066_1car.png
Bound dim: 490, ratio: 1.685950
Processing output/03025_0car.png
Bound dim: 568, ratio: 1.958333
Processing output/03066_2car.png
Bound dim: 608, ratio: 2.135135
Processing output/03071_0car.png
Bound dim: 608, ratio: 2.156250
Processing output/03016_0car.png
Bound dim: 606, ratio: 2.052117
Processing output/03009_0car.png
Bound dim: 524, ratio: 1.798773
Processing output/03066_0car.png
Bound dim: 544, ratio: 1.889503
Processing output/03057_0car.png
Bound dim: 526, ratio: 1.804819
Processing output/03058_0car.png
Bound dim: 346, ratio: 1.159664
layer filters size input output
0 conv 32 3 x 3 / 1 240 x 80 x 3 -> 240 x 80 x 32 0.033 BFLOPs
1 max 2 x 2 / 2 240 x 80 x 32 -> 120 x 40 x 32
2 conv 64 3 x 3 / 1 120 x 40 x 32 -> 120 x 40 x 64 0.177 BFLOPs
3 max 2 x 2 / 2 120 x 40 x 64 -> 60 x 20 x 64
4 conv 128 3 x 3 / 1 60 x 20 x 64 -> 60 x 20 x 128 0.177 BFLOPs
5 conv 64 1 x 1 / 1 60 x 20 x 128 -> 60 x 20 x 64 0.020 BFLOPs
6 conv 128 3 x 3 / 1 60 x 20 x 64 -> 60 x 20 x 128 0.177 BFLOPs
7 max 2 x 2 / 2 60 x 20 x 128 -> 30 x 10 x 128
8 conv 256 3 x 3 / 1 30 x 10 x 128 -> 30 x 10 x 256 0.177 BFLOPs
9 conv 128 1 x 1 / 1 30 x 10 x 256 -> 30 x 10 x 128 0.020 BFLOPs
10 conv 256 3 x 3 / 1 30 x 10 x 128 -> 30 x 10 x 256 0.177 BFLOPs
11 conv 512 3 x 3 / 1 30 x 10 x 256 -> 30 x 10 x 512 0.708 BFLOPs
12 conv 256 3 x 3 / 1 30 x 10 x 512 -> 30 x 10 x 256 0.708 BFLOPs
13 conv 512 3 x 3 / 1 30 x 10 x 256 -> 30 x 10 x 512 0.708 BFLOPs
14 conv 80 1 x 1 / 1 30 x 10 x 512 -> 30 x 10 x 80 0.025 BFLOPs
15 detection
mask_scale: Using default '1.000000'
Loading weights from data/ocr/ocr-net.weights...Done!
Performing OCR...
Scanning output/03066_2car_lp.png
No characters found
Scanning output/03009_0car_lp.png
No characters found
Scanning output/03016_0car_lp.png
No characters found
Scanning output/03057_0car_lp.png
No characters found
Scanning output/03025_0car_lp.png
No characters found
Scanning output/03058_1car_lp.png
No characters found
Scanning output/03033_0car_lp.png
No characters found
Scanning output/03071_0car_lp.png
No characters found

Some information about ocr-net

Hi,

I Couldn't find in your paper any reference about the OCR-NET, which I would like to train to recognize only numbers (Thought about using transfer learning for the last softmax layer).

I read #11 and I know you don't have time to publish the code for training but I would like to see some paper/documentation about the OCR-NET if there are any.

Thanks!

Error in predict

ocr_net = dn.load_net(ocr_netcfg, ocr_weights, 0)
ArgumentError: argument 1: <class 'TypeError'>: wrong type

What is the reason?

0 cars found

HIi, I meet a problem, someone can help ?

mask_scale: Using default '1.000000'
Loading weights from data/vehicle-detector/yolo-voc.weights...Done!
Searching for vehicles using YOLO...
Scanning samples/test/03009.jpg
0 cars found
Scanning samples/test/03016.jpg
0 cars found
Scanning samples/test/03025.jpg
0 cars found
Scanning samples/test/03033.jpg
0 cars found
Scanning samples/test/03057.jpg
0 cars found
Scanning samples/test/03058.jpg
0 cars found
Scanning samples/test/03066.jpg
0 cars found
Scanning samples/test/03071.jpg
0 cars found
Using TensorFlow backend.

windows version?

Hello, sorry to bother you, does this project have a windows version?

About annotations

Hello, in your file README.txt, which is available at http://www.inf.ufrgs.br/~crjung/alpr-datasets/labels/training-dataset-annotations.zip, the following annotation format

N, tlx, tly, trx, try, brx, bry, blx, bly, LABEL,

where:
N = number or corners (fixed in 4)
tl [x, y] = top left corner
tr [x, y] = top right corner
br [x, y] = bottom right corner
bl [x, y] = bottom left corner

Values from a text file, for example Track43(24)

4,0.881302,0.959447,0.962407,0.881894,0.729750,0.732384,0.781904,0.776635, LP

when multiplied by the corresponding width and height do not give a rectangle.

tlx = 0.881302 * ImageWidth = 1692
tly = 0.959447 * ImageHeight = 1036
trx = 0.962407 * ImageWidth = 1848
try = 0.881894 * ImageHeight = 952
brx = 0.729750 * ImageWidth = 1401
bry = 0.732384 * ImageHeight = 791
blx = 0.781904 * ImageWidth = 1501
bly = 0.776635 * ImageHeight = 839

What's my mistake?

Numeric License plates only

Hey,

Im trying to use the code in order to detect number only license plate (No letters),
Is there a way to specify it, so the algorithm know to look only for numbers?
(Should be just an easier problem)

Can not detect vehicle

Hello Serguimsilva.
first, I downloaded your pretrainmode using command "bash get-networks.sh".
Second, But when i run detector on your sample images. it cannot detect cars. My command "python3 vehicle-detection.py /media/tienduchoang/Work/plate_recognition/alpr-unconstrained/samples/test/ /media/tienduchoang/Work/plate_recognition/alpr-unconstrained/result/temp /media/tienduchoang/Work/plate_recognition/alpr-unconstrained/result/txt/"

It return like this:

layer filters size input output
0 conv 32 3 x 3 / 1 416 x 416 x 3 -> 416 x 416 x 32 0.299 BFLOPs
1 max 2 x 2 / 2 416 x 416 x 32 -> 208 x 208 x 32
2 conv 64 3 x 3 / 1 208 x 208 x 32 -> 208 x 208 x 64 1.595 BFLOPs
3 max 2 x 2 / 2 208 x 208 x 64 -> 104 x 104 x 64
4 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BFLOPs
5 conv 64 1 x 1 / 1 104 x 104 x 128 -> 104 x 104 x 64 0.177 BFLOPs
6 conv 128 3 x 3 / 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BFLOPs
7 max 2 x 2 / 2 104 x 104 x 128 -> 52 x 52 x 128
8 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BFLOPs
9 conv 128 1 x 1 / 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BFLOPs
10 conv 256 3 x 3 / 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BFLOPs
11 max 2 x 2 / 2 52 x 52 x 256 -> 26 x 26 x 256
12 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BFLOPs
13 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BFLOPs
14 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BFLOPs
15 conv 256 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BFLOPs
16 conv 512 3 x 3 / 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BFLOPs
17 max 2 x 2 / 2 26 x 26 x 512 -> 13 x 13 x 512
18 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BFLOPs
19 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BFLOPs
20 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BFLOPs
21 conv 512 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 512 0.177 BFLOPs
22 conv 1024 3 x 3 / 1 13 x 13 x 512 -> 13 x 13 x1024 1.595 BFLOPs
23 conv 1024 3 x 3 / 1 13 x 13 x1024 -> 13 x 13 x1024 3.190 BFLOPs
24 conv 1024 3 x 3 / 1 13 x 13 x1024 -> 13 x 13 x1024 3.190 BFLOPs
25 route 16
26 conv 64 1 x 1 / 1 26 x 26 x 512 -> 26 x 26 x 64 0.044 BFLOPs
27 reorg / 2 26 x 26 x 64 -> 13 x 13 x 256
28 route 27 24
29 conv 1024 3 x 3 / 1 13 x 13 x1280 -> 13 x 13 x1024 3.987 BFLOPs
30 conv 125 1 x 1 / 1 13 x 13 x1024 -> 13 x 13 x 125 0.043 BFLOPs
31 detection
mask_scale: Using default '1.000000'
Loading weights from data/vehicle-detector/yolo-voc.weights...Done!
Searching for vehicles using YOLO...
Scanning /media/tienduchoang/Work/plate_recognition/alpr-unconstrained/samples/test/03009.jpg
0 cars found
Scanning /media/tienduchoang/Work/plate_recognition/alpr-unconstrained/samples/test/03016.jpg
0 cars found
Scanning /media/tienduchoang/Work/plate_recognition/alpr-unconstrained/samples/test/03025.jpg
0 cars found
Scanning /media/tienduchoang/Work/plate_recognition/alpr-unconstrained/samples/test/03033.jpg
0 cars found
Scanning /media/tienduchoang/Work/plate_recognition/alpr-unconstrained/samples/test/03057.jpg
0 cars found
Scanning /media/tienduchoang/Work/plate_recognition/alpr-unconstrained/samples/test/03058.jpg
0 cars found
Scanning /media/tienduchoang/Work/plate_recognition/alpr-unconstrained/samples/test/03066.jpg
0 cars found
Scanning /media/tienduchoang/Work/plate_recognition/alpr-unconstrained/samples/test/03071.jpg
0 cars found

waiting for you help!

all coordinate is not right in sample/train fold,

the problem is that i can not plot right bounding box accoding to the sample/training
the coordinate is clearly not fit in the image, so i want to know how to plot pernal image if i want to use this project? please help me .thanks.

how to transform the full image to a frontal view?

hi,i train a model and successfully detect a plate in a picture. but i have a task and need to use the plate to transform the full image to a frontal view ,but the code only can transform the license plate , so would you tell me how to transform the full image to a frontal view simultaneously.

train target is not local affine transformation as in paper?

   Thank you for your great job
  I find the model output is 
    `xprobs    = Conv2D(2, 3, activation='softmax', padding='same')(x)
xbbox     = Conv2D(6, 3, activation='linear' , padding='same')(x)`
  which has 2+6 = 8 parameters as in paper.

But  in your augment sampling  code 
 `		for k in range(batch_size):
		data = choice(Data)
		XX,llp,pts = augment_sample(data[0],data[1].pts,dim)
		YY = labels2output_map(llp,pts,dim,model_stride)

		Xtrain[k] = XX
		Ytrain[k] = YY`

The YY label is 1 class label and 8 points ,  so the model output and label mismatch.
  Do I misunderstand something?

what is the class tpye error?

Traceback (most recent call last):
File "vehicle-detection.py", line 25, in
vehicle_net = dn.load_net(vehicle_netcfg, vehicle_weights, 0)
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
Using TensorFlow backend.
2018-12-06 16:27:07.584695: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
Searching for license plates using WPOD-NET
Traceback (most recent call last):
File "license-plate-ocr.py", line 23, in
ocr_net = dn.load_net(ocr_netcfg, ocr_weights, 0)

bout “samples/test ”

Performing OCR...
rm: 无法删除'/tmp/output/_lp.png': 没有那个文件或目录
rm: 无法删除'/tmp/output/car.png': 没有那个文件或目录
rm: 无法删除'/tmp/output/
_cars.txt': 没有那个文件或目录
rm: 无法删除'/tmp/output/
_lp.txt': 没有那个文件或目录
rm: 无法删除'/tmp/output/*_str.txt': 没有那个文件或目录

About wpod-net training

Hello,

  1. Is the trian-detector using for traing WPOD-NET, the second stage in this project?
  2. Wheather the training result generated by train-detector include the trasformation information?
    when we using the training result by run.sh, has the output plate-position rectified by Affine Transformation
    Matrix?
    Thank you all!

About train code

Is there any train code about the WPOD-NET? I'll be very grateful if provided.

Maybe there is a bug in your code?

Hello,sergriomsilva.Thanks to your code,I have read your source code,but i doubt there maybe b bug in license-plate-detection.py, after detect_lp function,when save the detected plate result,the source code is

if len(LlpImgs):
	Ilp = LlpImgs[0]
	Ilp = cv2.cvtColor(Ilp, cv2.COLOR_BGR2GRAY)
	Ilp = cv2.cvtColor(Ilp, cv2.COLOR_GRAY2BGR)

	s = Shape(Llp[0].pts)
	cv2.imwrite('%s/%s_lp.png' % (output_dir,bname),Ilp*255.)
        writeShapes('%s/%s_lp.txt' % (output_dir,bname),[s])`  

In fact,the cvtColor maybe loss color info,maybe should like this:

if len(LlpImgs):
	# 按照自己修改的,不会改变图像的颜色
	Ilp = LlpImgs[0]
	Ilp=(Ilp*255).astype("uint8")

	s = Shape(Llp[0].pts)
	cv2.imwrite('%s/%s_lp.png' % (output_dir, bname), Ilp)
	writeShapes('%s/%s_lp.txt' % (output_dir,bname),[s])

Memory usage of detection model

When I am running your detection model (wpod-net.h5) it's taking 10gbs of GPU memory. And if 10gb is not available it switches back to CPU mode.
Below is the output from tensorflow

Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 9939 MB memory)

The same above output can be seen in issue#4 also, while the model size is only 6.5 mb.

Am I missing to modify batch size or something? If so where can I modify it?
Or is the model that big(10gb)? In such case is there any way to reduce memory it?

Detection dependency on illumination

@sergiomsilva
I have encountered that the detection depends on the brightness, contrast and other factors. In one frame the plate is detected and in another its not.
Do you think doing mean image subtraction will help to eliminate this problem? Or do you have any other suggestion?

The format of the dataset

Hi~
I find the format of ssig, such as Track41[11].txt, as below:

“4,0.173926,0.249481,0.249481,0.173926,0.716426,0.713264,0.761756,0.763864,LP,
4,0.178706,0.187287,0.187287,0.178706,0.729881,0.729557,0.751266,0.751536,P,
……”

Does the first line mean that there are 2 license plates in the image, and "4" represents the class?
But the next line also has a "4", am I understanding correcty?

Morever,I find the training set of VOC ( for yolo ) is that
11 0.344192634561 0.611 0.416430594901 0.262
14 0.509915014164 0.51 0.974504249292 0.972
Now, I want to use the dataset, ssig, to train, should I spilt the data?such as
(x1,y1) = (0.173926, 0.716426)
(x2,y2) = (0.249481, 0.713264)
(x3,y3) = (0.249481, 0.761756)
(x4,y4) = (0.173926, 0.763864)
and convert above coordinates into VOC format?

Much obiligated!

The label.py don't work

Searching for license plates using WPOD-NET
layer filters size input output
0 conv 32 3 x 3 / 1 240 x 80 x 3 -> 240 x 80 x 32 0.033 BFLOPs
1 max 2 x 2 / 2 240 x 80 x 32 -> 120 x 40 x 32
2 conv 64 3 x 3 / 1 120 x 40 x 32 -> 120 x 40 x 64 0.177 BFLOPs
3 max 2 x 2 / 2 120 x 40 x 64 -> 60 x 20 x 64
4 conv 128 3 x 3 / 1 60 x 20 x 64 -> 60 x 20 x 128 0.177 BFLOPs
5 conv 64 1 x 1 / 1 60 x 20 x 128 -> 60 x 20 x 64 0.020 BFLOPs
6 conv 128 3 x 3 / 1 60 x 20 x 64 -> 60 x 20 x 128 0.177 BFLOPs
7 max 2 x 2 / 2 60 x 20 x 128 -> 30 x 10 x 128
8 conv 256 3 x 3 / 1 30 x 10 x 128 -> 30 x 10 x 256 0.177 BFLOPs
9 conv 128 1 x 1 / 1 30 x 10 x 256 -> 30 x 10 x 128 0.020 BFLOPs
10 conv 256 3 x 3 / 1 30 x 10 x 128 -> 30 x 10 x 256 0.177 BFLOPs
11 conv 512 3 x 3 / 1 30 x 10 x 256 -> 30 x 10 x 512 0.708 BFLOPs
12 conv 256 3 x 3 / 1 30 x 10 x 512 -> 30 x 10 x 256 0.708 BFLOPs
13 conv 512 3 x 3 / 1 30 x 10 x 256 -> 30 x 10 x 512 0.708 BFLOPs
14 conv 80 1 x 1 / 1 30 x 10 x 512 -> 30 x 10 x 80 0.025 BFLOPs
15 detection
mask_scale: Using default '1.000000'
Loading weights from data/ocr/ocr-net.weights...Done!
Performing OCR...
Traceback (most recent call last):
File "gen-outputs.py", line 30, in
Lcar = lread(detected_cars_labels)
File "/home/seemmo/Ryan/ALPR/alpr-unconstrained-master/src/label.py", line 57, in lread
with open(file_path,'r') as fd:
IOError: [Errno 2] No such file or directory: '/tmp/output/03009_cars.txt'
rm: cannot remove '/tmp/output/_lp.png': No such file or directory
rm: cannot remove '/tmp/output/car.png': No such file or directory
rm: cannot remove '/tmp/output/
_cars.txt': No such file or directory
rm: cannot remove '/tmp/output/
_lp.txt': No such file or directory
rm: cannot remove '/tmp/output/*_str.txt': No such file or directory

inference time low

hi sergiomsilva, thank for your code. But I do not understand why you using yolo but the inference time is slow. just only 5fps?

can't test

$ bash run.sh samples/ /tmp/output /tmp/output/results.csv
Press any key to continue...
--2018-09-19 23:11:51-- http://www.inf.ufrgs.br/~smsilva/alpr-unconstrained/data/lp-detector/wpod-net.h5
Resolving www.inf.ufrgs.br (www.inf.ufrgs.br)... 143.54.11.16
Connecting to www.inf.ufrgs.br (www.inf.ufrgs.br)|143.54.11.16|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘data/lp-detector/wpod-net.h5’ not modified on server. Omitting download.

--2018-09-19 23:11:53-- http://www.inf.ufrgs.br/~smsilva/alpr-unconstrained/data/lp-detector/wpod-net.json
Resolving www.inf.ufrgs.br (www.inf.ufrgs.br)... 143.54.11.16
Connecting to www.inf.ufrgs.br (www.inf.ufrgs.br)|143.54.11.16|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘data/lp-detector/wpod-net.json’ not modified on server. Omitting download.

--2018-09-19 23:11:54-- http://www.inf.ufrgs.br/~smsilva/alpr-unconstrained/data/ocr/ocr-net.cfg
Resolving www.inf.ufrgs.br (www.inf.ufrgs.br)... 143.54.11.16
Connecting to www.inf.ufrgs.br (www.inf.ufrgs.br)|143.54.11.16|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘data/ocr/ocr-net.cfg’ not modified on server. Omitting download.

--2018-09-19 23:11:55-- http://www.inf.ufrgs.br/~smsilva/alpr-unconstrained/data/ocr/ocr-net.names
Resolving www.inf.ufrgs.br (www.inf.ufrgs.br)... 143.54.11.16
Connecting to www.inf.ufrgs.br (www.inf.ufrgs.br)|143.54.11.16|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘data/ocr/ocr-net.names’ not modified on server. Omitting download.

--2018-09-19 23:11:56-- http://www.inf.ufrgs.br/~smsilva/alpr-unconstrained/data/ocr/ocr-net.weights
Resolving www.inf.ufrgs.br (www.inf.ufrgs.br)... 143.54.11.16
Connecting to www.inf.ufrgs.br (www.inf.ufrgs.br)|143.54.11.16|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘data/ocr/ocr-net.weights’ not modified on server. Omitting download.

--2018-09-19 23:11:58-- http://www.inf.ufrgs.br/~smsilva/alpr-unconstrained/data/ocr/ocr-net.data
Resolving www.inf.ufrgs.br (www.inf.ufrgs.br)... 143.54.11.16
Connecting to www.inf.ufrgs.br (www.inf.ufrgs.br)|143.54.11.16|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘data/ocr/ocr-net.data’ not modified on server. Omitting download.

--2018-09-19 23:11:59-- http://www.inf.ufrgs.br/~smsilva/alpr-unconstrained/data/vehicle-detector/yolo-voc.cfg
Resolving www.inf.ufrgs.br (www.inf.ufrgs.br)... 143.54.11.16
Connecting to www.inf.ufrgs.br (www.inf.ufrgs.br)|143.54.11.16|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘data/vehicle-detector/yolo-voc.cfg’ not modified on server. Omitting download.

--2018-09-19 23:12:03-- http://www.inf.ufrgs.br/~smsilva/alpr-unconstrained/data/vehicle-detector/voc.data
Resolving www.inf.ufrgs.br (www.inf.ufrgs.br)... 143.54.11.16
Connecting to www.inf.ufrgs.br (www.inf.ufrgs.br)|143.54.11.16|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘data/vehicle-detector/voc.data’ not modified on server. Omitting download.

--2018-09-19 23:12:05-- http://www.inf.ufrgs.br/~smsilva/alpr-unconstrained/data/vehicle-detector/yolo-voc.weights
Resolving www.inf.ufrgs.br (www.inf.ufrgs.br)... 143.54.11.16
Connecting to www.inf.ufrgs.br (www.inf.ufrgs.br)|143.54.11.16|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘data/vehicle-detector/yolo-voc.weights’ not modified on server. Omitting download.

--2018-09-19 23:12:08-- http://www.inf.ufrgs.br/~smsilva/alpr-unconstrained/data/vehicle-detector/voc.names
Resolving www.inf.ufrgs.br (www.inf.ufrgs.br)... 143.54.11.16
Connecting to www.inf.ufrgs.br (www.inf.ufrgs.br)|143.54.11.16|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File ‘data/vehicle-detector/voc.names’ not modified on server. Omitting download.

File "vehicle-detection.py", line 34
print 'Searching for vehicles using YOLO...'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Searching for vehicles using YOLO...')?
File "license-plate-detection.py", line 29
print 'Searching for license plates using WPOD-NET'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Searching for license plates using WPOD-NET')?
File "license-plate-ocr.py", line 28
print 'Performing OCR...'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Performing OCR...')?
Traceback (most recent call last):
File "gen-outputs.py", line 2, in
import cv2
ModuleNotFoundError: No module named 'cv2'
rm: cannot remove '/tmp/output/_lp.png': No such file or directory
rm: cannot remove '/tmp/output/car.png': No such file or directory
rm: cannot remove '/tmp/output/
_cars.txt': No such file or directory
rm: cannot remove '/tmp/output/
_lp.txt': No such file or directory
rm: cannot remove '/tmp/output/*_str.txt': No such file or directory

How to solve this problem? thank you

Segmentation fault

$ bash run.sh samples/ /tmp/output /tmp/output/results.csv
Press any key to continue...
run.sh: 行 71: 2956 Segmentation fault python vehicle-detection.py $1 $2
Using TensorFlow backend.
Traceback (most recent call last):
File "license-plate-detection.py", line 5, in
from src.keras_utils import load_model
File "D:\cywin\home\Administrator\alpr\src\keras_utils.py", line 6, in
from label import Label
ImportError: No module named 'label'
run.sh: 行 77: 7916 Segmentation fault python license-plate-ocr.py $2
Traceback (most recent call last):
File "gen-outputs.py", line 7, in
from src.utils import crop_region, image_files_from_folder
File "D:\cywin\home\Administrator\alpr\src\utils.py", line 7, in
from label import Label
ImportError: No module named 'label'
rm: 无法删除'/tmp/output/_lp.png': No such file or directory
rm: 无法删除'/tmp/output/car.png': No such file or directory
rm: 无法删除'/tmp/output/
_cars.txt': No such file or directory
rm: 无法删除'/tmp/output/
_lp.txt': No such file or directory
rm: 无法删除'/tmp/output/*_str.txt': No such file or directory

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.