Spaces:
Running
Running
update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ COLORS = ["#ff7f7f", "#ff7fbf", "#ff7fff", "#bf7fff",
|
|
29 |
fdic = {
|
30 |
"family" : "DejaVu Serif",
|
31 |
"style" : "italic",
|
32 |
-
"size" :
|
33 |
"color" : "yellow",
|
34 |
"weight" : "bold"
|
35 |
}
|
@@ -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=
|
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")
|
|
|
29 |
fdic = {
|
30 |
"family" : "DejaVu Serif",
|
31 |
"style" : "italic",
|
32 |
+
"size" : 16,
|
33 |
"color" : "yellow",
|
34 |
"weight" : "bold"
|
35 |
}
|
|
|
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")
|