streiluc commited on
Commit
c6ad28e
·
verified ·
1 Parent(s): 23ef54a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -27,12 +27,13 @@ def predict_regression(image):
27
  top_1_confidence = np.round(float(prediction[0][top_1_idx]), 2) # Get the confidence score
28
  return {top_1_label: top_1_confidence} # Return only the top-1 result
29
 
30
- # Create Gradio interface
31
- input_image = gr.Image()
32
- output_text = gr.Label() # Use gr.Label to show top-1 result
 
33
  interface = gr.Interface(fn=predict_regression,
34
  inputs=input_image,
35
  outputs=output_text, # Change output to Label to display single label and confidence
36
- examples=examples=["images/bond.jpg","images/wolfes.jpg","images/scared-Cat.jpg","images/one-Does-Not-Simply.jpg", "images/cat.jpg", "images/kronk.jpg", "images/zebra.jpg", "images/dog.jpg", "images/johnson.jpg", "images/panda.jpg"],
37
  description="You ever wonder what your spiritual Animal is? Well here's the answer.")
38
  interface.launch()
 
27
  top_1_confidence = np.round(float(prediction[0][top_1_idx]), 2) # Get the confidence score
28
  return {top_1_label: top_1_confidence} # Return only the top-1 result
29
 
30
+
31
+ #Create Gradio interface
32
+ input_image = gr.inputs.Image()
33
+ output_text = gr.outputs.Label() # Use gr.Label to show top-1 result
34
  interface = gr.Interface(fn=predict_regression,
35
  inputs=input_image,
36
  outputs=output_text, # Change output to Label to display single label and confidence
37
+ examples=["images/bond.jpg","images/wolfes.jpg","images/scared-Cat.jpg","images/one-Does-Not-Simply.jpg", "images/cat.jpg", "images/kronk.jpg", "images/zebra.jpg", "images/dog.jpg", "images/johnson.jpg", "images/panda.jpg"],
38
  description="You ever wonder what your spiritual Animal is? Well here's the answer.")
39
  interface.launch()