Spaces:
Runtime error
Runtime error
update app.py
Browse files46 unmodified lines4748495051525350 unmodified lines10410510610710810911046 unmodified linesx, y, w, h = box_int[0], box_int[1], box_int[2]-box_int[0], box_int[3]-box_int[1]#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()ax.add_patch(plt.Rectangle((x, y), w, h, fill=False, color=selected_color, linewidth=3))ax.text(x, y, f"{model_tiny.config.id2label[label.item()]}: {round(score.item()*100, 2)}%", fontdict=fdic, alpha=0.8)plt.axis("off")50 unmodified linesgr.Examples(['samples/cats.jpg', 'samples/detectron2.png', 'samples/cat.jpg', 'samples/hotdog.jpg'], inputs=input_image)gr.HTML("""<br/>""")gr.HTML("""<h4 style="color:navy;">3. Set threshold value (default to 0.9)</h4>""")threshold = gr.Slider(0, 1.0, value=0.9, label='threshold')46 unmodified lines4748495051525350 unmodified lines10410510610710810911046 unmodified linesx, y, w, h = box_int[0], box_int[1], box_int[2]-box_int[0], box_int[3]-box_int[1]#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()ax.add_patch(plt.Rectangle((x, y), w, h, fill=False, color=selected_color, linewidth=3, alpha=0.8))ax.text(x, y, f"{model_tiny.config.id2label[label.item()]}: {round(score.item()*100, 2)}%", fontdict=fdic, alpha=0.8)plt.axis("off")50 unmodified linesgr.Examples(['samples/cats.jpg', 'samples/detectron2.png', 'samples/cat.jpg', 'samples/hotdog.jpg'], inputs=input_image)gr.HTML("""<br/>""")gr.HTML("""<h4 style="color:navy;">3. Set a threshold value (default to 0.9)</h4>""")threshold = gr.Slider(0, 1.0, value=0.9, label='threshold')
app.py+2-2