Ahsen Khaliq
commited on
Commit
·
ed6d020
1
Parent(s):
972a2e0
Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def inference(img):
|
|
58 |
pred_class_names = [imagenet_id_to_classname[str(i.item())] for i in pred_classes[0]]
|
59 |
return "Top 5 predicted labels: %s" % ", ".join(pred_class_names)
|
60 |
|
61 |
-
inputs = gr.inputs.Image(type='
|
62 |
outputs = gr.outputs.Textbox(label="Output")
|
63 |
|
64 |
title = "Omnivore"
|
@@ -68,4 +68,4 @@ description = "Gradio demo for Revisiting Weakly Supervised Pre-Training of Visu
|
|
68 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2201.08371' target='_blank'>Revisiting Weakly Supervised Pre-Training of Visual Perception Models</a> | <a href='https://github.com/facebookresearch/SWAG' target='_blank'>Github Repo</a></p>"
|
69 |
|
70 |
|
71 |
-
gr.Interface(inference, inputs, outputs, title=title, description=description, article=article, examples=[['library.jpg']]).launch(enable_queue=True)
|
|
|
58 |
pred_class_names = [imagenet_id_to_classname[str(i.item())] for i in pred_classes[0]]
|
59 |
return "Top 5 predicted labels: %s" % ", ".join(pred_class_names)
|
60 |
|
61 |
+
inputs = gr.inputs.Image(type='pil')
|
62 |
outputs = gr.outputs.Textbox(label="Output")
|
63 |
|
64 |
title = "Omnivore"
|
|
|
68 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2201.08371' target='_blank'>Revisiting Weakly Supervised Pre-Training of Visual Perception Models</a> | <a href='https://github.com/facebookresearch/SWAG' target='_blank'>Github Repo</a></p>"
|
69 |
|
70 |
|
71 |
+
gr.Interface(inference, inputs, outputs, title=title, description=description, article=article, examples=[['library.jpg']]).launch(enable_queue=True,cache_examples=True)
|