Spaces:
Sleeping
Sleeping
Commit
·
8025d06
1
Parent(s):
9061119
Update api.py
Browse files
api.py
CHANGED
@@ -72,11 +72,12 @@ def get_time():
|
|
72 |
cv2.rectangle(img_ROI, (X1, Y1), (X2, Y2), (255, 0, 255), 2)
|
73 |
|
74 |
else:
|
|
|
|
|
75 |
result = reader.readtext(img, paragraph='True')
|
76 |
print(result, "Result")
|
77 |
# iterate on all results
|
78 |
for res in result:
|
79 |
-
img = cv2.resize(img,(int(img.shape[1]*65/100),int(img.shape[0]*65/100)))
|
80 |
top_left = tuple(res[0][0]) # top left coordinates as tuple
|
81 |
bottom_right = tuple(res[0][2]) # bottom right coordinates as tuple
|
82 |
# draw rectangle on image
|
|
|
72 |
cv2.rectangle(img_ROI, (X1, Y1), (X2, Y2), (255, 0, 255), 2)
|
73 |
|
74 |
else:
|
75 |
+
print((int(img.shape[1]*0.65),int(img.shape[0]*0.65)))
|
76 |
+
img = cv2.resize(img,(int(img.shape[1]*0.65),int(img.shape[0]*0.65)))
|
77 |
result = reader.readtext(img, paragraph='True')
|
78 |
print(result, "Result")
|
79 |
# iterate on all results
|
80 |
for res in result:
|
|
|
81 |
top_left = tuple(res[0][0]) # top left coordinates as tuple
|
82 |
bottom_right = tuple(res[0][2]) # bottom right coordinates as tuple
|
83 |
# draw rectangle on image
|