Spaces:
Running
Running
update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ def get_figure(in_pil_img, in_results):
|
|
43 |
for score, label, box in zip(in_results["scores"], in_results["labels"], in_results["boxes"]):
|
44 |
selected_color = choice(COLORS)
|
45 |
|
46 |
-
x, y, w, h = round(box[0]), round(box[1]), round(box[2]-box[0]), round(box[3]-box[1])
|
47 |
#x, y, w, h = int(box[0]), int(box[1]), int(box[2]-box[0]), int(box[3]-box[1])
|
48 |
|
49 |
ax.add_patch(plt.Rectangle((x, y), w, h, fill=False, color=selected_color, linewidth=2))
|
|
|
43 |
for score, label, box in zip(in_results["scores"], in_results["labels"], in_results["boxes"]):
|
44 |
selected_color = choice(COLORS)
|
45 |
|
46 |
+
x, y, w, h = torch.round(box[0]), torch.round(box[1]), torch.round(box[2]-box[0]), torch.round(box[3]-box[1])
|
47 |
#x, y, w, h = int(box[0]), int(box[1]), int(box[2]-box[0]), int(box[3]-box[1])
|
48 |
|
49 |
ax.add_patch(plt.Rectangle((x, y), w, h, fill=False, color=selected_color, linewidth=2))
|