Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleX
提交
03eb1be1
P
PaddleX
项目概览
PaddlePaddle
/
PaddleX
通知
138
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
43
列表
看板
标记
里程碑
合并请求
5
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleX
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
43
Issue
43
列表
看板
标记
里程碑
合并请求
5
合并请求
5
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
03eb1be1
编写于
8月 06, 2020
作者:
F
FlyingQianMM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
new ppyolo class
上级
6a4bfdaf
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
604 addition
and
459 deletion
+604
-459
paddlex/cv/__init__.py
paddlex/cv/__init__.py
+1
-0
paddlex/cv/models/__init__.py
paddlex/cv/models/__init__.py
+1
-0
paddlex/cv/models/ppyolo.py
paddlex/cv/models/ppyolo.py
+555
-0
paddlex/cv/models/yolo_v3.py
paddlex/cv/models/yolo_v3.py
+33
-437
paddlex/cv/nets/detection/yolo_v3.py
paddlex/cv/nets/detection/yolo_v3.py
+8
-9
paddlex/cv/transforms/__init__.py
paddlex/cv/transforms/__init__.py
+4
-1
paddlex/det.py
paddlex/det.py
+1
-0
tutorials/train/object_detection/ppyolo.py
tutorials/train/object_detection/ppyolo.py
+1
-12
未找到文件。
paddlex/cv/__init__.py
浏览文件 @
03eb1be1
...
...
@@ -26,6 +26,7 @@ ResNet50 = models.ResNet50
DarkNet53
=
models
.
DarkNet53
# detection
YOLOv3
=
models
.
YOLOv3
PPYOLO
=
models
.
PPYOLO
#EAST = models.EAST
FasterRCNN
=
models
.
FasterRCNN
MaskRCNN
=
models
.
MaskRCNN
...
...
paddlex/cv/models/__init__.py
浏览文件 @
03eb1be1
...
...
@@ -38,6 +38,7 @@ from .classifier import HRNet_W18
from
.classifier
import
AlexNet
from
.base
import
BaseAPI
from
.yolo_v3
import
YOLOv3
from
.ppyolo
import
PPYOLO
from
.faster_rcnn
import
FasterRCNN
from
.mask_rcnn
import
MaskRCNN
from
.unet
import
UNet
...
...
paddlex/cv/models/ppyolo.py
0 → 100644
浏览文件 @
03eb1be1
此差异已折叠。
点击以展开。
paddlex/cv/models/yolo_v3.py
浏览文件 @
03eb1be1
此差异已折叠。
点击以展开。
paddlex/cv/nets/detection/yolo_v3.py
浏览文件 @
03eb1be1
...
...
@@ -496,15 +496,14 @@ class YOLOv3:
gt_label
=
inputs
[
'gt_label'
]
gt_score
=
inputs
[
'gt_score'
]
im_size
=
inputs
[
'im_size'
]
#num_boxes = fluid.layers.shape(gt_box)[1]
#im_size_wh = fluid.layers.reverse(im_size, axis=1)
#whwh = fluid.layers.concat([im_size_wh, im_size_wh], axis=1)
#whwh = fluid.layers.unsqueeze(whwh, axes=[1])
#whwh = fluid.layers.expand(whwh, expand_times=[1, num_boxes, 1])
#whwh = fluid.layers.cast(whwh, dtype='float32')
#whwh.stop_gradient = True
#normalized_box = fluid.layers.elementwise_div(gt_box, whwh)
normalized_box
=
gt_box
num_boxes
=
fluid
.
layers
.
shape
(
gt_box
)[
1
]
im_size_wh
=
fluid
.
layers
.
reverse
(
im_size
,
axis
=
1
)
whwh
=
fluid
.
layers
.
concat
([
im_size_wh
,
im_size_wh
],
axis
=
1
)
whwh
=
fluid
.
layers
.
unsqueeze
(
whwh
,
axes
=
[
1
])
whwh
=
fluid
.
layers
.
expand
(
whwh
,
expand_times
=
[
1
,
num_boxes
,
1
])
whwh
=
fluid
.
layers
.
cast
(
whwh
,
dtype
=
'float32'
)
whwh
.
stop_gradient
=
True
normalized_box
=
fluid
.
layers
.
elementwise_div
(
gt_box
,
whwh
)
targets
=
[]
if
self
.
use_fine_grained_loss
:
...
...
paddlex/cv/transforms/__init__.py
浏览文件 @
03eb1be1
...
...
@@ -91,7 +91,10 @@ def arrange_transforms(model_type, class_name, transforms, mode='train'):
elif
model_type
==
'segmenter'
:
arrange_transform
=
seg_transforms
.
ArrangeSegmenter
elif
model_type
==
'detector'
:
arrange_name
=
'Arrange{}'
.
format
(
class_name
)
if
class_name
==
"PPYOLO"
:
arrange_name
=
'ArrangeYOLOv3'
else
:
arrange_name
=
'Arrange{}'
.
format
(
class_name
)
arrange_transform
=
getattr
(
det_transforms
,
arrange_name
)
else
:
raise
Exception
(
"Unrecognized model type: {}"
.
format
(
self
.
model_type
))
...
...
paddlex/det.py
浏览文件 @
03eb1be1
...
...
@@ -17,6 +17,7 @@ from . import cv
FasterRCNN
=
cv
.
models
.
FasterRCNN
YOLOv3
=
cv
.
models
.
YOLOv3
PPYOLO
=
cv
.
models
.
PPYOLO
MaskRCNN
=
cv
.
models
.
MaskRCNN
transforms
=
cv
.
transforms
.
det_transforms
visualize
=
cv
.
models
.
utils
.
visualize
.
visualize_detection
...
...
tutorials/train/object_detection/ppyolo.py
浏览文件 @
03eb1be1
...
...
@@ -43,17 +43,7 @@ eval_dataset = pdx.datasets.VOCDetection(
num_classes
=
len
(
train_dataset
.
labels
)
# API说明: https://paddlex.readthedocs.io/zh_CN/develop/apis/models/detection.html#paddlex-det-yolov3
model
=
pdx
.
det
.
YOLOv3
(
num_classes
=
num_classes
,
backbone
=
'ResNet50_vd'
,
with_dcn_v2
=
True
,
use_coord_conv
=
True
,
use_iou_aware
=
True
,
use_spp
=
True
,
use_drop_block
=
True
,
scale_x_y
=
1.05
,
use_iou_loss
=
True
,
use_matrix_nms
=
True
)
model
=
pdx
.
det
.
PPYOLO
(
num_classes
=
num_classes
)
# API说明: https://paddlex.readthedocs.io/zh_CN/develop/apis/models/detection.html#train
# 各参数介绍与调整说明:https://paddlex.readthedocs.io/zh_CN/develop/appendix/parameters.html
...
...
@@ -64,6 +54,5 @@ model.train(
eval_dataset
=
eval_dataset
,
learning_rate
=
0.000125
,
lr_decay_epochs
=
[
210
,
240
],
use_ema
=
True
,
save_dir
=
'output/ppyolo'
,
use_vdl
=
True
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录