ajinkyakolhe112 commited on
Commit
cd1bdbb
·
verified ·
1 Parent(s): d5f7570

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -13
app.py CHANGED
@@ -21,25 +21,23 @@ def predict(inp):
21
 
22
  import gradio as gr
23
 
24
- with gr.Blocks(title="Image Classification for 1000 Objects",
25
- css=".gradio-container {background:mintcream;}"
26
- ) as demo:
27
- gr.HTML("""<div style="font-family:'Times New Roman', 'Serif'; font-size:16pt; font-weight:bold; text-align:center; color:royalblue;">Image Classification for 1000 Objects</div>""")
28
 
29
- with gr.Row():
30
- input_image = gr.Image(type="filepath", image_mode="L", shape=(224, 224))
31
- output_label = gr.Label(label="Probabilities", num_top_classes=3)
32
 
33
- send_btn = gr.Button("Infer")
34
- send_btn.click(fn=predict, inputs=input_image, outputs=output_label)
35
 
36
- with gr.Row():
37
- gr.Examples(['./lion.jpg'] , label='Sample images : Lion', inputs=input_image)
38
- gr.Examples(['./cheetah.jpg'], label='Cheetah' , inputs=input_image)
39
 
40
  # gr.Interface(fn=predict,
41
  # inputs=gr.Image(type="pil"),
42
  # outputs=gr.Label(num_top_classes=3),
43
  # examples=["lion.jpg", "cheetah.jpg"]).launch()
44
 
45
- demo.launch()
 
21
 
22
  import gradio as gr
23
 
24
+ demo = gr.Blocks(title="Image Classification for 1000 Objects", css=".gradio-container {background:mintcream;}")
25
+ gr.HTML("""<div style="font-family:'Times New Roman', 'Serif'; font-size:16pt; font-weight:bold; text-align:center; color:royalblue;">Image Classification for 1000 Objects</div>""")
 
 
26
 
27
+ with gr.Row():
28
+ input_image = gr.Image(type="filepath", image_mode="L", shape=(224, 224))
29
+ output_label = gr.Label(label="Probabilities", num_top_classes=3)
30
 
31
+ send_btn = gr.Button("Infer")
32
+ send_btn.click(fn=predict, inputs=input_image, outputs=output_label)
33
 
34
+ with gr.Row():
35
+ gr.Examples(['./lion.jpg'] , label='Sample images : Lion', inputs=input_image)
36
+ gr.Examples(['./cheetah.jpg'], label='Cheetah' , inputs=input_image)
37
 
38
  # gr.Interface(fn=predict,
39
  # inputs=gr.Image(type="pil"),
40
  # outputs=gr.Label(num_top_classes=3),
41
  # examples=["lion.jpg", "cheetah.jpg"]).launch()
42
 
43
+ demo.launch(debug=True)