File size: 621 Bytes
77ece12
 
 
 
 
 
 
 
 
 
 
 
ac0b1e3
77ece12
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Import the InferencePipeline object
from inference import InferencePipeline

# Import the built in render_boxes sink for visualizing results
from inference.core.interfaces.stream.sinks import render_boxes

# initialize a pipeline object
pipeline = InferencePipeline.init(
    model_id="fall-detection-v2-ihywg/5",  # Roboflow model to use
    # Path to video, device id (int, usually 0 for built in webcams), or RTSP stream url
    video_reference="./examples/fall_test.mp4",
    on_prediction=render_boxes,  # Function to run after each prediction
    api_key="rOZmS39JRmLDRuDaF8KE"
)
pipeline.start()
pipeline.join()