Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
ae1b479c
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ae1b479c
编写于
4月 02, 2021
作者:
F
Feng Ni
提交者:
GitHub
4月 02, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
comments for architectures post_process and data source (#2473)
上级
b174b027
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
207 addition
and
85 deletion
+207
-85
configs/cascade_rcnn/README.md
configs/cascade_rcnn/README.md
+2
-2
configs/dcn/README.md
configs/dcn/README.md
+11
-11
configs/faster_rcnn/README.md
configs/faster_rcnn/README.md
+14
-14
configs/hrnet/README.md
configs/hrnet/README.md
+2
-2
configs/mask_rcnn/README.md
configs/mask_rcnn/README.md
+10
-10
ppdet/data/source/category.py
ppdet/data/source/category.py
+2
-0
ppdet/data/source/coco.py
ppdet/data/source/coco.py
+11
-0
ppdet/data/source/dataset.py
ppdet/data/source/dataset.py
+12
-0
ppdet/data/source/voc.py
ppdet/data/source/voc.py
+1
-0
ppdet/data/source/widerface.py
ppdet/data/source/widerface.py
+4
-2
ppdet/metrics/coco_utils.py
ppdet/metrics/coco_utils.py
+7
-9
ppdet/metrics/map_utils.py
ppdet/metrics/map_utils.py
+6
-5
ppdet/modeling/architectures/cascade_rcnn.py
ppdet/modeling/architectures/cascade_rcnn.py
+12
-0
ppdet/modeling/architectures/faster_rcnn.py
ppdet/modeling/architectures/faster_rcnn.py
+10
-7
ppdet/modeling/architectures/mask_rcnn.py
ppdet/modeling/architectures/mask_rcnn.py
+13
-6
ppdet/modeling/backbones/hrnet.py
ppdet/modeling/backbones/hrnet.py
+46
-2
ppdet/modeling/necks/hrfpn.py
ppdet/modeling/necks/hrfpn.py
+1
-1
ppdet/modeling/post_process.py
ppdet/modeling/post_process.py
+43
-14
未找到文件。
configs/cascade_rcnn/README.md
浏览文件 @
ae1b479c
...
...
@@ -4,8 +4,8 @@
| 骨架网络 | 网络类型 | 每张GPU图片个数 | 学习率策略 |推理时间(fps) | Box AP | Mask AP | 下载 | 配置文件 |
| :------------------- | :------------- | :-----: | :-----: | :------------: | :-----: | :-----: | :-----------------------------------------------------: | :-----: |
| ResNet50-FPN | Cascade Faster | 1 | 1x | ---- | 41.1 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/cascade_rcnn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/cascade_rcnn/cascade_rcnn_r50_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Cascade Mask | 1 | 1x | ---- | 41.8 | 36.3 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/cascade_mask_rcnn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/cascade_rcnn/cascade_mask_rcnn_r50_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Cascade Faster | 1 | 1x | ---- | 41.1 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/cascade_rcnn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/cascade_rcnn/cascade_rcnn_r50_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Cascade Mask | 1 | 1x | ---- | 41.8 | 36.3 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/cascade_mask_rcnn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/cascade_rcnn/cascade_mask_rcnn_r50_fpn_1x_coco.yml
)
|
**注意:**
Cascade R-CNN模型精度依赖Paddle develop分支修改,精度复现须使用
[
每日版本
](
https://www.paddlepaddle.org.cn/documentation/docs/zh/install/Tables.html#whl-dev
)
或2.0.1版本(将于2021.03发布),使用Paddle 2.0.0版本会有少量精度损失。
...
...
configs/dcn/README.md
浏览文件 @
ae1b479c
...
...
@@ -2,17 +2,17 @@
| 骨架网络 | 网络类型 | 卷积 | 每张GPU图片个数 | 学习率策略 |推理时间(fps)| Box AP | Mask AP | 下载 | 配置文件 |
| :------------------- | :------------- | :-----: |:--------: | :-----: | :-----------: |:----: | :-----: | :----------------------------------------------------------: | :----: |
| ResNet50-FPN | Faster | c3-c5 | 1 | 1x | - | 42.1 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_dcn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/dcn/faster_rcnn_dcn_r50_fpn_1x_coco.yml
)
|
| ResNet50-vd-FPN | Faster | c3-c5 | 1 | 1x | - | 42.7 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_dcn_r50_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/dcn/faster_rcnn_dcn_r50_vd_fpn_1x_coco.yml
)
|
| ResNet50-vd-FPN | Faster | c3-c5 | 1 | 2x | - | 43.7 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_dcn_r50_vd_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/dcn/faster_rcnn_dcn_r50_vd_fpn_2x_coco.yml
)
|
| ResNet101-vd-FPN | Faster | c3-c5 | 1 | 1x | - | 45.1 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_dcn_r101_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/dcn/faster_rcnn_dcn_r101_vd_fpn_1x_coco.yml
)
|
| ResNeXt101-vd-FPN | Faster | c3-c5 | 1 | 1x | - | 46.5 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_dcn_x101_vd_64x4d_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/dcn/faster_rcnn_dcn_x101_vd_64x4d_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Mask | c3-c5 | 1 | 1x | - | 42.7 | 38.4 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_dcn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/dcn/mask_rcnn_dcn_r50_fpn_1x_coco.yml
)
|
| ResNet50-vd-FPN | Mask | c3-c5 | 1 | 2x | - | 44.6 | 39.8 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_dcn_r50_vd_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/dcn/mask_rcnn_dcn_r50_vd_fpn_2x_coco.yml
)
|
| ResNet101-vd-FPN | Mask | c3-c5 | 1 | 1x | - | 45.6 | 40.6 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_dcn_r101_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/dcn/mask_rcnn_dcn_r101_vd_fpn_1x_coco.yml
)
|
| ResNeXt101-vd-FPN | Mask | c3-c5 | 1 | 1x | - | 47.3 | 42.0 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_dcn_x101_vd_64x4d_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/dcn/mask_rcnn_dcn_x101_vd_64x4d_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Cascade Faster | c3-c5 | 1 | 1x | - | 42.1 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/cascade_rcnn_dcn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/dcn/cascade_rcnn_dcn_r50_fpn_1x_coco.yml
)
|
| ResNeXt101-vd-FPN | Cascade Faster | c3-c5 | 1 | 1x | - | 48.8 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/cascade_rcnn_dcn_x101_vd_64x4d_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/dcn/cascade_rcnn_dcn_x101_vd_64x4d_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Faster | c3-c5 | 1 | 1x | - | 42.1 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_dcn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/dcn/faster_rcnn_dcn_r50_fpn_1x_coco.yml
)
|
| ResNet50-vd-FPN | Faster | c3-c5 | 1 | 1x | - | 42.7 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_dcn_r50_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/dcn/faster_rcnn_dcn_r50_vd_fpn_1x_coco.yml
)
|
| ResNet50-vd-FPN | Faster | c3-c5 | 1 | 2x | - | 43.7 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_dcn_r50_vd_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/dcn/faster_rcnn_dcn_r50_vd_fpn_2x_coco.yml
)
|
| ResNet101-vd-FPN | Faster | c3-c5 | 1 | 1x | - | 45.1 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_dcn_r101_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/dcn/faster_rcnn_dcn_r101_vd_fpn_1x_coco.yml
)
|
| ResNeXt101-vd-FPN | Faster | c3-c5 | 1 | 1x | - | 46.5 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_dcn_x101_vd_64x4d_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/dcn/faster_rcnn_dcn_x101_vd_64x4d_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Mask | c3-c5 | 1 | 1x | - | 42.7 | 38.4 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_dcn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/dcn/mask_rcnn_dcn_r50_fpn_1x_coco.yml
)
|
| ResNet50-vd-FPN | Mask | c3-c5 | 1 | 2x | - | 44.6 | 39.8 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_dcn_r50_vd_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/dcn/mask_rcnn_dcn_r50_vd_fpn_2x_coco.yml
)
|
| ResNet101-vd-FPN | Mask | c3-c5 | 1 | 1x | - | 45.6 | 40.6 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_dcn_r101_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/dcn/mask_rcnn_dcn_r101_vd_fpn_1x_coco.yml
)
|
| ResNeXt101-vd-FPN | Mask | c3-c5 | 1 | 1x | - | 47.3 | 42.0 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_dcn_x101_vd_64x4d_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/dcn/mask_rcnn_dcn_x101_vd_64x4d_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Cascade Faster | c3-c5 | 1 | 1x | - | 42.1 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/cascade_rcnn_dcn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/dcn/cascade_rcnn_dcn_r50_fpn_1x_coco.yml
)
|
| ResNeXt101-vd-FPN | Cascade Faster | c3-c5 | 1 | 1x | - | 48.8 | - |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/cascade_rcnn_dcn_x101_vd_64x4d_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/dcn/cascade_rcnn_dcn_x101_vd_64x4d_fpn_1x_coco.yml
)
|
**注意事项:**
...
...
configs/faster_rcnn/README.md
浏览文件 @
ae1b479c
...
...
@@ -4,20 +4,20 @@
| 骨架网络 | 网络类型 | 每张GPU图片个数 | 学习率策略 |推理时间(fps) | Box AP | 下载 | 配置文件 |
| :------------------- | :------------- | :-----: | :-----: | :------------: | :-----: | :-----------------------------------------------------: | :-----: |
| ResNet50 | Faster | 1 | 1x | ---- | 36.7 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r50_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_r50_1x_coco.yml
)
|
| ResNet50-vd | Faster | 1 | 1x | ---- | 37.6 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r50_vd_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_r50_vd_1x_coco.yml
)
|
| ResNet101 | Faster | 1 | 1x | ---- | 39.0 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r101_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_r101_1x_coco.yml
)
|
| ResNet34-FPN | Faster | 1 | 1x | ---- | 37.8 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r34_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_r34_fpn_1x_coco.yml
)
|
| ResNet34-vd-FPN | Faster | 1 | 1x | ---- | 38.5 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r34_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_r34_vd_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Faster | 1 | 1x | ---- | 38.4 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Faster | 1 | 2x | ---- | 40.0 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r50_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_r50_fpn_2x_coco.yml
)
|
| ResNet50-vd-FPN | Faster | 1 | 1x | ---- | 39.5 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r50_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_r50_vd_fpn_1x_coco.yml
)
|
| ResNet50-vd-FPN | Faster | 1 | 2x | ---- | 40.8 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r50_vd_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_r50_vd_fpn_2x_coco.yml
)
|
| ResNet101-FPN | Faster | 1 | 2x | ---- | 41.4 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r101_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_r101_fpn_2x_coco.yml
)
|
| ResNet101-vd-FPN | Faster | 1 | 1x | ---- | 42.0 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r101_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_r101_vd_fpn_1x_coco.yml
)
|
| ResNet101-vd-FPN | Faster | 1 | 2x | ---- | 43.0 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r101_vd_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_r101_vd_fpn_2x_coco.yml
)
|
| ResNeXt101-vd-FPN | Faster | 1 | 1x | ---- | 43.4 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_x101_vd_64x4d_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_x101_vd_64x4d_fpn_1x_coco.yml
)
|
| ResNeXt101-vd-FPN | Faster | 1 | 2x | ---- | 44.0 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_x101_vd_64x4d_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/faster_rcnn/faster_rcnn_x101_vd_64x4d_fpn_2x_coco.yml
)
|
| ResNet50 | Faster | 1 | 1x | ---- | 36.7 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r50_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_r50_1x_coco.yml
)
|
| ResNet50-vd | Faster | 1 | 1x | ---- | 37.6 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r50_vd_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_r50_vd_1x_coco.yml
)
|
| ResNet101 | Faster | 1 | 1x | ---- | 39.0 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r101_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_r101_1x_coco.yml
)
|
| ResNet34-FPN | Faster | 1 | 1x | ---- | 37.8 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r34_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_r34_fpn_1x_coco.yml
)
|
| ResNet34-vd-FPN | Faster | 1 | 1x | ---- | 38.5 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r34_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_r34_vd_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Faster | 1 | 1x | ---- | 38.4 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Faster | 1 | 2x | ---- | 40.0 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r50_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_r50_fpn_2x_coco.yml
)
|
| ResNet50-vd-FPN | Faster | 1 | 1x | ---- | 39.5 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r50_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_r50_vd_fpn_1x_coco.yml
)
|
| ResNet50-vd-FPN | Faster | 1 | 2x | ---- | 40.8 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r50_vd_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_r50_vd_fpn_2x_coco.yml
)
|
| ResNet101-FPN | Faster | 1 | 2x | ---- | 41.4 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r101_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_r101_fpn_2x_coco.yml
)
|
| ResNet101-vd-FPN | Faster | 1 | 1x | ---- | 42.0 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r101_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_r101_vd_fpn_1x_coco.yml
)
|
| ResNet101-vd-FPN | Faster | 1 | 2x | ---- | 43.0 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_r101_vd_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_r101_vd_fpn_2x_coco.yml
)
|
| ResNeXt101-vd-FPN | Faster | 1 | 1x | ---- | 43.4 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_x101_vd_64x4d_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_x101_vd_64x4d_fpn_1x_coco.yml
)
|
| ResNeXt101-vd-FPN | Faster | 1 | 2x | ---- | 44.0 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_x101_vd_64x4d_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/faster_rcnn/faster_rcnn_x101_vd_64x4d_fpn_2x_coco.yml
)
|
**注意:**
Faster R-CNN模型精度依赖Paddle develop分支修改,精度复现须使用
[
每日版本
](
https://www.paddlepaddle.org.cn/documentation/docs/zh/install/Tables.html#whl-dev
)
或2.0.1版本(将于2021.03发布),使用Paddle 2.0.0版本会有少量精度损失。
...
...
configs/hrnet/README.md
浏览文件 @
ae1b479c
...
...
@@ -30,5 +30,5 @@
| Backbone | Type | Image/gpu | Lr schd | Inf time (fps) | Box AP | Mask AP | Download | Configs |
| :---------------------- | :------------- | :-------: | :-----: | :------------: | :----: | :-----: | :----------------------------------------------------------: | :-----: |
| HRNetV2p_W18 | Faster | 1 | 1x | - | 36.8 | - |
[
model
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_hrnetv2p_w18_1x_coco.pdparams
)
|
[
config
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/hrnet/faster_rcnn_hrnetv2p_w18_1x_coco.yml
)
|
| HRNetV2p_W18 | Faster | 1 | 2x | - | 39.0 | - |
[
model
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_hrnetv2p_w18_2x_coco.pdparams
)
|
[
config
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/hrnet/faster_rcnn_hrnetv2p_w18_2x_coco.yml
)
|
| HRNetV2p_W18 | Faster | 1 | 1x | - | 36.8 | - |
[
model
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_hrnetv2p_w18_1x_coco.pdparams
)
|
[
config
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/hrnet/faster_rcnn_hrnetv2p_w18_1x_coco.yml
)
|
| HRNetV2p_W18 | Faster | 1 | 2x | - | 39.0 | - |
[
model
](
https://paddledet.bj.bcebos.com/models/faster_rcnn_hrnetv2p_w18_2x_coco.pdparams
)
|
[
config
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/hrnet/faster_rcnn_hrnetv2p_w18_2x_coco.yml
)
|
configs/mask_rcnn/README.md
浏览文件 @
ae1b479c
...
...
@@ -4,16 +4,16 @@
| 骨架网络 | 网络类型 | 每张GPU图片个数 | 学习率策略 |推理时间(fps) | Box AP | Mask AP | 下载 | 配置文件 |
| :------------------- | :------------| :-----: | :-----: | :------------: | :-----: | :-----: | :-----------------------------------------------------: | :-----: |
| ResNet50 | Mask | 1 | 1x | ---- | 37.4 | 32.8 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r50_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/mask_rcnn/mask_rcnn_r50_1x_coco.yml
)
|
| ResNet50 | Mask | 1 | 2x | ---- | 39.7 | 34.5 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r50_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/mask_rcnn/mask_rcnn_r50_2x_coco.yml
)
|
| ResNet50-FPN | Mask | 1 | 1x | ---- | 39.2 | 35.6 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Mask | 1 | 2x | ---- | 40.5 | 36.7 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r50_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/mask_rcnn/mask_rcnn_r50_fpn_2x_coco.yml
)
|
| ResNet50-vd-FPN | Mask | 1 | 1x | ---- | 40.3 | 36.4 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r50_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/mask_rcnn/mask_rcnn_r50_vd_fpn_1x_coco.yml
)
|
| ResNet50-vd-FPN | Mask | 1 | 2x | ---- | 41.4 | 37.5 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r50_vd_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/mask_rcnn/mask_rcnn_r50_vd_fpn_2x_coco.yml
)
|
| ResNet101-FPN | Mask | 1 | 1x | ---- | 40.6 | 36.6 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r101_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/mask_rcnn/mask_rcnn_r101_fpn_1x_coco.yml
)
|
| ResNet101-vd-FPN | Mask | 1 | 1x | ---- | 42.4 | 38.1 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r101_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/mask_rcnn/mask_rcnn_r101_vd_fpn_1x_coco.yml
)
|
| ResNeXt101-vd-FPN | Mask | 1 | 1x | ---- | 44.0 | 39.5 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_x101_vd_64x4d_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/mask_rcnn/mask_rcnn_x101_vd_64x4d_fpn_1x_coco.yml
)
|
| ResNeXt101-vd-FPN | Mask | 1 | 2x | ---- | 44.6 | 39.8 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_x101_vd_64x4d_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
master/dygraph
/configs/mask_rcnn/mask_rcnn_x101_vd_64x4d_fpn_2x_coco.yml
)
|
| ResNet50 | Mask | 1 | 1x | ---- | 37.4 | 32.8 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r50_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/mask_rcnn/mask_rcnn_r50_1x_coco.yml
)
|
| ResNet50 | Mask | 1 | 2x | ---- | 39.7 | 34.5 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r50_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/mask_rcnn/mask_rcnn_r50_2x_coco.yml
)
|
| ResNet50-FPN | Mask | 1 | 1x | ---- | 39.2 | 35.6 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r50_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/mask_rcnn/mask_rcnn_r50_fpn_1x_coco.yml
)
|
| ResNet50-FPN | Mask | 1 | 2x | ---- | 40.5 | 36.7 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r50_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/mask_rcnn/mask_rcnn_r50_fpn_2x_coco.yml
)
|
| ResNet50-vd-FPN | Mask | 1 | 1x | ---- | 40.3 | 36.4 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r50_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/mask_rcnn/mask_rcnn_r50_vd_fpn_1x_coco.yml
)
|
| ResNet50-vd-FPN | Mask | 1 | 2x | ---- | 41.4 | 37.5 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r50_vd_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/mask_rcnn/mask_rcnn_r50_vd_fpn_2x_coco.yml
)
|
| ResNet101-FPN | Mask | 1 | 1x | ---- | 40.6 | 36.6 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r101_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/mask_rcnn/mask_rcnn_r101_fpn_1x_coco.yml
)
|
| ResNet101-vd-FPN | Mask | 1 | 1x | ---- | 42.4 | 38.1 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_r101_vd_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/mask_rcnn/mask_rcnn_r101_vd_fpn_1x_coco.yml
)
|
| ResNeXt101-vd-FPN | Mask | 1 | 1x | ---- | 44.0 | 39.5 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_x101_vd_64x4d_fpn_1x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/mask_rcnn/mask_rcnn_x101_vd_64x4d_fpn_1x_coco.yml
)
|
| ResNeXt101-vd-FPN | Mask | 1 | 2x | ---- | 44.6 | 39.8 |
[
下载链接
](
https://paddledet.bj.bcebos.com/models/mask_rcnn_x101_vd_64x4d_fpn_2x_coco.pdparams
)
|
[
配置文件
](
https://github.com/PaddlePaddle/PaddleDetection/tree/
develop
/configs/mask_rcnn/mask_rcnn_x101_vd_64x4d_fpn_2x_coco.yml
)
|
**注意:**
Mask R-CNN模型精度依赖Paddle develop分支修改,精度复现须使用
[
每日版本
](
https://www.paddlepaddle.org.cn/documentation/docs/zh/install/Tables.html#whl-dev
)
或2.0.1版本(将于2021.03发布),使用Paddle 2.0.0版本会有少量精度损失。
...
...
ppdet/data/source/category.py
浏览文件 @
ae1b479c
...
...
@@ -32,6 +32,8 @@ def get_categories(metric_type, anno_file=None):
to category name map from annotation file.
Args:
metric_type (str): metric type, currently support 'coco', 'voc', 'oid'
and 'widerface'.
anno_file (str): annotation file path
"""
if
metric_type
.
lower
()
==
'coco'
:
...
...
ppdet/data/source/coco.py
浏览文件 @
ae1b479c
...
...
@@ -24,6 +24,17 @@ logger = setup_logger(__name__)
@
register
@
serializable
class
COCODataSet
(
DetDataset
):
"""
Load dataset with COCO format.
Args:
dataset_dir (str): root directory for dataset.
image_dir (str): directory for images.
anno_path (str): coco annotation file path.
data_fields (list): key name of data dictionary, at least have 'image'.
sample_num (int): number of samples to load, -1 means all.
"""
def
__init__
(
self
,
dataset_dir
=
None
,
image_dir
=
None
,
...
...
ppdet/data/source/dataset.py
浏览文件 @
ae1b479c
...
...
@@ -27,6 +27,18 @@ import copy
@
serializable
class
DetDataset
(
Dataset
):
"""
Load detection dataset.
Args:
dataset_dir (str): root directory for dataset.
image_dir (str): directory for images.
anno_path (str): annotation file path.
data_fields (list): key name of data dictionary, at least have 'image'.
sample_num (int): number of samples to load, -1 means all.
use_default_label (bool): whether to load default label list.
"""
def
__init__
(
self
,
dataset_dir
=
None
,
image_dir
=
None
,
...
...
ppdet/data/source/voc.py
浏览文件 @
ae1b479c
...
...
@@ -38,6 +38,7 @@ class VOCDataSet(DetDataset):
dataset_dir (str): root directory for dataset.
image_dir (str): directory for images.
anno_path (str): voc annotation file path.
data_fields (list): key name of data dictionary, at least have 'image'.
sample_num (int): number of samples to load, -1 means all.
label_list (str): if use_default_label is False, will load
mapping between category and class index.
...
...
ppdet/data/source/widerface.py
浏览文件 @
ae1b479c
...
...
@@ -31,8 +31,10 @@ class WIDERFaceDataSet(DetDataset):
Args:
dataset_dir (str): root directory for dataset.
image_dir (str): directory for images.
anno_path (str): root directory for voc annotation data
sample_num (int): number of samples to load, -1 means all
anno_path (str): WiderFace annotation data.
data_fields (list): key name of data dictionary, at least have 'image'.
sample_num (int): number of samples to load, -1 means all.
with_lmk (bool): whether to load face landmark keypoint labels.
"""
def
__init__
(
self
,
...
...
ppdet/metrics/coco_utils.py
浏览文件 @
ae1b479c
...
...
@@ -67,13 +67,13 @@ def cocoapi_eval(jsonfile,
classwise
=
False
):
"""
Args:
jsonfile: Evaluation json file, eg: bbox.json, mask.json.
style: COCOeval style, can be `bbox` , `segm` and `proposal`.
coco_gt: Whether to load COCOAPI through anno_file,
jsonfile
(str)
: Evaluation json file, eg: bbox.json, mask.json.
style
(str)
: COCOeval style, can be `bbox` , `segm` and `proposal`.
coco_gt
(str)
: Whether to load COCOAPI through anno_file,
eg: coco_gt = COCO(anno_file)
anno_file: COCO annotations file.
max_dets: COCO evaluation maxDets.
classwise
: w
hether per-category AP and draw P-R Curve or not.
anno_file
(str)
: COCO annotations file.
max_dets
(tuple)
: COCO evaluation maxDets.
classwise
(bool): W
hether per-category AP and draw P-R Curve or not.
"""
assert
coco_gt
!=
None
or
anno_file
!=
None
from
pycocotools.coco
import
COCO
...
...
@@ -142,9 +142,7 @@ def cocoapi_eval(jsonfile,
return
coco_eval
.
stats
def
json_eval_results
(
metric
:
object
,
json_directory
:
object
=
None
,
dataset
:
object
=
None
)
->
object
:
def
json_eval_results
(
metric
,
json_directory
,
dataset
):
"""
cocoapi eval with already exists proposal.json, bbox.json or mask.json
"""
...
...
ppdet/metrics/map_utils.py
浏览文件 @
ae1b479c
...
...
@@ -101,19 +101,20 @@ class DetectionMAP(object):
Currently support two types: 11point and integral
Args:
class_num (int):
t
he class number.
class_num (int):
T
he class number.
overlap_thresh (float): The threshold of overlap
ratio between prediction bounding box and
ground truth bounding box for deciding
true/false positive. Default 0.5.
map_type (str):
c
alculation method of mean average
map_type (str):
C
alculation method of mean average
precision, currently support '11point' and
'integral'. Default '11point'.
is_bbox_normalized (bool):
wh
ther bounding boxes
is_bbox_normalized (bool):
Whe
ther bounding boxes
is normalized to range[0, 1]. Default False.
evaluate_difficult (bool):
w
hether to evaluate
evaluate_difficult (bool):
W
hether to evaluate
difficult bounding boxes. Default False.
classwise (bool): whether per-category AP and draw
catid2name (dict): Mapping between category id and category name.
classwise (bool): Whether per-category AP and draw
P-R Curve or not.
"""
...
...
ppdet/modeling/architectures/cascade_rcnn.py
浏览文件 @
ae1b479c
...
...
@@ -25,6 +25,18 @@ __all__ = ['CascadeRCNN']
@
register
class
CascadeRCNN
(
BaseArch
):
"""
Cascade R-CNN network, see https://arxiv.org/abs/1712.00726
Args:
backbone (object): backbone instance
rpn_head (object): `RPNHead` instance
bbox_head (object): `BBoxHead` instance
bbox_post_process (object): `BBoxPostProcess` instance
neck (object): 'FPN' instance
mask_head (object): `MaskHead` instance
mask_post_process (object): `MaskPostProcess` instance
"""
__category__
=
'architecture'
__inject__
=
[
'bbox_post_process'
,
...
...
ppdet/modeling/architectures/faster_rcnn.py
浏览文件 @
ae1b479c
...
...
@@ -25,6 +25,16 @@ __all__ = ['FasterRCNN']
@
register
class
FasterRCNN
(
BaseArch
):
"""
Faster R-CNN network, see https://arxiv.org/abs/1506.01497
Args:
backbone (object): backbone instance
rpn_head (object): `RPNHead` instance
bbox_head (object): `BBoxHead` instance
bbox_post_process (object): `BBoxPostProcess` instance
neck (object): 'FPN' instance
"""
__category__
=
'architecture'
__inject__
=
[
'bbox_post_process'
]
...
...
@@ -34,13 +44,6 @@ class FasterRCNN(BaseArch):
bbox_head
,
bbox_post_process
,
neck
=
None
):
"""
backbone (nn.Layer): backbone instance.
rpn_head (nn.Layer): generates proposals using backbone features.
bbox_head (nn.Layer): a head that performs per-region computation.
mask_head (nn.Layer): generates mask from bbox and backbone features.
"""
super
(
FasterRCNN
,
self
).
__init__
()
self
.
backbone
=
backbone
self
.
neck
=
neck
...
...
ppdet/modeling/architectures/mask_rcnn.py
浏览文件 @
ae1b479c
...
...
@@ -25,6 +25,19 @@ __all__ = ['MaskRCNN']
@
register
class
MaskRCNN
(
BaseArch
):
"""
Mask R-CNN network, see https://arxiv.org/abs/1703.06870
Args:
backbone (object): backbone instance
rpn_head (object): `RPNHead` instance
bbox_head (object): `BBoxHead` instance
mask_head (object): `MaskHead` instance
bbox_post_process (object): `BBoxPostProcess` instance
mask_post_process (object): `MaskPostProcess` instance
neck (object): 'FPN' instance
"""
__category__
=
'architecture'
__inject__
=
[
'bbox_post_process'
,
...
...
@@ -39,12 +52,6 @@ class MaskRCNN(BaseArch):
bbox_post_process
,
mask_post_process
,
neck
=
None
):
"""
backbone (nn.Layer): backbone instance.
rpn_head (nn.Layer): generates proposals using backbone features.
bbox_head (nn.Layer): a head that performs per-region computation.
mask_head (nn.Layer): generates mask from bbox and backbone features.
"""
super
(
MaskRCNN
,
self
).
__init__
()
self
.
backbone
=
backbone
self
.
neck
=
neck
...
...
ppdet/modeling/backbones/hrnet.py
浏览文件 @
ae1b479c
...
...
@@ -97,7 +97,12 @@ class ConvNormLayer(nn.Layer):
class
Layer1
(
nn
.
Layer
):
def
__init__
(
self
,
num_channels
,
has_se
=
False
,
freeze_norm
=
True
,
name
=
None
):
def
__init__
(
self
,
num_channels
,
has_se
=
False
,
norm_decay
=
0.
,
freeze_norm
=
True
,
name
=
None
):
super
(
Layer1
,
self
).
__init__
()
self
.
bottleneck_block_list
=
[]
...
...
@@ -111,6 +116,7 @@ class Layer1(nn.Layer):
has_se
=
has_se
,
stride
=
1
,
downsample
=
True
if
i
==
0
else
False
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
name
+
'_'
+
str
(
i
+
1
)))
self
.
bottleneck_block_list
.
append
(
bottleneck_block
)
...
...
@@ -123,7 +129,12 @@ class Layer1(nn.Layer):
class
TransitionLayer
(
nn
.
Layer
):
def
__init__
(
self
,
in_channels
,
out_channels
,
freeze_norm
=
True
,
name
=
None
):
def
__init__
(
self
,
in_channels
,
out_channels
,
norm_decay
=
0.
,
freeze_norm
=
True
,
name
=
None
):
super
(
TransitionLayer
,
self
).
__init__
()
num_in
=
len
(
in_channels
)
...
...
@@ -140,6 +151,7 @@ class TransitionLayer(nn.Layer):
ch_in
=
in_channels
[
i
],
ch_out
=
out_channels
[
i
],
filter_size
=
3
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
act
=
'relu'
,
name
=
name
+
'_layer_'
+
str
(
i
+
1
)))
...
...
@@ -151,6 +163,7 @@ class TransitionLayer(nn.Layer):
ch_out
=
out_channels
[
i
],
filter_size
=
3
,
stride
=
2
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
act
=
'relu'
,
name
=
name
+
'_layer_'
+
str
(
i
+
1
)))
...
...
@@ -175,6 +188,7 @@ class Branches(nn.Layer):
in_channels
,
out_channels
,
has_se
=
False
,
norm_decay
=
0.
,
freeze_norm
=
True
,
name
=
None
):
super
(
Branches
,
self
).
__init__
()
...
...
@@ -190,6 +204,7 @@ class Branches(nn.Layer):
num_channels
=
in_ch
,
num_filters
=
out_channels
[
i
],
has_se
=
has_se
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
name
+
'_branch_layer_'
+
str
(
i
+
1
)
+
'_'
+
str
(
j
+
1
)))
...
...
@@ -213,6 +228,7 @@ class BottleneckBlock(nn.Layer):
has_se
,
stride
=
1
,
downsample
=
False
,
norm_decay
=
0.
,
freeze_norm
=
True
,
name
=
None
):
super
(
BottleneckBlock
,
self
).
__init__
()
...
...
@@ -224,6 +240,7 @@ class BottleneckBlock(nn.Layer):
ch_in
=
num_channels
,
ch_out
=
num_filters
,
filter_size
=
1
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
act
=
"relu"
,
name
=
name
+
"_conv1"
)
...
...
@@ -232,6 +249,7 @@ class BottleneckBlock(nn.Layer):
ch_out
=
num_filters
,
filter_size
=
3
,
stride
=
stride
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
act
=
"relu"
,
name
=
name
+
"_conv2"
)
...
...
@@ -239,6 +257,7 @@ class BottleneckBlock(nn.Layer):
ch_in
=
num_filters
,
ch_out
=
num_filters
*
4
,
filter_size
=
1
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
act
=
None
,
name
=
name
+
"_conv3"
)
...
...
@@ -248,6 +267,7 @@ class BottleneckBlock(nn.Layer):
ch_in
=
num_channels
,
ch_out
=
num_filters
*
4
,
filter_size
=
1
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
act
=
None
,
name
=
name
+
"_downsample"
)
...
...
@@ -283,6 +303,7 @@ class BasicBlock(nn.Layer):
stride
=
1
,
has_se
=
False
,
downsample
=
False
,
norm_decay
=
0.
,
freeze_norm
=
True
,
name
=
None
):
super
(
BasicBlock
,
self
).
__init__
()
...
...
@@ -293,6 +314,7 @@ class BasicBlock(nn.Layer):
ch_in
=
num_channels
,
ch_out
=
num_filters
,
filter_size
=
3
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
stride
=
stride
,
act
=
"relu"
,
...
...
@@ -301,6 +323,7 @@ class BasicBlock(nn.Layer):
ch_in
=
num_filters
,
ch_out
=
num_filters
,
filter_size
=
3
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
stride
=
1
,
act
=
None
,
...
...
@@ -311,6 +334,7 @@ class BasicBlock(nn.Layer):
ch_in
=
num_channels
,
ch_out
=
num_filters
*
4
,
filter_size
=
1
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
act
=
None
,
name
=
name
+
"_downsample"
)
...
...
@@ -381,6 +405,7 @@ class Stage(nn.Layer):
num_modules
,
num_filters
,
has_se
=
False
,
norm_decay
=
0.
,
freeze_norm
=
True
,
multi_scale_output
=
True
,
name
=
None
):
...
...
@@ -396,6 +421,7 @@ class Stage(nn.Layer):
num_channels
=
num_channels
,
num_filters
=
num_filters
,
has_se
=
has_se
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
multi_scale_output
=
False
,
name
=
name
+
'_'
+
str
(
i
+
1
)))
...
...
@@ -406,6 +432,7 @@ class Stage(nn.Layer):
num_channels
=
num_channels
,
num_filters
=
num_filters
,
has_se
=
has_se
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
name
+
'_'
+
str
(
i
+
1
)))
...
...
@@ -424,6 +451,7 @@ class HighResolutionModule(nn.Layer):
num_filters
,
has_se
=
False
,
multi_scale_output
=
True
,
norm_decay
=
0.
,
freeze_norm
=
True
,
name
=
None
):
super
(
HighResolutionModule
,
self
).
__init__
()
...
...
@@ -432,6 +460,7 @@ class HighResolutionModule(nn.Layer):
in_channels
=
num_channels
,
out_channels
=
num_filters
,
has_se
=
has_se
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
name
)
...
...
@@ -439,6 +468,7 @@ class HighResolutionModule(nn.Layer):
in_channels
=
num_filters
,
out_channels
=
num_filters
,
multi_scale_output
=
multi_scale_output
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
name
)
...
...
@@ -453,6 +483,7 @@ class FuseLayers(nn.Layer):
in_channels
,
out_channels
,
multi_scale_output
=
True
,
norm_decay
=
0.
,
freeze_norm
=
True
,
name
=
None
):
super
(
FuseLayers
,
self
).
__init__
()
...
...
@@ -473,6 +504,7 @@ class FuseLayers(nn.Layer):
filter_size
=
1
,
stride
=
1
,
act
=
None
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
name
+
'_layer_'
+
str
(
i
+
1
)
+
'_'
+
str
(
j
+
1
)))
...
...
@@ -489,6 +521,7 @@ class FuseLayers(nn.Layer):
ch_out
=
out_channels
[
i
],
filter_size
=
3
,
stride
=
2
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
act
=
None
,
name
=
name
+
'_layer_'
+
str
(
i
+
1
)
+
'_'
+
...
...
@@ -503,6 +536,7 @@ class FuseLayers(nn.Layer):
ch_out
=
out_channels
[
j
],
filter_size
=
3
,
stride
=
2
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
act
=
"relu"
,
name
=
name
+
'_layer_'
+
str
(
i
+
1
)
+
'_'
+
...
...
@@ -544,6 +578,7 @@ class HRNet(nn.Layer):
has_se (bool): whether to add SE block for each stage
freeze_at (int): the stage to freeze
freeze_norm (bool): whether to freeze norm in HRNet
norm_decay (float): weight decay for normalization layer weights
return_idx (List): the stage to return
"""
...
...
@@ -586,6 +621,7 @@ class HRNet(nn.Layer):
ch_out
=
64
,
filter_size
=
3
,
stride
=
2
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
act
=
'relu'
,
name
=
"layer1_1"
)
...
...
@@ -595,6 +631,7 @@ class HRNet(nn.Layer):
ch_out
=
64
,
filter_size
=
3
,
stride
=
2
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
act
=
'relu'
,
name
=
"layer1_2"
)
...
...
@@ -602,12 +639,14 @@ class HRNet(nn.Layer):
self
.
la1
=
Layer1
(
num_channels
=
64
,
has_se
=
has_se
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
"layer2"
)
self
.
tr1
=
TransitionLayer
(
in_channels
=
[
256
],
out_channels
=
channels_2
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
"tr1"
)
...
...
@@ -616,12 +655,14 @@ class HRNet(nn.Layer):
num_modules
=
num_modules_2
,
num_filters
=
channels_2
,
has_se
=
self
.
has_se
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
"st2"
)
self
.
tr2
=
TransitionLayer
(
in_channels
=
channels_2
,
out_channels
=
channels_3
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
"tr2"
)
...
...
@@ -630,12 +671,14 @@ class HRNet(nn.Layer):
num_modules
=
num_modules_3
,
num_filters
=
channels_3
,
has_se
=
self
.
has_se
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
"st3"
)
self
.
tr3
=
TransitionLayer
(
in_channels
=
channels_3
,
out_channels
=
channels_4
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
"tr3"
)
self
.
st4
=
Stage
(
...
...
@@ -643,6 +686,7 @@ class HRNet(nn.Layer):
num_modules
=
num_modules_4
,
num_filters
=
channels_4
,
has_se
=
self
.
has_se
,
norm_decay
=
norm_decay
,
freeze_norm
=
freeze_norm
,
name
=
"st4"
)
...
...
ppdet/modeling/necks/hrfpn.py
浏览文件 @
ae1b479c
...
...
@@ -30,8 +30,8 @@ class HRFPN(nn.Layer):
in_channels (list): number of input feature channels from backbone
out_channel (int): number of output feature channels
share_conv (bool): whether to share conv for different layers' reduction
spatial_scales (list): feature map scaling factor
extra_stage (int): add extra stage for returning HRFPN fpn_feats
spatial_scales (list): feature map scaling factor
"""
def
__init__
(
self
,
...
...
ppdet/modeling/post_process.py
浏览文件 @
ae1b479c
...
...
@@ -24,6 +24,8 @@ try:
except
Exception
:
from
collections
import
Sequence
__all__
=
[
'BBoxPostProcess'
,
'MaskPostProcess'
,
'FCOSPostProcess'
]
@
register
class
BBoxPostProcess
(
object
):
...
...
@@ -40,13 +42,17 @@ class BBoxPostProcess(object):
"""
Decode the bbox and do NMS if needed.
Args:
head_out (tuple): bbox_pred and cls_prob of bbox_head output.
rois (tuple): roi and rois_num of rpn_head output.
im_shape (Tensor): The shape of the input image.
scale_factor (Tensor): The scale factor of the input image.
Returns:
bbox_pred(Tensor): The output is the prediction with shape [N, 6]
including labels, scores and bboxes. The size of
bboxes are corresponding to the input image and
the bboxes may be used in other brunch.
bbox_num(Tensor): The number of prediction of each batch with shape
[N, 6].
bbox_pred (Tensor): The output prediction with shape [N, 6], including
labels, scores and bboxes. The size of bboxes are corresponding
to the input image, the bboxes may be used in other branch.
bbox_num (Tensor): The number of prediction boxes of each batch with
shape [1], and is N.
"""
if
self
.
nms
is
not
None
:
bboxes
,
score
=
self
.
decode
(
head_out
,
rois
,
im_shape
,
scale_factor
)
...
...
@@ -54,6 +60,9 @@ class BBoxPostProcess(object):
else
:
bbox_pred
,
bbox_num
=
self
.
decode
(
head_out
,
rois
,
im_shape
,
scale_factor
)
# Prevent empty bbox_pred from decode or NMS.
# Bboxes and score before NMS may be empty due to the score threshold.
if
bbox_pred
.
shape
[
0
]
==
0
:
bbox_pred
=
paddle
.
to_tensor
(
np
.
array
(
...
...
@@ -64,16 +73,22 @@ class BBoxPostProcess(object):
def
get_pred
(
self
,
bboxes
,
bbox_num
,
im_shape
,
scale_factor
):
"""
Rescale, clip and filter the bbox from the output of NMS to
get final prediction.
get final prediction.
Notes:
Currently only support bs = 1.
Args:
bboxes(Tensor): The output of __call__ with shape [N, 6]
bbox_pred (Tensor): The output bboxes with shape [N, 6] after decode
and NMS, including labels, scores and bboxes.
bbox_num (Tensor): The number of prediction boxes of each batch with
shape [1], and is N.
im_shape (Tensor): The shape of the input image.
scale_factor (Tensor): The scale factor of the input image.
Returns:
bbox_pred(Tensor): The output is the prediction with shape [N, 6]
including labels, scores and bboxes. The size of
bboxes are corresponding to the original image.
pred_result (Tensor): The final prediction results with shape [N, 6]
including labels, scores and bboxes.
"""
origin_shape
=
paddle
.
floor
(
im_shape
/
scale_factor
+
0.5
)
origin_shape_list
=
[]
...
...
@@ -125,7 +140,9 @@ class MaskPostProcess(object):
self
.
binary_thresh
=
binary_thresh
def
paste_mask
(
self
,
masks
,
boxes
,
im_h
,
im_w
):
# paste each mask on image
"""
Paste the mask prediction to the original image.
"""
x0
,
y0
,
x1
,
y1
=
paddle
.
split
(
boxes
,
4
,
axis
=
1
)
masks
=
paddle
.
unsqueeze
(
masks
,
[
0
,
1
])
img_y
=
paddle
.
arange
(
0
,
im_h
,
dtype
=
'float32'
)
+
0.5
...
...
@@ -148,7 +165,19 @@ class MaskPostProcess(object):
def
__call__
(
self
,
mask_out
,
bboxes
,
bbox_num
,
origin_shape
):
"""
Paste the mask prediction to the original image.
Decode the mask_out and paste the mask to the origin image.
Args:
mask_out (Tensor): mask_head output with shape [N, 28, 28].
bbox_pred (Tensor): The output bboxes with shape [N, 6] after decode
and NMS, including labels, scores and bboxes.
bbox_num (Tensor): The number of prediction boxes of each batch with
shape [1], and is N.
origin_shape (Tensor): The origin shape of the input image, the tensor
shape is [N, 2], and each row is [h, w].
Returns:
pred_result (Tensor): The final prediction mask results with shape
[N, h, w] in binary mask style.
"""
num_mask
=
mask_out
.
shape
[
0
]
origin_shape
=
paddle
.
cast
(
origin_shape
,
'int32'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录