mohitk24 commited on
Commit
f00acb2
·
verified ·
1 Parent(s): b3d2a94

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -68,7 +68,12 @@ def do_predict(pil_img, preprocess=True):
68
 
69
  return pretty_dict, original_img, preprocessed_img
70
 
71
- # Remove external URLs - use local examples or none
 
 
 
 
 
72
  with gr.Blocks() as demo:
73
  gr.Markdown("# Is this a STOP sign or not?")
74
  gr.Markdown("Upload a photo to see results.")
@@ -89,7 +94,14 @@ with gr.Blocks() as demo:
89
  outputs=[proba_pretty, original_img_out, preprocessed_img_out]
90
  )
91
 
92
- # No examples with external URLs to avoid connection errors
 
 
 
 
 
 
 
93
 
94
  if __name__ == "__main__":
95
  demo.launch()
 
68
 
69
  return pretty_dict, original_img, preprocessed_img
70
 
71
+ EXAMPLES = [
72
+ ["https://universalsigns.com/wp-content/uploads/2022/08/StopSign-3.jpg"],
73
+ ["https://images.roadtrafficsigns.com/img/pla/K/student-drop-off-area-sign-k-2459_pl.png"],
74
+ ["https://hansonsign.com/wp-content/uploads/2024/05/donatos-662x646.jpg"]
75
+ ]
76
+
77
  with gr.Blocks() as demo:
78
  gr.Markdown("# Is this a STOP sign or not?")
79
  gr.Markdown("Upload a photo to see results.")
 
94
  outputs=[proba_pretty, original_img_out, preprocessed_img_out]
95
  )
96
 
97
+ gr.Examples(
98
+ examples=EXAMPLES,
99
+ inputs=[image_in],
100
+ label="Choose any one",
101
+ examples_per_page=8,
102
+ cache_examples=False,
103
+ )
104
+
105
 
106
  if __name__ == "__main__":
107
  demo.launch()