Abrahamau commited on
Commit
c3f5319
·
verified ·
1 Parent(s): 2997b62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -18,19 +18,22 @@ def guessanImage(model, image):
18
  description = imgclassifier(image)
19
  return description
20
 
21
- with gr.Blocks() as demo:
22
- with gr.Tab("Lion"):
23
- radio = gr.Radio(["microsoft/resnet-50", "google/vit-base-patch16-224", "apple/mobilevit-small"], label="Select a Classifier", info="Image Classifier?")
24
-
25
- with gr.Tab("Tiger"):
26
- radio = gr.Radio(["zzmicrosoft/resnet-50", "google/vit-base-patch16-224", "apple/mobilevit-small"], label="Select a Classifier", info="Image Classifier?")
27
 
28
 
29
 
30
- demo = gr.Interface(
 
31
  fn=guessanImage,
32
  inputs=[radio, gr.Image(type="pil")],
33
  outputs=["text"],
34
  )
35
 
 
 
 
 
 
 
 
 
36
  demo.launch()
 
18
  description = imgclassifier(image)
19
  return description
20
 
 
 
 
 
 
 
21
 
22
 
23
 
24
+ radio1 = gr.Radio(["microsoft/resnet-50", "google/vit-base-patch16-224", "apple/mobilevit-small"], label="Select a Classifier", info="Image Classifier?")
25
+ tab1 = gr.Interface(
26
  fn=guessanImage,
27
  inputs=[radio, gr.Image(type="pil")],
28
  outputs=["text"],
29
  )
30
 
31
+ radio2 = gr.Radio(["microsoft/resnet-50", "google/vit-base-patch16-224", "apple/mobilevit-small"], label="Select a Classifier", info="Image Classifier?")
32
+ tab2 = gr.Interface(
33
+ fn=guessanImage,
34
+ inputs=[radio, gr.Image(type="pil")],
35
+ outputs=["text"],
36
+ )
37
+
38
+ demo = gr.TabbedInterface([tab1, tab2], ["tab1", "tab2"])
39
  demo.launch()