mishtert commited on
Commit
726587e
·
1 Parent(s): 3d6dae7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -75,7 +75,7 @@ def process_image(image):
75
  draw.rectangle(box, outline=label2color[predicted_label])
76
  draw.text((box[0]+10, box[1]-10), text=predicted_label, fill=label2color[predicted_label], font=font)
77
 
78
- return image
79
 
80
 
81
  title = "Invoice Extraction & Categorization"
@@ -92,7 +92,8 @@ css = ".image-preview {height: auto !important;}"
92
 
93
  iface = gr.Interface(fn=process_image,
94
  inputs=gr.inputs.Image(type="pil"),
95
- outputs=gr.outputs.Image(type="pil", label="Identified & Categorized Image"),
 
96
  title=title,
97
  description=description,
98
  # article=article,
 
75
  draw.rectangle(box, outline=label2color[predicted_label])
76
  draw.text((box[0]+10, box[1]-10), text=predicted_label, fill=label2color[predicted_label], font=font)
77
 
78
+ return image, predictions
79
 
80
 
81
  title = "Invoice Extraction & Categorization"
 
92
 
93
  iface = gr.Interface(fn=process_image,
94
  inputs=gr.inputs.Image(type="pil"),
95
+ outputs= [gr.outputs.Image(type="pil", label="Identified & Categorized Image"),
96
+ gr.outputs.Text(type="text", label="Categorized item")]
97
  title=title,
98
  description=description,
99
  # article=article,