Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -25,13 +25,11 @@ def draw_box(image,det):
|
|
25 |
#print(bbox)
|
26 |
start_point = ((int(ea[0]),int(ea[1])))
|
27 |
end_point = ((int(ea[2]),int(ea[3])))
|
28 |
-
|
29 |
-
|
30 |
-
label = f'{det.data}'
|
31 |
-
font = cv2.FONT_HERSHEY_SIMPLEX # Choose a font
|
32 |
font_scale = 1
|
33 |
color = (0, 0, 255) # Blue color
|
34 |
-
thickness =
|
35 |
text_position = (int(ea[0]), int(ea[1]) + 10) # Adjust position as needed
|
36 |
image = cv2.rectangle(image, start_point, end_point, color, thickness)
|
37 |
cv2.putText(image, label, text_position, font, font_scale, color, thickness)
|
|
|
25 |
#print(bbox)
|
26 |
start_point = ((int(ea[0]),int(ea[1])))
|
27 |
end_point = ((int(ea[2]),int(ea[3])))
|
28 |
+
label = f'{det.data["class_name"][i]}'
|
29 |
+
font = cv2.FONT_HERSHEY_COMPLEX # Choose a font
|
|
|
|
|
30 |
font_scale = 1
|
31 |
color = (0, 0, 255) # Blue color
|
32 |
+
thickness = 1
|
33 |
text_position = (int(ea[0]), int(ea[1]) + 10) # Adjust position as needed
|
34 |
image = cv2.rectangle(image, start_point, end_point, color, thickness)
|
35 |
cv2.putText(image, label, text_position, font, font_scale, color, thickness)
|