piyushgrover commited on
Commit
6f6eda6
·
1 Parent(s): c44e5c6

added examples

Browse files
app.py CHANGED
@@ -51,6 +51,12 @@ def predict_top5(image):
51
 
52
  return top5_results
53
 
 
 
 
 
 
 
54
  # Create the Gradio interface
55
  interface = gr.Interface(
56
  fn=predict_top5,
@@ -58,6 +64,7 @@ interface = gr.Interface(
58
  outputs=gr.Label(num_top_classes=5), # Updated syntax for label output
59
  title="ResNet50 Image Classification",
60
  description="Upload an image to get the top-5 class predictions from the ResNet50 model trained on ImageNet 1k.",
 
61
  )
62
 
63
  # Launch the app
 
51
 
52
  return top5_results
53
 
54
+ examples = [
55
+ ["examples/espresso.jpg.webp"], # Example 1
56
+ ["examples/american_bullfrog.jpg"], # Example 2
57
+ ["examples/tiger_shark.jpg"], # Example 3
58
+ ]
59
+
60
  # Create the Gradio interface
61
  interface = gr.Interface(
62
  fn=predict_top5,
 
64
  outputs=gr.Label(num_top_classes=5), # Updated syntax for label output
65
  title="ResNet50 Image Classification",
66
  description="Upload an image to get the top-5 class predictions from the ResNet50 model trained on ImageNet 1k.",
67
+ examples=examples
68
  )
69
 
70
  # Launch the app
examples/american_bullfrog.jpg ADDED
examples/espresso.jpg.webp ADDED
examples/tiger_shark.jpg ADDED