ClassCat commited on
Commit
1c91183
1 Parent(s): fe7d5eb

update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -47,7 +47,7 @@ def get_figure(in_pil_img, in_results):
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=3))
51
  ax.text(x, y, f"{model_tiny.config.id2label[label.item()]}: {round(score.item()*100, 2)}%", fontdict=fdic, alpha=0.8)
52
 
53
  plt.axis("off")
@@ -104,7 +104,7 @@ with gr.Blocks(title="YOLOS Object Detection - ClassCat",
104
  gr.Examples(['samples/cats.jpg', 'samples/detectron2.png', 'samples/cat.jpg', 'samples/hotdog.jpg'], inputs=input_image)
105
 
106
  gr.HTML("""<br/>""")
107
- gr.HTML("""<h4 style="color:navy;">3. Set threshold value (default to 0.9)</h4>""")
108
 
109
  threshold = gr.Slider(0, 1.0, value=0.9, label='threshold')
110
 
 
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=3, alpha=0.8))
51
  ax.text(x, y, f"{model_tiny.config.id2label[label.item()]}: {round(score.item()*100, 2)}%", fontdict=fdic, alpha=0.8)
52
 
53
  plt.axis("off")
 
104
  gr.Examples(['samples/cats.jpg', 'samples/detectron2.png', 'samples/cat.jpg', 'samples/hotdog.jpg'], inputs=input_image)
105
 
106
  gr.HTML("""<br/>""")
107
+ gr.HTML("""<h4 style="color:navy;">3. Set a threshold value (default to 0.9)</h4>""")
108
 
109
  threshold = gr.Slider(0, 1.0, value=0.9, label='threshold')
110