File size: 846 Bytes
2b0f6fa
 
 
 
 
21c361a
2b0f6fa
b9ad85c
 
 
 
 
 
 
 
 
2b0f6fa
 
 
 
 
 
 
 
b9ad85c
 
2b0f6fa
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

import gradio as gr
from predict import predict_gradio

title = "Mohammad Ali Food101 Classification🍔"
description = "This demo is a related to classification of 101 different foods."

with open('gradio_results.md') as f:
    article = f.read()

interface_options = {
    "article": article,
    "layout": "horizontal",
    "theme": "default",
}


demo = gr.Interface(
    predict_gradio,
    inputs = gr.Image(type="pil"),
    outputs = [gr.Label(num_top_classes = 5 , label = "All Predictions in 5 most value predicted classes"),
               gr.Label(num_top_classes = 1 , label = "Model Predicts Image as a")],
    examples=['examples/3243342.jpg', 'examples/1652678.jpg', 'examples/1046933.jpg', 'examples/1840999.jpg', 'examples/168855.jpg'],
    title = title,
    description = description,
    **interface_options
)

demo.launch()