Noursine commited on
Commit
fcbf5bf
·
verified ·
1 Parent(s): dcd4328

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,10 +3,10 @@ import gradio as gr
3
  from ultralytics import YOLO
4
  from PIL import Image
5
 
6
- # Load YOLOv8 model (make sure best.pt is in the same folder as this script)
7
  model = YOLO('best.pt')
8
 
9
- # Folder with example test images (must be inside your repo for HF Spaces)
10
  test_images_folder = 'test_images'
11
  test_images = sorted(os.listdir(test_images_folder))
12
 
@@ -35,7 +35,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
35
  uploaded_image = gr.Image(label="Upload your image (optional)", type="filepath")
36
  selected_image = gr.Dropdown(choices=test_images, label="Or choose a test image")
37
 
38
- gr.Markdown("### 📸 Prediction Output")
39
  output_image = gr.Image(label="Predicted Output")
40
 
41
  gr.Button("Run prediction").click(
 
3
  from ultralytics import YOLO
4
  from PIL import Image
5
 
6
+ # Load YOLOv8 model
7
  model = YOLO('best.pt')
8
 
9
+ # Folder with example test images
10
  test_images_folder = 'test_images'
11
  test_images = sorted(os.listdir(test_images_folder))
12
 
 
35
  uploaded_image = gr.Image(label="Upload your image (optional)", type="filepath")
36
  selected_image = gr.Dropdown(choices=test_images, label="Or choose a test image")
37
 
38
+ gr.Markdown("### Prediction Output")
39
  output_image = gr.Image(label="Predicted Output")
40
 
41
  gr.Button("Run prediction").click(