language: cn
model_unique_abbr: DEEPLABV3PLUS
version: 1.0
identification:
  docker_image_name: deeplabv3plus:1.0
  model_name: DEEPLABV3PLUS
  semantic: DEEPLABV3PLUS
  description: 通过深度学习的方法对图像中的目标进行语义分割
  category_application: 预测型
  category_data:
  - 图像数据
  keywords:
  - 语义分割
  - 建筑提取
parameter_info:
  parameters:
  - arg_name: mode
    is_single_en_dash: false
    param_type: param
    name: 任务模式
    description: 模型的任务模式，选择all即可
    data_type: enum
    data_semantic: Task Mode
    specification:
      default: all
      enum: ['train', 'inference', 'all']

  - arg_name: root_path
    is_single_en_dash: false
    param_type: input_data
    name: 训练数据集路径
    description: 训练数据集的路径
    data_type: str
    data_semantic: training data dir
    specification:
      default: None

  - arg_name: backbone
    is_single_en_dash: false
    param_type: param
    name: 骨干网络
    description: 模型的骨干网络（可选'resnet', 'xception', 'drn', 'mobilenet'）
    data_type: enum
    data_semantic: Backbone Name
    specification:
      default: resnet
      enum: ['resnet', 'xception', 'drn', 'mobilenet']

  - arg_name: out-stride
    is_single_en_dash: false
    param_type: param
    name: 输出步幅
    description: 输入图像的空间分辨率和输出特征图的空间分辨率的比值，范围：[1,  ]
    data_type: int
    data_semantic: Out Stride
    specification:
      default: 16
      range:
        - \[1,]

  - arg_name: dataset
    is_single_en_dash: false
    param_type: param
    name: 数据集类型
    description: 训练使用的数据集，选择own即可
    is_required: True
    data_type: enum
    data_semantic: Dataset
    specification:
      default: own
      enum: ['pascal', 'coco', 'cityscapes', 'own']

  - arg_name: num_class
    is_single_en_dash: false
    param_type: param
    name: 类别数目
    description: 数据集的类别数目，范围： [2,  ]
    data_type: int
    data_semantic: number of class
    specification:
      default: 2
      range:
        - \[2,]

  - arg_name: out-stride
    is_single_en_dash: false
    param_type: param
    name: 输出步幅
    description: 输入图像的空间分辨率和输出特征图的空间分辨率的比值，范围： [1,   ]
    data_type: int
    data_semantic: Out Stride
    specification:
      default: 16
      range:
        - \[1,]


  - arg_name: output_dir
    is_single_en_dash: false
    param_type: output_data
    name: 模型路径
    description: 储存模型和训练参数等文件的位置
    data_type: str
    data_semantic: Output Directory

  - arg_name: filename
    is_single_en_dash: false
    param_type: param
    name: 输出模型名
    description: 设置输出模型的文件名，建议默认为‘checkpoint.pth.tar’
    is_required: false
    data_type: str
    data_semantic: Model Filename
    specification:
      default: checkpoint.pth.tar

  - arg_name: workers
    is_single_en_dash: false
    param_type: param
    name: 线程数
    description: 读取数据的线程数，范围：[0,  ]
    data_type: int
    data_semantic: dataloader threads
    specification:
      default: 4
      range:
        - \[0,]


  - arg_name: base-size
    is_single_en_dash: false
    param_type: param
    name: 基础尺寸
    description: 基础图象尺寸，范围：(0,   )，推荐512
    data_type: int
    data_semantic: base image size
    specification:
      default: 512
      range:
        - (0,)


  - arg_name: crop-size
    is_single_en_dash: false
    param_type: param
    name: 裁剪尺寸
    description: 图像裁剪尺寸，范围：(0,  )，推荐512
    data_type: int
    data_semantic: crop image size
    specification:
      default: 512
      range:
      - (0,)

  - arg_name: loss-type
    is_single_en_dash: false
    param_type: param
    name: 损失类型
    description: 使用损失函数的类型（'ce', 'focal'），推荐默认ce
    data_type: enum
    data_semantic: loss func type
    specification:
      default: ce
      enum: ['ce', 'focal']

  - arg_name: epochs
    is_single_en_dash: false
    param_type: param
    name: 训练轮次
    description: 模型训练轮次, 范围：(0,  )
    data_type: int
    data_semantic: number of epochs to train
    specification:
      default: 3
      range:
        - (0,)

  - arg_name: start_epoch
    is_single_en_dash: false
    param_type: param
    name: 训练开始轮次
    description: 模型训练开始轮次，推荐0
    data_type: int
    data_semantic: start epochs (default:0)
    specification:
      default: 0
      range:
        - \[0,)

  - arg_name: batch-size
    is_single_en_dash: false
    param_type: param
    name: 批次大小
    description: 每次投入训练的批次大小，范围：[1,   )，推荐默认4
    data_type: int
    data_semantic: input batch size for training
    specification:
      default: 4
      range:
        - \[1,)

  - arg_name: test-batch-size
    is_single_en_dash: false
    param_type: param
    name: 测试批次大小
    description: 每次投入测试的批次大小，范围：[1,)，推荐默认1
    data_type: int
    data_semantic: input batch size for testing
    specification:
      default: 1
      range:
        - \[1,)

  - arg_name: lr
    is_single_en_dash: false
    param_type: param
    name: 学习率
    description: 学习率，范围：(0,  )，推荐默认0.001
    data_type: float
    data_semantic: learning rate
    specification:
      default: 0.001
      range:
        - (0,)

  - arg_name: lr-scheduler
    is_single_en_dash: false
    param_type: param
    name: 学习率更新函数
    description: 使用的学习率更新函数（'poly', 'step', 'cos'），推荐poly
    data_type: enum
    data_semantic: lr scheduler mode
    specification:
      default: poly
      enum: ['poly', 'step', 'cos']


  - arg_name: momentum
    is_single_en_dash: false
    param_type: param
    name: 动量
    description: 动量优化算法参数，范围 ：[0,1)，推荐默认0.9
    data_type: float
    data_semantic: momentum
    specification:
      default: 0.9
      range:
        - \[0,1)

  - arg_name: weight-decay
    is_single_en_dash: false
    param_type: param
    name: 权重衰减
    description: 权重衰减，范围：[0,1)，推荐默认0.0005
    data_type: float
    data_semantic: weight decay
    specification:
      default: 0.0005
      range:
        - \[0,1)

  - arg_name: gpu-ids
    is_single_en_dash: false
    param_type: param
    name: GPU序号
    description: 使用指定GPU训练模型，必须是逗号分隔的整数列表
    data_type: str
    data_semantic: use which gpu to train, must be a comma-separated list of integers only
    specification:
      default: 0

  - arg_name: seed
    is_single_en_dash: false
    param_type: param
    name: 随机种子
    description: 随机种子，增加模型随机性，范围：[0,  )，推荐默认1
    data_type: int
    data_semantic: random seed
    specification:
      default: 1
      range:
        - \[0,)

  - arg_name: checkname
    is_single_en_dash: false
    param_type: param
    name: 检查点名
    description: 设置检查点名，默认即可
    is_required: false
    data_type: str
    data_semantic: set the checkpoint name
    specification:
      default: checkname

  - arg_name: eval-interval
    is_single_en_dash: false
    param_type: param
    name: 评估间隔
    description: 进行模型评估的间隔，范围：[1,  )
    data_type: int
    data_semantic: random seed
    specification:
      default: 1
      range:
        - \[1,)

  - arg_name: data_path
    is_single_en_dash: false
    param_type: input_data
    name: 待推测数据路径
    description: 待推测数据路径
    data_type: str
    data_semantic: the inference data directory
    specification:
      default: None

  - arg_name: save_path
    is_single_en_dash: false
    param_type: output_data
    name: 推测结果输出路径
    description: 推测结果输出路径
    data_type: str
    data_semantic: random seed
    specification:
      default: None

application:
  domain: 语义分割
  objective: 依据先验信息对影像数据进行图像分割
  mechanism: 网络由不同模块组成，输入数据经过模块计算后得到图像每个像素所属类别，最后输出图像分割结果。
operation:
  usage: 在命令行中用代码指定训练数据路径，待预测数据路径，训练轮次，训练结果模型路径，分类结果路径，完成算法运行。
  exec_example:
  - python DeepLabV3PLUS.py --mode train --root_path /data/deeplabv3+/data_sub/ --output_dir /data/deeplabv3+/run --epochs 5
  - python DeepLabV3PLUS.py --mode inference --data_path /data/deeplabv3+/data_sub/val/image --save_path /data/result --model /data/deeplabv3+/run/own/checkname/model_best.pth.tar
  output_display:
  - 将预测得到的图像文件显示在前端页面中
  license:
  - BSD-3-Clause
  - MIT
  - HPND
technique:
  language:
  - Python
  os:
  - Linux
  - Windows
  hardware:
  - GPU
  dependencies:
  - name: python
    version: 3.8
  - name: pytorch
    version: 1.12.1
  - name: torchvision
    version: 0.13.1
  - 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
  - name: cudnn
    version: 8
source:
  maintainer: Shan Huang
  organization: Beijing University of Civil Engineering and Architecture
  contact: 1035305483@qq.com
  references:
  - "Rumelhart, D. E., Hinton, G., Williams, R. J. 1986. Learning representations by back-propagating errors. Nature, 323(6088): 533–536."
