Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -34,6 +34,15 @@ def inference(input_image):
|
|
34 |
result = {idx_to_class[int(idx)]:val.item() for val, idx in zip(top5_prob.cpu(), top5_catid.cpu())}
|
35 |
|
36 |
return result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
iface = gr.Interface(fn=inference,
|
38 |
inputs=gr.Image(type="pil"),
|
39 |
outputs=gr.Label(num_top_classes=5))
|
|
|
34 |
result = {idx_to_class[int(idx)]:val.item() for val, idx in zip(top5_prob.cpu(), top5_catid.cpu())}
|
35 |
|
36 |
return result
|
37 |
+
|
38 |
+
|
39 |
+
title = "See Food 101"
|
40 |
+
description = "Gradio demo for See Food 101, the expansion edition of See Food from Silicon Valley. Simply upload your image, or click on the example(s) to load them. Read more at the links below for architecture used."
|
41 |
+
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2103.14030'>Swin Transformer: Hierarchical Vision Transformer using Shifted Windows</a> | <a href='https://data.vision.ee.ethz.ch/cvl/datasets_extra/food-101/'>Data</a></p>"
|
42 |
+
|
43 |
+
examples = [
|
44 |
+
['Screenshot 2023-05-05 085533.png']
|
45 |
+
]
|
46 |
iface = gr.Interface(fn=inference,
|
47 |
inputs=gr.Image(type="pil"),
|
48 |
outputs=gr.Label(num_top_classes=5))
|