Spaces:
Running
on
T4
Running
on
T4
xinghaochen
commited on
Commit
•
1e3eb91
1
Parent(s):
a3075f1
Update utils/tools_gradio.py
Browse files- utils/tools_gradio.py +5 -0
utils/tools_gradio.py
CHANGED
@@ -78,6 +78,11 @@ def fast_process(
|
|
78 |
for contour in contours:
|
79 |
contour_all.append(contour)
|
80 |
cv2.drawContours(temp, contour_all, -1, (255, 255, 255), 2 // scale)
|
|
|
|
|
|
|
|
|
|
|
81 |
color = np.array([0 / 255, 0 / 255, 255 / 255, 0.9])
|
82 |
contour_mask = temp / 255 * color.reshape(1, 1, -1)
|
83 |
|
|
|
78 |
for contour in contours:
|
79 |
contour_all.append(contour)
|
80 |
cv2.drawContours(temp, contour_all, -1, (255, 255, 255), 2 // scale)
|
81 |
+
if bbox is not None:
|
82 |
+
x1, y1, x2, y2 = bbox
|
83 |
+
cv2.rectangle(temp, (x1, y1), (x2, y2), color=(255, 0, 0), thickness=2)
|
84 |
+
if points is not None:
|
85 |
+
cv2.circle(temp, points[0], radius=10, color=(255, 0, 0), thickness=-1)
|
86 |
color = np.array([0 / 255, 0 / 255, 255 / 255, 0.9])
|
87 |
contour_mask = temp / 255 * color.reshape(1, 1, -1)
|
88 |
|