hyunjunian commited on
Commit
00fdca9
·
1 Parent(s): 38d9ba0

update label type

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -10,7 +10,15 @@ def greet(image):
10
  },
11
  files={'image': image},
12
  )
13
- return r.json()
 
 
 
 
 
 
 
 
14
 
15
  demo = gr.Interface(fn=greet, inputs="image", outputs="label")
16
  demo.launch()
 
10
  },
11
  files={'image': image},
12
  )
13
+
14
+ output_dict = {}
15
+
16
+ for item in r.json():
17
+ tag_name = item['tagName']
18
+ probability = item['probability']
19
+ output_dict[tag_name] = probability
20
+
21
+ return output_dict
22
 
23
  demo = gr.Interface(fn=greet, inputs="image", outputs="label")
24
  demo.launch()