Spaces:
Running
Running
update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,7 @@ def get_figure(in_pil_img, in_results):
|
|
44 |
selected_color = choice(COLORS)
|
45 |
|
46 |
box_int = [i.item() for i in torch.round(box).to(torch.int32)]
|
47 |
-
x, y, w, h =
|
48 |
#x, y, w, h = torch.round(box[0]).item(), torch.round(box[1]).item(), torch.round(box[2]-box[0]).item(), torch.round(box[3]-box[1]).item()
|
49 |
|
50 |
ax.add_patch(plt.Rectangle((x, y), w, h, fill=False, color=selected_color, linewidth=2))
|
|
|
44 |
selected_color = choice(COLORS)
|
45 |
|
46 |
box_int = [i.item() for i in torch.round(box).to(torch.int32)]
|
47 |
+
x, y, w, h = box_int[0], box_int[1], box_int[2]-box_int[0], box_int[3]-box_int[1]
|
48 |
#x, y, w, h = torch.round(box[0]).item(), torch.round(box[1]).item(), torch.round(box[2]-box[0]).item(), torch.round(box[3]-box[1]).item()
|
49 |
|
50 |
ax.add_patch(plt.Rectangle((x, y), w, h, fill=False, color=selected_color, linewidth=2))
|