language: cn
model_unique_abbr: YOLO
version: 1.0
identification:
  docker_image_name: yolo:1.0
  model_name: YOLO
  semantic: YOLO
  description: 通过深度学习的方法对图像中的目标进行检测
  category_application: 预测型
  category_data:
  - 图像数据
  keywords:
  - 目标检测
  - 对象识别
parameter_info:
  parameters:
  - arg_name: -mode
    param_type: param
    name: 任务模式
    description: 模型的任务模式
    data_type: enum
    data_semantic: Task Mode
    specification:
      enum:
        - detect

  - arg_name: -weights
    param_type: input_data
    name: 网络权重
    description: 检测任务的权重文件
    data_type: str
    data_semantic: Network Weights
    specification:
      default: yolov7.pt

  - arg_name: -source
    param_type: input_data
    name: 数据路径
    description: 待检测数据路径，为图像、视频文件夹路径或摄像头接口
    data_type: str
    data_semantic: Data Source

  - arg_name: -img-size
    param_type: param
    name: 图像尺寸
    description: 模型在检测图片前会把图像裁剪成指定尺寸
    is_required: false
    data_type: int
    data_semantic: Image Size
    specification:
      default: 640
      range:
        - "(0,)"

  - arg_name: -conf-thres
    param_type: param
    name: 置信度阈值
    description: 置信度大于该值的目标被检测出
    data_type: float
    data_semantic: Confidence Threshold
    specification:
      default: 0.25
      range:
        - "[0,1]"

  - arg_name: -iou-thres
    param_type: param
    name: 交并比阈值
    description: 交并比的阈值，用于NMS算法确认目标唯一检测框
    data_type: float
    data_semantic: IOU Threshold
    specification:
      default: 0.25
      range:
        - "[0,1]"

  - arg_name: -device
    param_type: param
    name: 设备
    description: 指定所使用的设备，可如“cpu”或“cuda:0”
    data_type: str
    data_semantic: Device

  - arg_name: -save-txt
    param_type: param
    name: 保存txt文件
    description: 是否保存测试之后的txt标签文件
    is_required: false
    data_type: bool
    data_semantic: Save TXT File

  - arg_name: -save-conf
    param_type: param
    name: 保存置信度结果
    description: 在txt中是否保存测试置信度结果大小
    is_required: false
    data_type: bool
    data_semantic: Save Confidence

  - arg_name: -nosave
    param_type: param
    name: 不保存结果
    description: 是否保存检测的图片、视频或训练的最后一轮权重pt文件
    is_required: false
    data_type: bool
    data_semantic: Do Not Save Images/Videos or Model

  - arg_name: -classes
    param_type: param
    name: 类别过滤
    description: 用于过滤检测类别, 通过 --class 0 或 --class 0 2 3 使用
    is_required: false
    data_type: str
    data_semantic: Filter by Class

  - arg_name: -agnostic-nms
    param_type: param
    name: 不可知非极大值抑制
    description: 启用不可知非极大值抑制来对检测目标生成唯一框
    is_required: false
    data_type: bool
    data_semantic: Agnostic Non-maximum Suppression

  - arg_name: -augment
    param_type: param
    name: 增强推理
    description: 启用增强推理，强化目标检测效果
    is_required: false
    data_type: bool
    data_semantic: Augmented Inference

  - arg_name: -project
    param_type: output_data
    name: 结果路径
    description: 预测结果的输出路径
    data_type: str
    data_semantic: Save Results to Project

  - arg_name: -batch-size
    param_type: param
    name: 批次大小
    description: 每批次的输入数据量
    data_type: int
    data_semantic: Batch Size
    specification:
      default: 16
      range:
        - "[1,]"

  - arg_name: -noautoanchor
    param_type: param
    name: 禁用自动锚框
    description: 是否禁用自动锚框；默认是开启的，可以简化训练过程
    is_required: false
    data_type: bool
    data_semantic: Disable Autoanchor Check

  - arg_name: -workers
    param_type: param
    name: 工作线程
    description: 指数据装载时CPU所使用的线程数，默认为8
    data_type: int
    data_semantic: Workers
    specification:
      default: 8
      range:
        - "(0,)"

  - arg_name: -adam
    param_type: param
    name: Adam优化器
    description: 选用Adam优化器
    is_required: false
    data_type: bool
    data_semantic: Adam Optimizer

  - arg_name: -save-json
    param_type: param
    name: 保存json文件
    description: 是否按照COCO的json格式保存预测框，并且使用COCO API做评估
    is_required: false
    data_type: bool
    data_semantic: Save JSON File

application:
  domain: 目标检测
  objective: 依据先验信息对影像数据指定目标的检测
  mechanism: YOLO将图像划分为网格，每个网格负责预测包含在其范围内的目标。对于每个网格，模型生成多个边界框和相应的置信度分数，以及每个边界框对应的类别概率。通过非极大值抑制（NMS），去除冗余的边界框，最终输出检测到的目标及其位置。
operation:
  usage: 在命令行中用代码指定训练数据路径，待预测数据路径，训练轮次，训练结果模型路径，分类结果路径，完成算法运行。
  exec_example:
  - docker run -v $(pwd):/data yolo:1.0 --mode detect --weight src/yolov7.pt --source /data/inference/images --project /data/inference/result
  output_display:
  - 将预测得到的图像文件显示在前端页面中
  license:
  - BSD-3-Clause
  - MIT
  - HPND
technique:
  language:
  - Python
  os:
  - Linux
  - Windows
  hardware:
  - GPU
  dependencies:
  - name: python
    version: 3.8
  - name: numpy
    version: 1.18.5
  - name: opencv-contrib-python
    version: 4.1.2.30
  - name: pillow
    version: 7.2.0
  - name: tqdm
    version: 4.47.0
  - name: cuda
    version: 11.6.2
  - name: cudnn
    version: 8
source:
  maintainer: Shan Huang
  organization: Beijing University of Civil Engineering and Architecture
  contact: 1035305483@qq.com
  references:
  - "C. -Y. Wang, A. Bochkovskiy and H. -Y. M. Liao, YOLOv7: Trainable Bag-of-Freebies Sets New State-of-the-Art for Real-Time Object Detectors, 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada, 2023, pp. 7464-7475, doi: 10.1109/CVPR52729.2023.00721."
