Luigi commited on
Commit
5b4536d
·
1 Parent(s): 508c94e

adjust example path

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -7,6 +7,10 @@ import gradio as gr
7
  from ultralytics import YOLO # Now used for Yolov8spose with integrated tracker & pose estimation
8
  import torch
9
 
 
 
 
 
10
  # ----------------------------
11
  # Helper: Extract red polygon from editor drawing (alert zone)
12
  def extract_polygon_from_editor(editor_image, epsilon_ratio=0.01):
@@ -287,7 +291,7 @@ with gr.Blocks() as demo:
287
  with gr.Row():
288
  gr.Examples(
289
  examples=[
290
- ["examples/faint.mp4"]
291
  ],
292
  inputs=[video_input],
293
  label="Try Example Video"
 
7
  from ultralytics import YOLO # Now used for Yolov8spose with integrated tracker & pose estimation
8
  import torch
9
 
10
+ # Get the directory where the current script is located.
11
+ BASE_DIR = os.path.dirname(os.path.abspath(__file__))
12
+ EXAMPLE_VIDEO = os.path.join(BASE_DIR, "examples", "faint.mp4")
13
+
14
  # ----------------------------
15
  # Helper: Extract red polygon from editor drawing (alert zone)
16
  def extract_polygon_from_editor(editor_image, epsilon_ratio=0.01):
 
291
  with gr.Row():
292
  gr.Examples(
293
  examples=[
294
+ [EXAMPLE_VIDEO]
295
  ],
296
  inputs=[video_input],
297
  label="Try Example Video"