bigyunicorn commited on
Commit
91718d0
·
1 Parent(s): 8539cc1

using gradio blocks

Browse files
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -18,6 +18,19 @@ def sashimiIentifer(input_imgFilePath):
18
  (pred,idx,probs) = learner.predict(input_imgFilePath)
19
  return dict(zip(categories, map(float, probs)))
20
 
21
- img_examples = ["Hotate_Scallops.jpg", "Ahi_YellowfinAndBigeyeTuna_Sashimi.jpg", "dalle_EngawaAndHotate.png"]
22
- iface = gr.Interface(fn=sashimiIentifer, inputs="image", outputs="label", examples =img_examples, title="Sashimi Identier", description="This app identifies which sashimi it is based on the given image")
23
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  (pred,idx,probs) = learner.predict(input_imgFilePath)
19
  return dict(zip(categories, map(float, probs)))
20
 
21
+ img_examples1 = ["Hotate_Scallops.jpg", "Ahi_YellowfinAndBigeyeTuna_Sashimi.jpg"]
22
+ img_examples2 = [ "dalle_EngawaAndHotate.png"]
23
+
24
+ demo = gr.Blocks()
25
+
26
+ with demo:
27
+ with gr.Row():
28
+ input = gr.inputs.Image(shape=(192,192))
29
+ output = gr.outputs.Label()
30
+ with gr.Tab("Example Images from Web"):
31
+ examplesFromBrowser = gr.Examples(examples=img_examples1, inputs=input)
32
+ with gr.Tab("Example Images generated by AI"):
33
+ examplesFromAI = gr.Examples(examples=img_examples2,inputs=input)
34
+ input.change(fn=sashimiIentifer, inputs=input, outputs=output)
35
+
36
+ demo.launch()