b680e09bbe359a02682048e0388ef9d56bb6cafe
UAV Drone Inference Package
这是无人机检测追踪推理包,可迁移到另一台机器做二次开发。
内容
run_detect_track.py: 推理入口src/: 检测、追踪、可视化代码ultralytics/: 本项目使用的本地 YOLO 代码weights/uav_drone_yolov8s_best.pt: 已训练好的无人机检测权重ykz.png: 右上角 logotest_video/: 原始测试视频scripts/run_demo.sh: 一键运行示例
环境
先安装适配当前机器的 PyTorch/torchvision。RK3588 上建议使用该系统/板卡对应的 PyTorch wheel。
然后安装 Python 依赖:
cd /data/uav-smart-detect/inference_uav_rk3588
python3 -m pip install -r requirements.txt
运行
cd /data/uav-smart-detect/inference_uav_rk3588
bash scripts/run_demo.sh
输出在:
outputs/
包括:
*_tracked.mp4: 带检测框、轨迹、ID、logo 的视频*_tracks.csv: 每帧追踪结果
单视频运行示例
python3 run_detect_track.py \
--input test_video/test_video_1.mp4 \
--output outputs_test \
--model weights/uav_drone_yolov8s_best.pt \
--logo ykz.png \
--classes 0 \
--display-class-name drone \
--imgsz 1280 \
--conf 0.12 \
--display-conf 0.32 \
--det-iou 0.50 \
--tracker motion \
--stitch-ids
如果需要更少漏检,可以增加:
--rescue-detections --rescue-conf 0.45
Languages
Python
99.6%
Shell
0.4%