无人机探测模型性能测试工具

Hannnk 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
.idea 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
.vscode 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
Data 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
__pycache__ 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
false_positive 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
output_20250329_140816_results 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
.gitignore 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
README.md 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
ali_image_validation.py 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
analysis_report.py 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
bbox_visualizer.py 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
detection_visualizer.py 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
evaluation.txt 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
false_positive_features.pkl 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
feature_extractor.py 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
hotspot_analyzer.py 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
image_validation.py 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
inference.py 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
onnx_check.py 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
report_generator.py 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
split_dataset.py 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines
update_labels.py 2264ad142d feat: 添加ONNX模型推理工具及误报过滤功能 il y a 3 semaines

README.md

无人机检测 ONNX 模型推理工具

项目概述

基于ONNX Runtime的无人机目标检测解决方案,支持:

  • GPU加速推理(需CUDA环境)
  • 自适应图像预处理流水线(CPU/GPU双模式)
  • 误报过滤机制(ORB特征匹配)
  • 多格式检测报告生成(CSV/Excel)

环境要求

  • Python 3.8+
  • 依赖库:

    onnxruntime-gpu==1.16.0
    opencv-python==4.8.0
    numpy==1.24.3
    tqdm==4.66.1
    openpyxl==3.1.2
    

快速开始

# 安装依赖
pip install -r requirements.txt

# 单张图片检测
python inference.py --input test.jpg --threshold 0.5 \
    --output results --report excel

# 批量检测目录
python inference.py --input UAV/ --max-bbox-ratio 0.1 \
    --output batch_results --report all

参数说明

参数 类型 默认值 说明
--input path 必填 输入图像路径/目录
--threshold float 0.45 检测置信度阈值
--max-bbox-ratio float 0.05 最大检测框面积比例
--output path 自动生成 输出目录(自动创建)
--report [csv/excel/all] excel 报告格式
--save-empty flag False 保存无检测结果的图像

结果输出

输出目录包含:

  • 目标截图/:检测到的无人机目标截图
  • 检测报告.xlsx:包含检测时间、置信度、坐标等详细信息
  • 带检测框的标注图像

模型管理

模型版本通过文件名自动识别(如:UAV-250321.onnx 版本号为250321)

常见问题

Q: 如何启用GPU加速? A: 确保安装onnxruntime-gpu并配置CUDA环境,程序会自动优先使用GPU

Q: 误报特征库如何更新? A: 将误报样本放入false_positive目录,程序启动时会自动加载