hardiksharma6555 commited on
Commit
25f45d7
·
verified ·
1 Parent(s): 61d9d9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -14
app.py CHANGED
@@ -517,10 +517,9 @@ custom_css = """
517
  """
518
 
519
  # Create Gradio interface
520
- # REMOVE css=custom_css from here
521
- with gr.Blocks(theme=gr.themes.Soft()) as app:
522
 
523
- # INJECT CSS HERE INSTEAD
524
  gr.HTML(custom_css)
525
 
526
  # Header
@@ -595,17 +594,18 @@ with gr.Blocks(theme=gr.themes.Soft()) as app:
595
 
596
  # Examples section
597
  gr.Markdown("### 💡 Example Images")
598
- gr.Examples(
599
- examples=[
600
- ["examples/pothole1.jpg", 0.5],
601
- ["examples/pothole2.jpg", 0.6],
602
- ["examples/pothole3.jpg", 0.4],
603
- ],
604
- inputs=[input_image, confidence_slider],
605
- outputs=[output_image, metrics_output, summary_output],
606
- fn=detect_potholes,
607
- cache_examples=False
608
- ) if Path("examples").exists() else None
 
609
 
610
  # Footer
611
  gr.HTML("""
@@ -644,6 +644,7 @@ if __name__ == "__main__":
644
  # Enable queue for better handling of multiple users
645
  # max_threads=4
646
  )
 
647
  # ```
648
 
649
  # ---
 
517
  """
518
 
519
  # Create Gradio interface
520
+ with gr.Blocks() as app:
 
521
 
522
+ # INJECT CSS HERE
523
  gr.HTML(custom_css)
524
 
525
  # Header
 
594
 
595
  # Examples section
596
  gr.Markdown("### 💡 Example Images")
597
+ if Path("examples").exists():
598
+ gr.Examples(
599
+ examples=[
600
+ ["examples/pothole1.jpg", 0.5],
601
+ ["examples/pothole2.jpg", 0.6],
602
+ ["examples/pothole3.jpg", 0.4],
603
+ ],
604
+ inputs=[input_image, confidence_slider],
605
+ outputs=[output_image, metrics_output, summary_output],
606
+ fn=detect_potholes,
607
+ cache_examples=False
608
+ )
609
 
610
  # Footer
611
  gr.HTML("""
 
644
  # Enable queue for better handling of multiple users
645
  # max_threads=4
646
  )
647
+
648
  # ```
649
 
650
  # ---