This GStreamer pipeline demonstrates object detection on multiple camera streams over RTSP protocol / Files.
All the streams are processed in parallel through the decode and scale phases, and enter the Hailo device frame by frame.
Afterwards postprocess and drawing phases add the classified object and bounding boxes to each frame. The last step is to match each frame back to its respective stream and output all of them to the display.
Read more about RTSP: RTSP
- TensorPC
- In case of using RTSP cameras: RTSP Cameras, We recommend using: AXIS M10 Network Cameras
- Hailo-8 device connected via PCIe
In case of using RTSP cameras, configuration of the RTSP camera sources is required before running.
open the multi_stream_detection_rtsp.sh
in edit mode with your preferred editor.
Configure the eight sources to match your own cameras.
readonly SRC_0="rtsp://<ip address>/?h264x=4 user-id=<username> user-pw=<password>"
readonly SRC_1="rtsp://<ip address>/?h264x=4 user-id=<username> user-pw=<password>"
etc..
./multi_stream_detection.sh
OR
./multi_stream_detection_rtsp.sh
--show-fps
Prints the fps to the output.--num-of-sources
Sets the number of sources to use by given input. The default and recommended value in this pipeline is 12 (for files) or 8 (for camera streams over RTSP protocol)"--debug
Uses gst-top to print time and memory consuming elements, saves the results as text and graph.NOTE: : When the debug flag is used and the app is running inside of a docker, exit the app by tying
Ctrl+C
in order to save the results. (Due to docker X11 display communication issues)
The output should look like:
The app post process parameters can be configured by a json file located in $TAPPAS_WORKSPACE/apps/gstreamer/general/multistream_detection/resources/configs/yolov5.json
- 'yolov5m_wo_spp' - https://github.com/hailo-ai/hailo_model_zoo/blob/master/hailo_model_zoo/cfg/networks/yolov5m_wo_spp_60p.yaml
These apps are based on our multi stream pipeline template
rtspsrc
Makes a connection to an rtsp server and read the data. Used as a src to get the video stream from rtsp-cameras.rtph264depay
Extracts h264 video from rtp packets.
- This app shows the usage of the HailoRT Stream Multiplexer. This feature controls the time shared on the Hailo device between all streams. The Stream Multiplexer is enabled by the
Hailonet
scheduling-algorithm property when in use in multipleHailonet
elements that run the same HEF file. When the Stream Multiplexer is in use, there is no need to usefunnel
andstreamiddemux
like elements because the logic is handeled internally.
Note
It is recommended to first read the Retraining TAPPAS Models page.
You can use Retraining Dockers (available on Hailo Model Zoo), to replace the following models with ones that are trained on your own dataset:
yolov5m
- Retraining docker
- For best compatibility and performance with TAPPAS, use for compilation the corresponsing YAML file from above.
- Should use ModelZoo to compile together with
centerpose
for this pipeline. See detection_pose_estimation.yaml
- TAPPAS changes to replace model:
- Update HEF_PATH on the .sh file
- Update
resources/configs/yolov5.json
with your new post-processing parameters (NMS)
- Retraining docker