Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Import the InferencePipeline object
|
2 |
+
from inference import InferencePipeline
|
3 |
+
|
4 |
+
# Import the built in render_boxes sink for visualizing results
|
5 |
+
from inference.core.interfaces.stream.sinks import render_boxes
|
6 |
+
|
7 |
+
# initialize a pipeline object
|
8 |
+
pipeline = InferencePipeline.init(
|
9 |
+
model_id="fall-detection-v2-ihywg/5", # Roboflow model to use
|
10 |
+
# Path to video, device id (int, usually 0 for built in webcams), or RTSP stream url
|
11 |
+
video_reference="./examples/fall_test.mp4",
|
12 |
+
on_prediction=render_boxes, # Function to run after each prediction
|
13 |
+
)
|
14 |
+
pipeline.start()
|
15 |
+
pipeline.join()
|