nickmuchi commited on
Commit
7767fc8
1 Parent(s): 16f9838

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -52,8 +52,8 @@ def visualize_prediction(img, output_dict, threshold=0.5, id2label=None):
52
  ax = plt.gca()
53
  colors = COLORS * 100
54
  for score, (xmin, ymin, xmax, ymax), label, color in zip(scores, boxes, labels, colors):
55
- ax.add_patch(plt.Rectangle((xmin, ymin), xmax - xmin, ymax - ymin, fill=False, color=color, linewidth=3))
56
- ax.text(xmin, ymin, f"{label}: {score:0.2f}", fontsize=15, bbox=dict(facecolor="yellow", alpha=0.5))
57
  plt.axis("off")
58
  return fig2img(plt.gcf())
59
 
@@ -143,7 +143,7 @@ with demo:
143
 
144
  with gr.TabItem('Image Upload'):
145
  with gr.Row():
146
- img_input = gr.Image(type='pil',shape=(750,750))
147
  img_output_from_upload= gr.Image(shape=(750,750))
148
 
149
  with gr.Row():
 
52
  ax = plt.gca()
53
  colors = COLORS * 100
54
  for score, (xmin, ymin, xmax, ymax), label, color in zip(scores, boxes, labels, colors):
55
+ ax.add_patch(plt.Rectangle((xmin, ymin), xmax - xmin, ymax - ymin, fill=False, color=color, linewidth=5))
56
+ ax.text(xmin, ymin, f"{label}: {score:0.2f}", fontsize=18, bbox=dict(facecolor="yellow", alpha=0.5))
57
  plt.axis("off")
58
  return fig2img(plt.gcf())
59
 
 
143
 
144
  with gr.TabItem('Image Upload'):
145
  with gr.Row():
146
+ img_input = gr.Image(type='pil')
147
  img_output_from_upload= gr.Image(shape=(750,750))
148
 
149
  with gr.Row():