egmaminta commited on
Commit
c743d51
1 Parent(s): 2f7b0cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -13
app.py CHANGED
@@ -1,16 +1,4 @@
1
  from transformers import AutoFeatureExtractor, AutoModelForImageClassification
2
  import gradio
3
 
4
- extractor = AutoFeatureExtractor.from_pretrained("vincentclaes/mit-indoor-scenes")
5
- model = AutoModelForImageClassification.from_pretrained("vincentclaes/mit-indoor-scenes")
6
-
7
- def classify(image):
8
- inputs = extractor(images=image, return_tensors='pt')
9
- outputs = model(**inputs)
10
- return {labels[i]: float(outputs[i] for i in range(67))}
11
-
12
- gradio.Interface(fn=classify,
13
- inputs=gradio.inputs.Image(shape=(224,224), image_mode='RGB', source='upload', tool='editor', type='pil', label=None, optional=False),
14
- outputs='text',
15
- #outputs=gradio.outputs.Label(num_top_classes=5),
16
- allow_flagging='never').launch(inbrowser=True)
 
1
  from transformers import AutoFeatureExtractor, AutoModelForImageClassification
2
  import gradio
3
 
4
+ gradio.Interface.load(name='huggingface/vincentclaes/mit-indoor-scenes').launch()