67 lines
1.4 KiB
Markdown
67 lines
1.4 KiB
Markdown
# UAV Drone Inference Package
|
|
|
|
这是无人机检测追踪推理包,可迁移到另一台机器做二次开发。
|
|
|
|
## 内容
|
|
|
|
- `run_detect_track.py`: 推理入口
|
|
- `src/`: 检测、追踪、可视化代码
|
|
- `ultralytics/`: 本项目使用的本地 YOLO 代码
|
|
- `weights/uav_drone_yolov8s_best.pt`: 已训练好的无人机检测权重
|
|
- `ykz.png`: 右上角 logo
|
|
- `test_video/`: 原始测试视频
|
|
- `scripts/run_demo.sh`: 一键运行示例
|
|
|
|
## 环境
|
|
|
|
先安装适配当前机器的 PyTorch/torchvision。RK3588 上建议使用该系统/板卡对应的 PyTorch wheel。
|
|
|
|
然后安装 Python 依赖:
|
|
|
|
```bash
|
|
cd /data/uav-smart-detect/inference_uav_rk3588
|
|
python3 -m pip install -r requirements.txt
|
|
```
|
|
|
|
## 运行
|
|
|
|
```bash
|
|
cd /data/uav-smart-detect/inference_uav_rk3588
|
|
bash scripts/run_demo.sh
|
|
```
|
|
|
|
输出在:
|
|
|
|
```text
|
|
outputs/
|
|
```
|
|
|
|
包括:
|
|
|
|
- `*_tracked.mp4`: 带检测框、轨迹、ID、logo 的视频
|
|
- `*_tracks.csv`: 每帧追踪结果
|
|
|
|
## 单视频运行示例
|
|
|
|
```bash
|
|
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
|
|
```
|
|
|
|
如果需要更少漏检,可以增加:
|
|
|
|
```bash
|
|
--rescue-detections --rescue-conf 0.45
|
|
```
|