sandygmaharaj commited on
Commit
05ab1c1
·
1 Parent(s): 0b1a70f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -26,7 +26,7 @@ def predict(img):
26
  coords = tuple(box.tolist())
27
  pred,pred_idx,probs = learn.predict(img.crop(coords))
28
  draw.rectangle(coords, outline=(0, 0, 0), width=1)
29
- draw.text((coords[0]-10, coords[1]-10), pred, font=ImageFont.truetype("arial"))
30
  return o_img
31
  '''
32
  emotions["x"].append((coords[0] + coords[2])/2)
@@ -51,4 +51,4 @@ enable_queue=True
51
 
52
  #gr.Interface(fn=predict,inputs=gr.Image(source="webcam",shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,interpretation=interpretation,enable_queue=enable_queue).launch()
53
  #gr.Interface(fn=predict,inputs=gr.Image(source="webcam",shape=(512, 512)),outputs=gr.ScatterPlot(),title=title,description=description,interpretation=interpretation,enable_queue=enable_queue, share=True).launch()
54
- gr.Interface(fn=predict,inputs=gr.Image(),outputs=gr.Image(),title=title,description=description,interpretation=interpretation,enable_queue=enable_queue, share=True).launch()
 
26
  coords = tuple(box.tolist())
27
  pred,pred_idx,probs = learn.predict(img.crop(coords))
28
  draw.rectangle(coords, outline=(0, 0, 0), width=1)
29
+ draw.text((coords[0]-10, coords[1]-10), pred, font=ImageFont.truetype("arial.ttf"))
30
  return o_img
31
  '''
32
  emotions["x"].append((coords[0] + coords[2])/2)
 
51
 
52
  #gr.Interface(fn=predict,inputs=gr.Image(source="webcam",shape=(512, 512)),outputs=gr.outputs.Label(num_top_classes=3),title=title,description=description,interpretation=interpretation,enable_queue=enable_queue).launch()
53
  #gr.Interface(fn=predict,inputs=gr.Image(source="webcam",shape=(512, 512)),outputs=gr.ScatterPlot(),title=title,description=description,interpretation=interpretation,enable_queue=enable_queue, share=True).launch()
54
+ gr.Interface(fn=predict,inputs=gr.Image(),outputs=gr.Image(),title=title,description=description,interpretation=interpretation,enable_queue=enable_queue).launch(share=True)