LucyintheSky commited on
Commit
84f5277
1 Parent(s): 586bf53

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -4,7 +4,12 @@ from transformers import pipeline
4
  crop_pipe = pipeline("image-classification", model="LucyintheSky/pose-estimation-crop-uncrop")
5
 
6
  def classify(img):
7
- return crop_pipe(img)
 
 
8
 
9
- iface = gr.Interface(fn=classify, inputs=gr.Image(type='filepath'), outputs="text")
 
 
 
10
  iface.launch()
 
4
  crop_pipe = pipeline("image-classification", model="LucyintheSky/pose-estimation-crop-uncrop")
5
 
6
  def classify(img):
7
+ crop = crop_pipe(img)
8
+ result = crop[0]['label'] + ' (' + int([0]['score']) * 100 + '%)'
9
+ return result
10
 
11
+ iface = gr.Interface(fn=classify,
12
+ inputs=gr.Image(label='Image', type='filepath'),
13
+ outputs=gr.Textbox(label='Output'),
14
+ theme=gr.themes.Base(primary_hue=gr.themes.colors.pink, secondary_hue=gr.themes.colors.gray, neutral_hue=gr.themes.colors.slate, font=["avenir"]))
15
  iface.launch()