# 安裝 --- * How to install ( On Ubuntu OS) $ sudo apt install librga-dev libgstreamer-plugins-base1.0-dev meson $ git clone https://github.com/DEEPX-AI/dx_stream --branch v1.7.0 $ ./install.sh # Install Dependencies $ ./build.sh --install </br> ---- # 疑難雜症 --- * error: ‘GstVideoInfo’ was not declared in this scope #include <gst/video/video.h> 加入至 src/gst-dxpreprocess.hpp and gst-dxpreprocess.cpp ---- # 驗證 --- $ gst-inspect-1.0 dxstream </br> --- ## 運行 DEMO --- * 運作 $ cd ./dx-compiler/dx_stream $ ./setup.sh $ ./run_demo.sh ``` (venv-dxnn) root@deepx-desktop:/deepx/dx-runtime/dx_stream# ./run_demo.sh /deepx/dx-runtime/dx_stream /deepx/dx-runtime/dx_stream [INFO] DX_STREAM_PATH: /deepx/dx-runtime/dx_stream [INFO] Models and Videos directory already exists. Skipping download. 0: Object Detection (YOLOv7) 1: Face Detection (YOLOV5S_Face) 2: Multi-Object Tracking 3: Pose Estimation 4: Semantic Segmentation 5: Multi-Channel Object Detection 6: Multi-Channel RTSP 7: secondary mode ``` * Extra * run_demo.sh ``` #!/bin/bash SCRIPT_DIR=$(realpath "$(dirname "$0")") DX_STREAM_PATH=$(realpath -s "${SCRIPT_DIR}") # color env settings source "${DX_STREAM_PATH}/scripts/color_env.sh" source "${DX_STREAM_PATH}/scripts/common_util.sh" pushd $DX_STREAM_PATH print_colored "DX_STREAM_PATH: $DX_STREAM_PATH" "INFO" if ! test -e "/usr/local/lib/libgstdxstream.so"; then print_colored "dx_stream is not built. Building dx_stream first before running the demo." "INFO" ./build.sh fi check_valid_dir_or_symlink() { local path="$1" if [ -d "$path" ] || { [ -L "$path" ] && [ -d "$(readlink -f "$path")" ]; }; then return 0 else return 1 fi } if check_valid_dir_or_symlink "./dx_stream/samples/models" && check_valid_dir_or_symlink "./dx_stream/samples/videos"; then print_colored "Models and Videos directory already exists. Skipping download." "INFO" else print_colored "Models and Videos not found. Downloading now via setup.sh..." "INFO" rm -rf ./dx_stream/samples ./setup.sh fi WRC=$DX_STREAM_PATH echo "0: Object Detection (YOLOv7)" echo "1: Face Detection (YOLOV5S_Face)" echo "2: Multi-Object Tracking" echo "3: Pose Estimation" echo "4: Semantic Segmentation" echo "5: Multi-Channel Object Detection" echo "6: Multi-Channel RTSP" echo "7: secondary mode" read -t 10 -p "which AI demo do you want to run:(timeout:10s, default:0)" select case $select in 0)$WRC/dx_stream/pipelines/single_network/object_detection/run_YOLOV7.sh;; 1)$WRC/dx_stream/pipelines/single_network/face_detection/run_YOLOFACE.sh;; 2)$WRC/dx_stream/pipelines/tracking/run_YOLOV5S_tracker.sh;; 3)$WRC/dx_stream/pipelines/single_network/pose_estimation/run_YOLOPOSE.sh;; 4)$WRC/dx_stream/pipelines/single_network/semantic_segmentation/run_DeepLabV3PlusMobileNetV2.sh;; 5)$WRC/dx_stream/pipelines/multi_stream/run_multi_stream_YOLOV5S.sh;; 6)$WRC/dx_stream/pipelines/rtsp/run_RTSP.sh;; 7)$WRC/dx_stream/pipelines/secondary_mode/run_secondary_mode.sh;; *)$WRC/dx_stream/pipelines/single_network/object_detection/run_YOLOV7.sh;; esac popd ``` * run_YOLO5S.sh ``` SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" SRC_DIR=$(dirname "$(dirname "$(dirname "$SCRIPT_DIR")")") INPUT_VIDEO_PATH_LIST=( "$SRC_DIR/samples/videos/boat.mp4" "$SRC_DIR/samples/videos/blackbox-city-road.mp4" "$SRC_DIR/samples/videos/blackbox-city-road2.mov" "$SRC_DIR/samples/videos/carrierbag.mp4" "$SRC_DIR/samples/videos/cctv-city-road.mov" "$SRC_DIR/samples/videos/cctv-city-road2.mov" "$SRC_DIR/samples/videos/dance-group.mov" "$SRC_DIR/samples/videos/dance-group2.mov" "$SRC_DIR/samples/videos/dance-solo.mov" "$SRC_DIR/samples/videos/dogs.mp4" "$SRC_DIR/samples/videos/doughnut.mp4" "$SRC_DIR/samples/videos/snowboard.mp4" ) # check 'vaapidecodebin' if gst-inspect-1.0 vaapidecodebin &>/dev/null; then DECODE_PIPELINE="qtdemux ! vaapidecodebin" else DECODE_PIPELINE="decodebin" fi for INPUT_VIDEO_PATH in "${INPUT_VIDEO_PATH_LIST[@]}"; do gst-launch-1.0 urisourcebin uri=file://$INPUT_VIDEO_PATH ! $DECODE_PIPELINE ! \ dxpreprocess config-file-path=$SRC_DIR/configs/Object_Detection/YOLOV5S_3/preprocess_config.json ! queue ! \ dxinfer config-file-path=$SRC_DIR/configs/Object_Detection/YOLOV5S_3/inference_config.json ! queue ! \ dxpostprocess config-file-path=$SRC_DIR/configs/Object_Detection/YOLOV5S_3/postprocess_config.json ! queue ! \ dxosd width=1280 height=720 ! queue ! \ videoconvert ! fpsdisplaysink sync=false done ``` </br> --- # 解析 DEMO --- * dx_stream/pipelines/single_network/object_detection/[run_YOLOV7.sh](https://github.com/DEEPX-AI/dx_stream/blob/main/dx_stream/pipelines/single_network/object_detection/run_YOLOV7.sh) ``` $ cd ~/Desktop/DEEPX/dx_stream/dx_stream $ export DX_STREAM_PATH="/home/deepx/Desktop/DEEPX/dx_stream/dx_stream" $ gst-launch-1.0 \ urisourcebin uri="file://${DX_STREAM_PATH}/samples/videos/boat.mp4" ! \ decodebin ! \ dxpreprocess config-file-path="${DX_STREAM_PATH}/configs/Object_Detection/YoloV7/preprocess_config.json" ! queue ! \ dxinfer config-file-path="${DX_STREAM_PATH}/configs/Object_Detection/YoloV7/inference_config.json" ! queue ! \ dxpostprocess config-file-path="${DX_STREAM_PATH}/configs/Object_Detection/YoloV7/postprocess_config.json" ! queue ! \ dxosd width=1280 height=720 ! queue ! \ videoconvert ! fpsdisplaysink sync=false ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up