adjust example path
Browse files
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 |
-
[
|
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"
|