Use the following definitions to customize the building process:
- DEBUG: Flag to enable debug messages
- DEVICE: Specify the device:
CPUorGPU - DOCKER_TAR: Flag to load docker images instead of building from Dockerfiles
- INGESTION: Specify the ingestion mode:
faceand/orobject. Use comma as the deliminator to specify more than 1 ingestion mode. - MODEL_NAME: Specify the custom YOLO model name which is expected to be in
video/resources/models/ultralytics/custom_models/<model name>.pt. If not provided, the Ultralytics YOLO11n (yolo11n) is used. If custom model is used, be sure the object list infrontend/setting.pymatches the classes of the model.
- OMIT_DETECTIONS_FLAG: Flag to omit printing detections to screen. By default, object detections are printed.
- RESIZE_FLAG: Specify
Trueto resize videos to model input size orFalse(default) to use video resolution.
This sample provides a list of ten sample videos from Pexel. If interested in using sample videos, run the provided script to download Pexel videos and accept the terms and conditions of the data set license.
cd inputs
./download.shThen use the start script to deploy. An example for CPU is:
cd ..
./start_app.sh -e CPUThis application accepts video stream from RTSP cameras. The URL for the camera should be set in camera_config.yaml.
In cases where a camera is not available, Ffmpeg and MediaMTX can be used to simulate a camera feed from a source such as MP4 file.
First install MediaMTX (see MediaMTX) or use their docker container to start an RTSP server:
docker run --rm -it --network=host --name rstp_server bluenviron/mediamtx:latestUse Ffmpeg to send video to the running server.
For example, to stream video TEST_VIDEO in a continuous loop to URL (specified in camera_config.yaml) at 30 frames per second, run the following:
FPS=30
GENERAL_OPTS="-threads 0 -flags +global_header -hide_banner -loglevel error -nostats -tune zerolatency -flush_packets 0"
TEST_VIDEO="<path_to_MP4_video>"
URL="rtsp://<HOSTNAME>:8554/rtsp1" # User-defined
ffmpeg -re -stream_loop -1 -i ${TEST_VIDEO} ${GENERAL_OPTS} \
-vcodec libx264 -preset fast -crf 23 -bufsize 8M -pix_fmt yuv420p \
-filter:v fps=fps=${FPS} -f rtsp -rtsp_transport tcp ${URL}Then use the start script to deploy. An example for GPU and resizing videos to lower resolution (640x640) is:
./start_app.sh -e GPU -z