From 46659c8bb2ce773bb05da78466d28015f570fc12 Mon Sep 17 00:00:00 2001 From: qingqing01 Date: Sat, 19 Dec 2020 09:09:22 +0800 Subject: [PATCH] Rename filename in dygraph/ppdet/modeling and update changelog. (#1935) * Rename dir name in modeling * Update changelog --- docs/CHANGELOG.md | 18 +++++++++++++---- dygraph/docs/tutorials/INSTALL_cn.md | 11 ++-------- dygraph/ppdet/modeling/__init__.py | 20 +++++++++---------- .../__init__.py | 0 .../cascade_rcnn.py | 0 .../faster_rcnn.py | 0 .../mask_rcnn.py | 0 .../meta_arch.py | 0 .../{architecture => architectures}/ssd.py | 0 .../{architecture => architectures}/yolo.py | 0 .../{backbone => backbones}/__init__.py | 0 .../{backbone => backbones}/darknet.py | 0 .../{backbone => backbones}/name_adapter.py | 0 .../{backbone => backbones}/resnet.py | 19 ++++++++++++++++++ .../modeling/{backbone => backbones}/vgg.py | 0 .../modeling/{head => heads}/__init__.py | 0 .../modeling/{head => heads}/bbox_head.py | 20 ------------------- .../modeling/{head => heads}/mask_head.py | 0 .../modeling/{head => heads}/roi_extractor.py | 0 .../modeling/{head => heads}/rpn_head.py | 0 .../modeling/{head => heads}/ssd_head.py | 0 .../modeling/{head => heads}/yolo_head.py | 2 +- .../modeling/{loss => losses}/__init__.py | 0 .../{loss => losses}/iou_aware_loss.py | 0 .../modeling/{loss => losses}/iou_loss.py | 0 .../modeling/{loss => losses}/ssd_loss.py | 0 .../modeling/{loss => losses}/yolo_loss.py | 0 .../modeling/{neck => necks}/__init__.py | 0 dygraph/ppdet/modeling/{neck => necks}/fpn.py | 0 .../modeling/{neck => necks}/yolo_fpn.py | 2 +- 30 files changed, 47 insertions(+), 45 deletions(-) rename dygraph/ppdet/modeling/{architecture => architectures}/__init__.py (100%) rename dygraph/ppdet/modeling/{architecture => architectures}/cascade_rcnn.py (100%) rename dygraph/ppdet/modeling/{architecture => architectures}/faster_rcnn.py (100%) rename dygraph/ppdet/modeling/{architecture => architectures}/mask_rcnn.py (100%) rename dygraph/ppdet/modeling/{architecture => architectures}/meta_arch.py (100%) rename dygraph/ppdet/modeling/{architecture => architectures}/ssd.py (100%) rename dygraph/ppdet/modeling/{architecture => architectures}/yolo.py (100%) rename dygraph/ppdet/modeling/{backbone => backbones}/__init__.py (100%) rename dygraph/ppdet/modeling/{backbone => backbones}/darknet.py (100%) rename dygraph/ppdet/modeling/{backbone => backbones}/name_adapter.py (100%) rename dygraph/ppdet/modeling/{backbone => backbones}/resnet.py (95%) rename dygraph/ppdet/modeling/{backbone => backbones}/vgg.py (100%) rename dygraph/ppdet/modeling/{head => heads}/__init__.py (100%) rename dygraph/ppdet/modeling/{head => heads}/bbox_head.py (94%) rename dygraph/ppdet/modeling/{head => heads}/mask_head.py (100%) rename dygraph/ppdet/modeling/{head => heads}/roi_extractor.py (100%) rename dygraph/ppdet/modeling/{head => heads}/rpn_head.py (100%) rename dygraph/ppdet/modeling/{head => heads}/ssd_head.py (100%) rename dygraph/ppdet/modeling/{head => heads}/yolo_head.py (98%) rename dygraph/ppdet/modeling/{loss => losses}/__init__.py (100%) rename dygraph/ppdet/modeling/{loss => losses}/iou_aware_loss.py (100%) rename dygraph/ppdet/modeling/{loss => losses}/iou_loss.py (100%) rename dygraph/ppdet/modeling/{loss => losses}/ssd_loss.py (100%) rename dygraph/ppdet/modeling/{loss => losses}/yolo_loss.py (100%) rename dygraph/ppdet/modeling/{neck => necks}/__init__.py (100%) rename dygraph/ppdet/modeling/{neck => necks}/fpn.py (100%) rename dygraph/ppdet/modeling/{neck => necks}/yolo_fpn.py (98%) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 944309018..507f803be 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,20 @@ ## 最新版本信息 +### v2.0-beta(12.20/2020) + - 动态图支持: + - 支持Faster-RCNN, Mask-RCNN, FPN, Cascade Faster/Mask RCNN, YOLOv3和SSD模型,试用版本。 + - 模型提升: + - 更新PP-YOLO MobileNetv3 large和small模型,精度提升,并新增裁剪和蒸馏后的模型。 + - 新功能: + - 支持VisualDL可视化数据预处理图片。 + + - Bug修复: + - 修复BlazeFace人脸关键点预测bug。 + + +## 历史版本信息 + ### v0.5.0(11/2020) - 模型丰富度提升: - 发布SOLOv2系列模型,其中SOLOv2-Light-R50-VD-DCN-FPN 模型在单卡V100上达到 38.6 FPS,加速24% ,COCO验证集精度达到38.8%, 提升2.4绝对百分点。 @@ -20,10 +34,6 @@ - 新增目标检测全流程教程,新增Jetson平台部署教程。 - - -## 历史版本信息 - ### v0.4.0(07/2020) - 模型丰富度提升: - 发布PPYOLO模型,COCO数据集精度达到45.2%,单卡V100预测速度达到72.9 FPS,精度和预测速度优于YOLOv4模型。 diff --git a/dygraph/docs/tutorials/INSTALL_cn.md b/dygraph/docs/tutorials/INSTALL_cn.md index 93378ace2..cd88a4e2a 100644 --- a/dygraph/docs/tutorials/INSTALL_cn.md +++ b/dygraph/docs/tutorials/INSTALL_cn.md @@ -3,23 +3,16 @@ --- ## 目录 -- [简介](#简介) - [安装PaddlePaddle](#安装PaddlePaddle) - [其他依赖安装](#其他依赖安装) - [PaddleDetection](#PaddleDetection) -## 简介 - -这份文档介绍了如何安装PaddleDetection及其依赖项(包括PaddlePaddle)。 - -PaddleDetection的相关信息,请参考[README.md](https://github.com/PaddlePaddle/PaddleDetection/blob/master/README.md). - - ## 安装PaddlePaddle **环境需求:** +- paddlepaddle >= 2.0rc1 - OS 64位操作系统 - Python 3(3.5.1+/3.6/3.7),64位版本 - pip/pip3(9.0.1+),64位版本操作系统是 @@ -50,7 +43,7 @@ PaddleDetection的相关信息,请参考[README.md](https://github.com/PaddleP **安装Python依赖库:** -Python依赖库在[requirements.txt](https://github.com/PaddlePaddle/PaddleDetection/blob/master/requirements.txt)中给出,可通过如下命令安装: +Python依赖库在[requirements.txt](../../../requirements.txt)中给出,可通过如下命令安装: ``` pip install -r requirements.txt diff --git a/dygraph/ppdet/modeling/__init__.py b/dygraph/ppdet/modeling/__init__.py index ab7ca0ff1..af37acfda 100644 --- a/dygraph/ppdet/modeling/__init__.py +++ b/dygraph/ppdet/modeling/__init__.py @@ -1,11 +1,11 @@ from . import ops from . import bbox from . import mask -from . import backbone -from . import neck -from . import head -from . import loss -from . import architecture +from . import backbones +from . import necks +from . import heads +from . import losses +from . import architectures from . import post_process from . import layers from . import utils @@ -13,11 +13,11 @@ from . import utils from .ops import * from .bbox import * from .mask import * -from .backbone import * -from .neck import * -from .head import * -from .loss import * -from .architecture import * +from .backbones import * +from .necks import * +from .heads import * +from .losses import * +from .architectures import * from .post_process import * from .layers import * from .utils import * diff --git a/dygraph/ppdet/modeling/architecture/__init__.py b/dygraph/ppdet/modeling/architectures/__init__.py similarity index 100% rename from dygraph/ppdet/modeling/architecture/__init__.py rename to dygraph/ppdet/modeling/architectures/__init__.py diff --git a/dygraph/ppdet/modeling/architecture/cascade_rcnn.py b/dygraph/ppdet/modeling/architectures/cascade_rcnn.py similarity index 100% rename from dygraph/ppdet/modeling/architecture/cascade_rcnn.py rename to dygraph/ppdet/modeling/architectures/cascade_rcnn.py diff --git a/dygraph/ppdet/modeling/architecture/faster_rcnn.py b/dygraph/ppdet/modeling/architectures/faster_rcnn.py similarity index 100% rename from dygraph/ppdet/modeling/architecture/faster_rcnn.py rename to dygraph/ppdet/modeling/architectures/faster_rcnn.py diff --git a/dygraph/ppdet/modeling/architecture/mask_rcnn.py b/dygraph/ppdet/modeling/architectures/mask_rcnn.py similarity index 100% rename from dygraph/ppdet/modeling/architecture/mask_rcnn.py rename to dygraph/ppdet/modeling/architectures/mask_rcnn.py diff --git a/dygraph/ppdet/modeling/architecture/meta_arch.py b/dygraph/ppdet/modeling/architectures/meta_arch.py similarity index 100% rename from dygraph/ppdet/modeling/architecture/meta_arch.py rename to dygraph/ppdet/modeling/architectures/meta_arch.py diff --git a/dygraph/ppdet/modeling/architecture/ssd.py b/dygraph/ppdet/modeling/architectures/ssd.py similarity index 100% rename from dygraph/ppdet/modeling/architecture/ssd.py rename to dygraph/ppdet/modeling/architectures/ssd.py diff --git a/dygraph/ppdet/modeling/architecture/yolo.py b/dygraph/ppdet/modeling/architectures/yolo.py similarity index 100% rename from dygraph/ppdet/modeling/architecture/yolo.py rename to dygraph/ppdet/modeling/architectures/yolo.py diff --git a/dygraph/ppdet/modeling/backbone/__init__.py b/dygraph/ppdet/modeling/backbones/__init__.py similarity index 100% rename from dygraph/ppdet/modeling/backbone/__init__.py rename to dygraph/ppdet/modeling/backbones/__init__.py diff --git a/dygraph/ppdet/modeling/backbone/darknet.py b/dygraph/ppdet/modeling/backbones/darknet.py similarity index 100% rename from dygraph/ppdet/modeling/backbone/darknet.py rename to dygraph/ppdet/modeling/backbones/darknet.py diff --git a/dygraph/ppdet/modeling/backbone/name_adapter.py b/dygraph/ppdet/modeling/backbones/name_adapter.py similarity index 100% rename from dygraph/ppdet/modeling/backbone/name_adapter.py rename to dygraph/ppdet/modeling/backbones/name_adapter.py diff --git a/dygraph/ppdet/modeling/backbone/resnet.py b/dygraph/ppdet/modeling/backbones/resnet.py similarity index 95% rename from dygraph/ppdet/modeling/backbone/resnet.py rename to dygraph/ppdet/modeling/backbones/resnet.py index 6de676808..a1d6d6a4d 100755 --- a/dygraph/ppdet/modeling/backbone/resnet.py +++ b/dygraph/ppdet/modeling/backbones/resnet.py @@ -26,6 +26,8 @@ from paddle.regularizer import L2Decay from .name_adapter import NameAdapter from numbers import Integral +__all__ = ['ResNet', 'Res5Head'] + class ConvNormLayer(nn.Layer): def __init__(self, @@ -317,3 +319,20 @@ class ResNet(nn.Layer): if idx in self.return_idx: outs.append(x) return outs + + +@register +class Res5Head(nn.Layer): + def __init__(self, feat_in=1024, feat_out=512): + super(Res5Head, self).__init__() + na = NameAdapter(self) + self.res5_conv = [] + self.res5 = self.add_sublayer( + 'res5_roi_feat', + Blocks( + feat_in, feat_out, count=3, name_adapter=na, stage_num=5)) + self.feat_out = feat_out * 4 + + def forward(self, roi_feat, stage=0): + y = self.res5(roi_feat) + return y diff --git a/dygraph/ppdet/modeling/backbone/vgg.py b/dygraph/ppdet/modeling/backbones/vgg.py similarity index 100% rename from dygraph/ppdet/modeling/backbone/vgg.py rename to dygraph/ppdet/modeling/backbones/vgg.py diff --git a/dygraph/ppdet/modeling/head/__init__.py b/dygraph/ppdet/modeling/heads/__init__.py similarity index 100% rename from dygraph/ppdet/modeling/head/__init__.py rename to dygraph/ppdet/modeling/heads/__init__.py diff --git a/dygraph/ppdet/modeling/head/bbox_head.py b/dygraph/ppdet/modeling/heads/bbox_head.py similarity index 94% rename from dygraph/ppdet/modeling/head/bbox_head.py rename to dygraph/ppdet/modeling/heads/bbox_head.py index 8fbb38029..d3cdb73bd 100644 --- a/dygraph/ppdet/modeling/head/bbox_head.py +++ b/dygraph/ppdet/modeling/heads/bbox_head.py @@ -22,9 +22,6 @@ from paddle.regularizer import L2Decay from ppdet.core.workspace import register from ppdet.modeling import ops -from ..backbone.name_adapter import NameAdapter -from ..backbone.resnet import Blocks - @register class TwoFCHead(nn.Layer): @@ -80,23 +77,6 @@ class TwoFCHead(nn.Layer): return fc7_relu -@register -class Res5Head(nn.Layer): - def __init__(self, feat_in=1024, feat_out=512): - super(Res5Head, self).__init__() - na = NameAdapter(self) - self.res5_conv = [] - self.res5 = self.add_sublayer( - 'res5_roi_feat', - Blocks( - feat_in, feat_out, count=3, name_adapter=na, stage_num=5)) - self.feat_out = feat_out * 4 - - def forward(self, roi_feat, stage=0): - y = self.res5(roi_feat) - return y - - @register class BBoxFeat(nn.Layer): __inject__ = ['roi_extractor', 'head_feat'] diff --git a/dygraph/ppdet/modeling/head/mask_head.py b/dygraph/ppdet/modeling/heads/mask_head.py similarity index 100% rename from dygraph/ppdet/modeling/head/mask_head.py rename to dygraph/ppdet/modeling/heads/mask_head.py diff --git a/dygraph/ppdet/modeling/head/roi_extractor.py b/dygraph/ppdet/modeling/heads/roi_extractor.py similarity index 100% rename from dygraph/ppdet/modeling/head/roi_extractor.py rename to dygraph/ppdet/modeling/heads/roi_extractor.py diff --git a/dygraph/ppdet/modeling/head/rpn_head.py b/dygraph/ppdet/modeling/heads/rpn_head.py similarity index 100% rename from dygraph/ppdet/modeling/head/rpn_head.py rename to dygraph/ppdet/modeling/heads/rpn_head.py diff --git a/dygraph/ppdet/modeling/head/ssd_head.py b/dygraph/ppdet/modeling/heads/ssd_head.py similarity index 100% rename from dygraph/ppdet/modeling/head/ssd_head.py rename to dygraph/ppdet/modeling/heads/ssd_head.py diff --git a/dygraph/ppdet/modeling/head/yolo_head.py b/dygraph/ppdet/modeling/heads/yolo_head.py similarity index 98% rename from dygraph/ppdet/modeling/head/yolo_head.py rename to dygraph/ppdet/modeling/heads/yolo_head.py index 2814fb3b0..d14dc5a3f 100644 --- a/dygraph/ppdet/modeling/head/yolo_head.py +++ b/dygraph/ppdet/modeling/heads/yolo_head.py @@ -4,7 +4,7 @@ import paddle.nn.functional as F from paddle import ParamAttr from paddle.regularizer import L2Decay from ppdet.core.workspace import register -from ..backbone.darknet import ConvBNLayer +from ..backbones.darknet import ConvBNLayer @register diff --git a/dygraph/ppdet/modeling/loss/__init__.py b/dygraph/ppdet/modeling/losses/__init__.py similarity index 100% rename from dygraph/ppdet/modeling/loss/__init__.py rename to dygraph/ppdet/modeling/losses/__init__.py diff --git a/dygraph/ppdet/modeling/loss/iou_aware_loss.py b/dygraph/ppdet/modeling/losses/iou_aware_loss.py similarity index 100% rename from dygraph/ppdet/modeling/loss/iou_aware_loss.py rename to dygraph/ppdet/modeling/losses/iou_aware_loss.py diff --git a/dygraph/ppdet/modeling/loss/iou_loss.py b/dygraph/ppdet/modeling/losses/iou_loss.py similarity index 100% rename from dygraph/ppdet/modeling/loss/iou_loss.py rename to dygraph/ppdet/modeling/losses/iou_loss.py diff --git a/dygraph/ppdet/modeling/loss/ssd_loss.py b/dygraph/ppdet/modeling/losses/ssd_loss.py similarity index 100% rename from dygraph/ppdet/modeling/loss/ssd_loss.py rename to dygraph/ppdet/modeling/losses/ssd_loss.py diff --git a/dygraph/ppdet/modeling/loss/yolo_loss.py b/dygraph/ppdet/modeling/losses/yolo_loss.py similarity index 100% rename from dygraph/ppdet/modeling/loss/yolo_loss.py rename to dygraph/ppdet/modeling/losses/yolo_loss.py diff --git a/dygraph/ppdet/modeling/neck/__init__.py b/dygraph/ppdet/modeling/necks/__init__.py similarity index 100% rename from dygraph/ppdet/modeling/neck/__init__.py rename to dygraph/ppdet/modeling/necks/__init__.py diff --git a/dygraph/ppdet/modeling/neck/fpn.py b/dygraph/ppdet/modeling/necks/fpn.py similarity index 100% rename from dygraph/ppdet/modeling/neck/fpn.py rename to dygraph/ppdet/modeling/necks/fpn.py diff --git a/dygraph/ppdet/modeling/neck/yolo_fpn.py b/dygraph/ppdet/modeling/necks/yolo_fpn.py similarity index 98% rename from dygraph/ppdet/modeling/neck/yolo_fpn.py rename to dygraph/ppdet/modeling/necks/yolo_fpn.py index bd4906997..c7bfe9f48 100644 --- a/dygraph/ppdet/modeling/neck/yolo_fpn.py +++ b/dygraph/ppdet/modeling/necks/yolo_fpn.py @@ -17,7 +17,7 @@ import paddle.nn as nn import paddle.nn.functional as F from paddle import ParamAttr from ppdet.core.workspace import register, serializable -from ..backbone.darknet import ConvBNLayer +from ..backbones.darknet import ConvBNLayer class YoloDetBlock(nn.Layer): -- GitLab