文件最后提交记录最后更新时间
init 4 年前
init 4 年前
init 4 年前
!4671 【fix】批量修改模型python版本,兼容环境上的python3.8版本 * fix python version 3 年前
init 4 年前
init 4 年前
modify readme 3 年前
modify readme 3 年前
fix link validity Co-authored-by: frozenleaves<914814442@qq.com> # message auto-generated for no-merge-commit merge: !7517 merge master into master fix link validity Created-by: frozenn Commit-by: frozenleaves Merged-by: ascend-robot Description: ## Motivation Please describe the motivation of this PR and the goal you want to achieve through this PR. ## Modification Please briefly describe what modification is made in this PR. ## Self-test (Optional) If modifications to this PR may cause/fix function/accuracy/performance DTSs/issues, a self-inspection record needs to be attached. ## BC-breaking (Optional) If there are compatibility issues, such as dependencies on cann/torch_npu versions, they need to be explained in the PR. ## Checklist **Before PR**: - [ ] The new code needs to comply with the Clean Code specification. - [ ] The PR content is self-checked, and the expression can be clear and the writing standardized **After PR**: - [ ] CLA has been signed and all committers have signed the CLA in this PR. - [ ] The ci-pipeline is passed, Code Check is passed. See merge request: Ascend/ModelZoo-PyTorch!75171 个月前
fix link validity Co-authored-by: frozenleaves<914814442@qq.com> # message auto-generated for no-merge-commit merge: !7517 merge master into master fix link validity Created-by: frozenn Commit-by: frozenleaves Merged-by: ascend-robot Description: ## Motivation Please describe the motivation of this PR and the goal you want to achieve through this PR. ## Modification Please briefly describe what modification is made in this PR. ## Self-test (Optional) If modifications to this PR may cause/fix function/accuracy/performance DTSs/issues, a self-inspection record needs to be attached. ## BC-breaking (Optional) If there are compatibility issues, such as dependencies on cann/torch_npu versions, they need to be explained in the PR. ## Checklist **Before PR**: - [ ] The new code needs to comply with the Clean Code specification. - [ ] The PR content is self-checked, and the expression can be clear and the writing standardized **After PR**: - [ ] CLA has been signed and all committers have signed the CLA in this PR. - [ ] The ci-pipeline is passed, Code Check is passed. See merge request: Ascend/ModelZoo-PyTorch!75171 个月前
init 4 年前
init 4 年前
init 4 年前
fix link validity Co-authored-by: frozenleaves<914814442@qq.com> # message auto-generated for no-merge-commit merge: !7517 merge master into master fix link validity Created-by: frozenn Commit-by: frozenleaves Merged-by: ascend-robot Description: ## Motivation Please describe the motivation of this PR and the goal you want to achieve through this PR. ## Modification Please briefly describe what modification is made in this PR. ## Self-test (Optional) If modifications to this PR may cause/fix function/accuracy/performance DTSs/issues, a self-inspection record needs to be attached. ## BC-breaking (Optional) If there are compatibility issues, such as dependencies on cann/torch_npu versions, they need to be explained in the PR. ## Checklist **Before PR**: - [ ] The new code needs to comply with the Clean Code specification. - [ ] The PR content is self-checked, and the expression can be clear and the writing standardized **After PR**: - [ ] CLA has been signed and all committers have signed the CLA in this PR. - [ ] The ci-pipeline is passed, Code Check is passed. See merge request: Ascend/ModelZoo-PyTorch!75171 个月前
init 4 年前
init 4 年前
README.md

Pyramidbox for PyTorch

概述

简述

Pyramidbox提出一种基于anchor的环境辅助方法PyramidAnchors,从而引入有监督的信息来为较小的、模糊的和部分遮挡的目标学习环境特征,并设计了LFPNContext-Sensitive的架构,更好地融合环境特征和目标特征,从融合特征中更好处理不同尺度的目标。

  • 参考实现:

    url=https://github.com/yxlijun/Pyramidbox.pytorch
    commit_id=76cf3558ef09bf27df15d960f478b7e5b4a6a673
    
  • 适配昇腾 AI 处理器的实现:

    url=https://gitcode.com/ascend/ModelZoo-PyTorch.git
    code_path=PyTorch/contrib/cv/detection
    

训练环境

环境

  • 当前模型支持的 PyTorch 版本和已知三方库依赖如下表所示。

    表 1 版本支持表

    Torch_Version 三方库依赖版本
    PyTorch 1.5 torchvision==0.2.2.post3;pillow==8.4.0
    PyTorch 1.8 torchvision==0.9.1;pillow==9.1.0
  • 环境 指导。

    请参考《Pytorch框架训练环境 》。

  • 安装依赖。

    在模型源码包根目录下执行命令,安装模型对应PyTorch版本需要的依赖。

    pip install -r 1.5_requirements.txt  # PyTorch1.5版本
    pip install -r 1.8_requirements.txt  # PyTorch1.8版本
    

    说明: 只需执行一条对应的PyTorch版本依赖安装命令。

数据集

  1. 获取数据集。

    用户自行获取原始数据集,可选用的开源数据集包括WIDER_FACE等, 在项目根目录下创建WIDER_FACE目录,存放数据集。

     # $Pyramidbox 是项目根目录
     $Pyramidbox/WIDER_FACE
    

    以WIDER_FACE数据集为例,数据集目录结构参考如下所示。

     |-WIDER_FACE
     	|-wider_face_split
     		|-wider_face_test.mat
     		|-wider_face_test_filelist.txt
     		|-wider_face_train.mat
     		|-wider_face_train_bbx_gt.txt
     		|-wider_face_val.mat
     		|-wider_face_val_bbx_gt.txt
     	|-WIDER_train
     		|-images
     			|-0--Parade
     			|-1--Handshaking
     			...
     	|-WIDER_val
     		|-images
     			|-0--Parade
     			|-1--Handshaking
     			...
    

    说明: 该数据集的训练过程脚本只作为一种参考示例。

  2. 数据预处理。

    运行prepare_wider_data.py:

    python prepare_wider_data.py --data_path='数据集路径'
    

获取预训练模型

参照原代码仓README下载vgg权重,放在weights目录下。

  |-Pyramidbox
    |-weights
      |-vgg16_reducedfc.pth

开始训练

训练模型

  1. 进入解压后的源码包根目录。

    cd /${模型文件夹名称}
    
  2. 运行训练脚本。

    该模型支持单机单卡训练和单机8卡训练。

    • 单机单卡训练

      启动单卡训练。

      bash ./test/train_performance_1p.sh --data_path=/data/xxx/  # 单卡性能
      
    • 单机8卡训练

      启动8卡训练。

      bash ./test/train_full_8p.sh --data_path=/data/xxx/  # 8卡精度
      
      bash ./test/train_performance_8p.sh --data_path=/data/xxx/  # 8卡性能
      

    --data_path参数填写数据集路径,需写到数据集的一级目录。

    模型训练脚本参数说明如下。

    公共参数:
    --batch-size                        //训练批次大小
    --performance                       //是否执行性能模式
    --lr                                //初始学习率
    多卡训练参数:
    --multinpu                          //是否使用多卡训练
    --world_size                        //训练卡数量
    --device-list '0,1,2,3,4,5,6,7'     //多卡训练指定训练用卡
    

    训练完成后,权重文件保存在当前路径下,并输出模型训练精度和性能信息。

训练结果展示

表 2 训练结果展示表

NAME AP FPS Epochs AMP_Type Torch_Version
1p-竞品V - - 1 - 1.5
8p-竞品V x - 100 - 1.5
1p-NPU - - 1 O2 1.8
8p-NPU Easy: 0.9519612346942784;Medium: 0.9446576258551937;Hard: 0.9053749943031708 xxx 100 O2 1.8

版本说明

变更

2020.10.14:更新内容,重新发布。

2020.07.08:首次发布。

FAQ

无。

公网地址说明

代码涉及公网地址参考 public_address_statement.md