Spaces:
Running
Running
Update demo.py
Browse files
demo.py
CHANGED
@@ -10,7 +10,7 @@ def plot_one_box(x, img, color=None, label=None, line_thickness=3):
|
|
10 |
# Plots one bounding box on image img
|
11 |
tl = line_thickness or round(0.002 * (img.shape[0] + img.shape[1]) / 2) + 1 # line/font thickness
|
12 |
color = color
|
13 |
-
c1, c2 = (int(x[0]), int(x[1])), (int(x[2]), int(x[3]))
|
14 |
cv2.rectangle(img, c1, c2, color, thickness=tl, lineType=cv2.LINE_AA)
|
15 |
if label:
|
16 |
tf = max(tl - 1, 1) # font thickness
|
@@ -43,8 +43,8 @@ def alpr(frame):
|
|
43 |
sys.exit()
|
44 |
image = cv2.resize(image, (1024, 640))
|
45 |
for alpr in plate_number:
|
46 |
-
print(plate_number)
|
47 |
-
|
48 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
49 |
|
50 |
alpr_output = image.copy()
|
|
|
10 |
# Plots one bounding box on image img
|
11 |
tl = line_thickness or round(0.002 * (img.shape[0] + img.shape[1]) / 2) + 1 # line/font thickness
|
12 |
color = color
|
13 |
+
c1, c2 = (int(x[0]), int(x[1])), (int(x[2])+int(x[0]), int(x[3])+int(x[1]))
|
14 |
cv2.rectangle(img, c1, c2, color, thickness=tl, lineType=cv2.LINE_AA)
|
15 |
if label:
|
16 |
tf = max(tl - 1, 1) # font thickness
|
|
|
43 |
sys.exit()
|
44 |
image = cv2.resize(image, (1024, 640))
|
45 |
for alpr in plate_number:
|
46 |
+
# print(plate_number)
|
47 |
+
image = plot_one_box(box[alpr], image, label=plate_number[alpr], color=[0, 255, 0], line_thickness=1)
|
48 |
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
49 |
|
50 |
alpr_output = image.copy()
|