ClassCat commited on
Commit
af93aba
1 Parent(s): 4ea08e9

update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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 = 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))
 
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]).item(), torch.round(box[1]).item(), torch.round(box[2]-box[0]).item(), torch.round(box[3]-box[1]).item()
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))