aayanb09 commited on
Commit
8b4cbfb
·
verified ·
1 Parent(s): 5a033e2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -5,7 +5,7 @@ import os
5
  MODEL_PATH = "best.pt"
6
 
7
  if not os.path.exists(MODEL_PATH):
8
- raise FileNotFoundError("best.pt not found.")
9
 
10
  model = YOLO(MODEL_PATH)
11
 
@@ -15,12 +15,12 @@ def predict(image):
15
 
16
  with gr.Blocks() as demo:
17
  gr.Markdown("# 🐶 DogFLW Pose Detection")
18
- gr.Markdown("Upload an image to detect dog facial landmarks.")
19
 
20
  input_img = gr.Image(type="pil")
21
  output_img = gr.Image()
22
 
23
- btn = gr.Button("Run Detection")
24
- btn.click(predict, inputs=input_img, outputs=output_img)
25
 
26
  demo.launch()
 
5
  MODEL_PATH = "best.pt"
6
 
7
  if not os.path.exists(MODEL_PATH):
8
+ raise FileNotFoundError("Upload best.pt to the Space root directory.")
9
 
10
  model = YOLO(MODEL_PATH)
11
 
 
15
 
16
  with gr.Blocks() as demo:
17
  gr.Markdown("# 🐶 DogFLW Pose Detection")
18
+ gr.Markdown("Upload a dog image to detect facial keypoints.")
19
 
20
  input_img = gr.Image(type="pil")
21
  output_img = gr.Image()
22
 
23
+ run_button = gr.Button("Run Detection")
24
+ run_button.click(predict, inputs=input_img, outputs=output_img)
25
 
26
  demo.launch()