Spaces:
Runtime error
Runtime error
sshi
commited on
Commit
·
df06025
1
Parent(s):
ff9db0f
App bug fix.
Browse files
app.py
CHANGED
|
@@ -120,14 +120,7 @@ def plot_results(pil_img, prob, boxes):
|
|
| 120 |
|
| 121 |
cv2.rectangle(img, c1, c2, c, thickness=2, lineType=cv2.LINE_AA)
|
| 122 |
|
| 123 |
-
cv2.putText(
|
| 124 |
-
img,
|
| 125 |
-
f'{id2label[cl.item()]}: {p[cl]:0.2f}',
|
| 126 |
-
[xmin + 5, ymin + 5],
|
| 127 |
-
cv2.FONT_HERSHEY_SIMPLEX,
|
| 128 |
-
0.7,
|
| 129 |
-
c,
|
| 130 |
-
2)
|
| 131 |
# ax.text(xmin, ymin, text, fontsize=10,
|
| 132 |
# bbox=dict(facecolor=c, alpha=0.5))
|
| 133 |
return Image.fromarray(img)
|
|
|
|
| 120 |
|
| 121 |
cv2.rectangle(img, c1, c2, c, thickness=2, lineType=cv2.LINE_AA)
|
| 122 |
|
| 123 |
+
cv2.putText(img, f'{id2label[cl.item()]}: {p[cl]:0.2f}', [int(xmin) + 5, int(ymin) + 5], cv2.FONT_HERSHEY_SIMPLEX, 0.7, c, 2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
# ax.text(xmin, ymin, text, fontsize=10,
|
| 125 |
# bbox=dict(facecolor=c, alpha=0.5))
|
| 126 |
return Image.fromarray(img)
|