Abs6187 commited on
Commit
98a2fac
·
verified ·
1 Parent(s): 6927366

Upload 26 files

Browse files
Number_plate_OCR/.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
Number_plate_OCR/README.md ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Number Plate OCR
3
+ emoji: 🌍
4
+ colorFrom: indigo
5
+ colorTo: indigo
6
+ sdk: gradio
7
+ sdk_version: 3.44.4
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Number_plate_OCR/app.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from paddleocr import PaddleOCR, draw_ocr
2
+ from matplotlib import pyplot as plt
3
+ import cv2
4
+ import os
5
+ import gradio as gr
6
+ from typing import List
7
+
8
+ def ocr_model(filepath: str, languages: List[str]=None):
9
+ pocr_model = PaddleOCR(use_angle_cls=True, lang='ch', use_gpu=False)
10
+ result = pocr_model.ocr(filepath)
11
+ state_txt = ""
12
+ for i in range(len(result[0])):
13
+ text1= result[0][i][1][0]
14
+ state_txt += str(text1)+'\n'
15
+ return state_txt
16
+
17
+ title = "US Vehicles Number Plate"
18
+ description = "Gradio demo for PaddlePaddle. PaddleOCR is an open source text recognition (OCR) Engine."
19
+ article = "<p style='text-align: center'><a href='https://github.com/PaddlePaddle/PaddleOCR' target='_blank'>Github Repo</a></p>"
20
+
21
+ with gr.Blocks(title=title) as demo:
22
+ gr.Markdown(f'<h1 style="text-align: center; margin-bottom: 1rem;">{title}</h1>')
23
+ gr.Markdown(description)
24
+ with gr.Row():
25
+ with gr.Column():
26
+ image = gr.Image(type="filepath", label="Input")
27
+ with gr.Row():
28
+ btn_clear = gr.ClearButton([image])
29
+ btn_submit = gr.Button(value="Submit", variant="primary")
30
+ with gr.Column():
31
+ text = gr.Textbox(label="Output")
32
+
33
+ btn_submit.click(ocr_model, inputs=[image], outputs=text, api_name="PaddleOCR")
34
+ btn_clear.add(text)
35
+
36
+ gr.Markdown(article)
37
+
38
+ if __name__ == '__main__':
39
+ demo.launch()
Number_plate_OCR/requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ paddleocr
2
+ paddlepaddle==2.4.2
3
+ matplotlib
4
+ gradio
5
+ opencv-python-headless
6
+ numpy
7
+ typing
Number_plate_OCR/test_images/MP1.jpg ADDED
Number_plate_OCR/test_images/MP1.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <annotation>
2
+ <folder>MP</folder>
3
+ <filename>MP1.jpg</filename>
4
+ <path>C:\Users\Siri\Downloads\OLX_images\MP\MP1.jpg</path>
5
+ <source>
6
+ <database>Unknown</database>
7
+ </source>
8
+ <size>
9
+ <width>269</width>
10
+ <height>436</height>
11
+ <depth>3</depth>
12
+ </size>
13
+ <segmented>0</segmented>
14
+ <object>
15
+ <name>MP04CL3546</name>
16
+ <pose>Unspecified</pose>
17
+ <truncated>0</truncated>
18
+ <difficult>0</difficult>
19
+ <bndbox>
20
+ <xmin>90</xmin>
21
+ <ymin>269</ymin>
22
+ <xmax>171</xmax>
23
+ <ymax>287</ymax>
24
+ </bndbox>
25
+ </object>
26
+ </annotation>
Number_plate_OCR/test_images/MP10.jpg ADDED
Number_plate_OCR/test_images/MP10.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <annotation>
2
+ <folder>MP</folder>
3
+ <filename>MP10.jpg</filename>
4
+ <path>C:\Users\Siri\Downloads\OLX_images\MP\MP10.jpg</path>
5
+ <source>
6
+ <database>Unknown</database>
7
+ </source>
8
+ <size>
9
+ <width>272</width>
10
+ <height>363</height>
11
+ <depth>3</depth>
12
+ </size>
13
+ <segmented>0</segmented>
14
+ <object>
15
+ <name>MP08CA6293</name>
16
+ <pose>Unspecified</pose>
17
+ <truncated>0</truncated>
18
+ <difficult>0</difficult>
19
+ <bndbox>
20
+ <xmin>95</xmin>
21
+ <ymin>265</ymin>
22
+ <xmax>184</xmax>
23
+ <ymax>284</ymax>
24
+ </bndbox>
25
+ </object>
26
+ </annotation>
Number_plate_OCR/test_images/MP11.jpg ADDED
Number_plate_OCR/test_images/MP11.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <annotation>
2
+ <folder>MP</folder>
3
+ <filename>MP11.jpg</filename>
4
+ <path>C:\Users\Siri\Downloads\OLX_images\MP\MP11.jpg</path>
5
+ <source>
6
+ <database>Unknown</database>
7
+ </source>
8
+ <size>
9
+ <width>272</width>
10
+ <height>292</height>
11
+ <depth>3</depth>
12
+ </size>
13
+ <segmented>0</segmented>
14
+ <object>
15
+ <name>MP07CB8897</name>
16
+ <pose>Unspecified</pose>
17
+ <truncated>0</truncated>
18
+ <difficult>0</difficult>
19
+ <bndbox>
20
+ <xmin>92</xmin>
21
+ <ymin>201</ymin>
22
+ <xmax>186</xmax>
23
+ <ymax>228</ymax>
24
+ </bndbox>
25
+ </object>
26
+ </annotation>
Number_plate_OCR/test_images/MP2.jpg ADDED
Number_plate_OCR/test_images/MP2.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <annotation>
2
+ <folder>MP</folder>
3
+ <filename>MP2.jpg</filename>
4
+ <path>C:\Users\Siri\Downloads\OLX_images\MP\MP2.jpg</path>
5
+ <source>
6
+ <database>Unknown</database>
7
+ </source>
8
+ <size>
9
+ <width>207</width>
10
+ <height>153</height>
11
+ <depth>3</depth>
12
+ </size>
13
+ <segmented>0</segmented>
14
+ <object>
15
+ <name>MP04CL8840</name>
16
+ <pose>Unspecified</pose>
17
+ <truncated>0</truncated>
18
+ <difficult>0</difficult>
19
+ <bndbox>
20
+ <xmin>39</xmin>
21
+ <ymin>126</ymin>
22
+ <xmax>99</xmax>
23
+ <ymax>142</ymax>
24
+ </bndbox>
25
+ </object>
26
+ </annotation>
Number_plate_OCR/test_images/MP3.jpg ADDED
Number_plate_OCR/test_images/MP3.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <annotation>
2
+ <folder>MP</folder>
3
+ <filename>MP3.jpg</filename>
4
+ <path>C:\Users\Siri\Downloads\OLX_images\MP\MP3.jpg</path>
5
+ <source>
6
+ <database>Unknown</database>
7
+ </source>
8
+ <size>
9
+ <width>272</width>
10
+ <height>363</height>
11
+ <depth>3</depth>
12
+ </size>
13
+ <segmented>0</segmented>
14
+ <object>
15
+ <name>MP65C0654</name>
16
+ <pose>Unspecified</pose>
17
+ <truncated>0</truncated>
18
+ <difficult>0</difficult>
19
+ <bndbox>
20
+ <xmin>93</xmin>
21
+ <ymin>206</ymin>
22
+ <xmax>167</xmax>
23
+ <ymax>223</ymax>
24
+ </bndbox>
25
+ </object>
26
+ </annotation>
Number_plate_OCR/test_images/MP4.jpg ADDED
Number_plate_OCR/test_images/MP4.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <annotation>
2
+ <folder>MP</folder>
3
+ <filename>MP4.jpg</filename>
4
+ <path>C:\Users\Siri\Downloads\OLX_images\MP\MP4.jpg</path>
5
+ <source>
6
+ <database>Unknown</database>
7
+ </source>
8
+ <size>
9
+ <width>272</width>
10
+ <height>363</height>
11
+ <depth>3</depth>
12
+ </size>
13
+ <segmented>0</segmented>
14
+ <object>
15
+ <name>MP09CK4943</name>
16
+ <pose>Unspecified</pose>
17
+ <truncated>0</truncated>
18
+ <difficult>0</difficult>
19
+ <bndbox>
20
+ <xmin>99</xmin>
21
+ <ymin>199</ymin>
22
+ <xmax>158</xmax>
23
+ <ymax>213</ymax>
24
+ </bndbox>
25
+ </object>
26
+ </annotation>
Number_plate_OCR/test_images/MP5.jpg ADDED
Number_plate_OCR/test_images/MP5.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <annotation>
2
+ <folder>MP</folder>
3
+ <filename>MP5.jpg</filename>
4
+ <path>C:\Users\Siri\Downloads\OLX_images\MP\MP5.jpg</path>
5
+ <source>
6
+ <database>Unknown</database>
7
+ </source>
8
+ <size>
9
+ <width>272</width>
10
+ <height>363</height>
11
+ <depth>3</depth>
12
+ </size>
13
+ <segmented>0</segmented>
14
+ <object>
15
+ <name>MP20TA0919</name>
16
+ <pose>Unspecified</pose>
17
+ <truncated>0</truncated>
18
+ <difficult>0</difficult>
19
+ <bndbox>
20
+ <xmin>101</xmin>
21
+ <ymin>230</ymin>
22
+ <xmax>171</xmax>
23
+ <ymax>244</ymax>
24
+ </bndbox>
25
+ </object>
26
+ </annotation>
Number_plate_OCR/test_images/MP6.jpg ADDED
Number_plate_OCR/test_images/MP6.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <annotation>
2
+ <folder>MP</folder>
3
+ <filename>MP6.jpg</filename>
4
+ <path>C:\Users\Siri\Downloads\OLX_images\MP\MP6.jpg</path>
5
+ <source>
6
+ <database>Unknown</database>
7
+ </source>
8
+ <size>
9
+ <width>272</width>
10
+ <height>363</height>
11
+ <depth>3</depth>
12
+ </size>
13
+ <segmented>0</segmented>
14
+ <object>
15
+ <name>MP07CA5563</name>
16
+ <pose>Unspecified</pose>
17
+ <truncated>0</truncated>
18
+ <difficult>0</difficult>
19
+ <bndbox>
20
+ <xmin>91</xmin>
21
+ <ymin>239</ymin>
22
+ <xmax>178</xmax>
23
+ <ymax>256</ymax>
24
+ </bndbox>
25
+ </object>
26
+ </annotation>
Number_plate_OCR/test_images/MP7.jpg ADDED
Number_plate_OCR/test_images/MP7.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <annotation>
2
+ <folder>MP</folder>
3
+ <filename>MP7.jpg</filename>
4
+ <path>C:\Users\Siri\Downloads\OLX_images\MP\MP7.jpg</path>
5
+ <source>
6
+ <database>Unknown</database>
7
+ </source>
8
+ <size>
9
+ <width>272</width>
10
+ <height>484</height>
11
+ <depth>3</depth>
12
+ </size>
13
+ <segmented>0</segmented>
14
+ <object>
15
+ <name>MP09BD1270</name>
16
+ <pose>Unspecified</pose>
17
+ <truncated>0</truncated>
18
+ <difficult>0</difficult>
19
+ <bndbox>
20
+ <xmin>97</xmin>
21
+ <ymin>230</ymin>
22
+ <xmax>181</xmax>
23
+ <ymax>253</ymax>
24
+ </bndbox>
25
+ </object>
26
+ </annotation>
Number_plate_OCR/test_images/MP8.jpg ADDED
Number_plate_OCR/test_images/MP8.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <annotation>
2
+ <folder>MP</folder>
3
+ <filename>MP8.jpg</filename>
4
+ <path>C:\Users\Siri\Downloads\OLX_images\MP\MP8.jpg</path>
5
+ <source>
6
+ <database>Unknown</database>
7
+ </source>
8
+ <size>
9
+ <width>272</width>
10
+ <height>363</height>
11
+ <depth>3</depth>
12
+ </size>
13
+ <segmented>0</segmented>
14
+ <object>
15
+ <name>MP09CQ9712</name>
16
+ <pose>Unspecified</pose>
17
+ <truncated>0</truncated>
18
+ <difficult>0</difficult>
19
+ <bndbox>
20
+ <xmin>92</xmin>
21
+ <ymin>182</ymin>
22
+ <xmax>174</xmax>
23
+ <ymax>206</ymax>
24
+ </bndbox>
25
+ </object>
26
+ </annotation>
Number_plate_OCR/test_images/MP9.jpg ADDED
Number_plate_OCR/test_images/MP9.xml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <annotation>
2
+ <folder>MP</folder>
3
+ <filename>MP9.jpg</filename>
4
+ <path>C:\Users\Siri\Downloads\OLX_images\MP\MP9.jpg</path>
5
+ <source>
6
+ <database>Unknown</database>
7
+ </source>
8
+ <size>
9
+ <width>272</width>
10
+ <height>471</height>
11
+ <depth>3</depth>
12
+ </size>
13
+ <segmented>0</segmented>
14
+ <object>
15
+ <name>MP45G0872</name>
16
+ <pose>Unspecified</pose>
17
+ <truncated>0</truncated>
18
+ <difficult>0</difficult>
19
+ <bndbox>
20
+ <xmin>189</xmin>
21
+ <ymin>216</ymin>
22
+ <xmax>248</xmax>
23
+ <ymax>248</ymax>
24
+ </bndbox>
25
+ </object>
26
+ </annotation>