Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
7a13a4b8
M
models
项目概览
PaddlePaddle
/
models
大约 2 年 前同步成功
通知
232
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7a13a4b8
编写于
6月 24, 2019
作者:
Y
Yang Zhang
提交者:
qingqing01
6月 24, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix code format for `data_feed.py` (#2516)
上级
9e5c26da
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
82 addition
and
84 deletion
+82
-84
PaddleCV/object_detection/ppdet/data/data_feed.py
PaddleCV/object_detection/ppdet/data/data_feed.py
+82
-84
未找到文件。
PaddleCV/object_detection/ppdet/data/data_feed.py
浏览文件 @
7a13a4b8
...
@@ -413,14 +413,14 @@ class FasterRCNNTrainFeed(DataFeed):
...
@@ -413,14 +413,14 @@ class FasterRCNNTrainFeed(DataFeed):
],
],
image_shape
=
[
3
,
1333
,
800
],
image_shape
=
[
3
,
1333
,
800
],
sample_transforms
=
[
sample_transforms
=
[
DecodeImage
(
to_rgb
=
True
),
RandomFlipImage
(
prob
=
0.5
),
DecodeImage
(
to_rgb
=
True
),
NormalizeImage
(
RandomFlipImage
(
prob
=
0.5
),
mean
=
[
0.485
,
0.456
,
0.406
],
NormalizeImage
(
mean
=
[
0.485
,
0.456
,
0.406
],
std
=
[
0.229
,
0.224
,
0.225
],
std
=
[
0.229
,
0.224
,
0.225
],
is_scale
=
True
,
is_scale
=
True
,
is_channel_first
=
False
),
ResizeImage
(
is_channel_first
=
False
),
target_size
=
800
,
max_size
=
1333
,
ResizeImage
(
target_size
=
800
,
max_size
=
1333
,
interp
=
1
)
,
interp
=
1
),
Permute
(
to_bgr
=
False
)
Permute
(
to_bgr
=
False
)
],
],
batch_transforms
=
[
PadBatch
()],
batch_transforms
=
[
PadBatch
()],
batch_size
=
1
,
batch_size
=
1
,
...
@@ -463,17 +463,17 @@ class MaskRCNNTrainFeed(DataFeed):
...
@@ -463,17 +463,17 @@ class MaskRCNNTrainFeed(DataFeed):
],
],
image_shape
=
[
3
,
1333
,
800
],
image_shape
=
[
3
,
1333
,
800
],
sample_transforms
=
[
sample_transforms
=
[
DecodeImage
(
to_rgb
=
True
),
RandomFlipImage
(
DecodeImage
(
to_rgb
=
True
),
prob
=
0.5
,
is_mask_flip
=
True
),
NormalizeImage
(
RandomFlipImage
(
prob
=
0.5
,
is_mask_flip
=
True
),
mean
=
[
0.485
,
0.456
,
0.406
],
NormalizeImage
(
mean
=
[
0.485
,
0.456
,
0.406
],
std
=
[
0.229
,
0.224
,
0.225
],
std
=
[
0.229
,
0.224
,
0.225
],
is_scale
=
True
,
is_scale
=
True
,
is_channel_first
=
False
),
ResizeImage
(
is_channel_first
=
False
),
target_size
=
800
,
ResizeImage
(
target_size
=
800
,
max_size
=
1333
,
max_size
=
1333
,
interp
=
1
,
interp
=
1
,
use_cv2
=
True
),
Permute
(
use_cv2
=
True
),
to_bgr
=
False
,
channel_first
=
True
)
Permute
(
to_bgr
=
False
,
channel_first
=
True
)
],
],
batch_transforms
=
[
PadBatch
()],
batch_transforms
=
[
PadBatch
()],
batch_size
=
1
,
batch_size
=
1
,
...
@@ -509,12 +509,12 @@ class FasterRCNNEvalFeed(DataFeed):
...
@@ -509,12 +509,12 @@ class FasterRCNNEvalFeed(DataFeed):
fields
=
[
'image'
,
'im_info'
,
'im_id'
,
'im_shape'
],
fields
=
[
'image'
,
'im_info'
,
'im_id'
,
'im_shape'
],
image_shape
=
[
3
,
1333
,
800
],
image_shape
=
[
3
,
1333
,
800
],
sample_transforms
=
[
sample_transforms
=
[
DecodeImage
(
to_rgb
=
True
),
NormalizeImage
(
DecodeImage
(
to_rgb
=
True
),
mean
=
[
0.485
,
0.456
,
0.406
],
NormalizeImage
(
mean
=
[
0.485
,
0.456
,
0.406
],
std
=
[
0.229
,
0.224
,
0.225
],
std
=
[
0.229
,
0.224
,
0.225
],
is_scale
=
True
,
is_scale
=
True
,
is_channel_first
=
False
),
ResizeImage
(
is_channel_first
=
False
),
target_size
=
800
,
max_size
=
1333
,
interp
=
1
),
ResizeImage
(
target_size
=
800
,
max_size
=
1333
,
interp
=
1
),
Permute
(
to_bgr
=
False
)
Permute
(
to_bgr
=
False
)
],
],
batch_transforms
=
[
PadBatch
()],
batch_transforms
=
[
PadBatch
()],
...
@@ -552,11 +552,12 @@ class FasterRCNNTestFeed(DataFeed):
...
@@ -552,11 +552,12 @@ class FasterRCNNTestFeed(DataFeed):
fields
=
[
'image'
,
'im_info'
,
'im_id'
,
'im_shape'
],
fields
=
[
'image'
,
'im_info'
,
'im_id'
,
'im_shape'
],
image_shape
=
[
3
,
1333
,
800
],
image_shape
=
[
3
,
1333
,
800
],
sample_transforms
=
[
sample_transforms
=
[
DecodeImage
(
to_rgb
=
True
),
NormalizeImage
(
DecodeImage
(
to_rgb
=
True
),
mean
=
[
0.485
,
0.456
,
0.406
],
NormalizeImage
(
mean
=
[
0.485
,
0.456
,
0.406
],
std
=
[
0.229
,
0.224
,
0.225
],
std
=
[
0.229
,
0.224
,
0.225
],
is_scale
=
True
,
is_scale
=
True
,
is_channel_first
=
False
),
Permute
(
to_bgr
=
False
)
is_channel_first
=
False
),
Permute
(
to_bgr
=
False
)
],
],
batch_transforms
=
[
PadBatch
()],
batch_transforms
=
[
PadBatch
()],
batch_size
=
1
,
batch_size
=
1
,
...
@@ -595,16 +596,16 @@ class MaskRCNNEvalFeed(DataFeed):
...
@@ -595,16 +596,16 @@ class MaskRCNNEvalFeed(DataFeed):
fields
=
[
'image'
,
'im_info'
,
'im_id'
,
'im_shape'
],
fields
=
[
'image'
,
'im_info'
,
'im_id'
,
'im_shape'
],
image_shape
=
[
3
,
1333
,
800
],
image_shape
=
[
3
,
1333
,
800
],
sample_transforms
=
[
sample_transforms
=
[
DecodeImage
(
to_rgb
=
True
),
NormalizeImage
(
DecodeImage
(
to_rgb
=
True
),
mean
=
[
0.485
,
0.456
,
0.406
],
NormalizeImage
(
mean
=
[
0.485
,
0.456
,
0.406
],
std
=
[
0.229
,
0.224
,
0.225
],
std
=
[
0.229
,
0.224
,
0.225
],
is_scale
=
True
,
is_scale
=
True
,
is_channel_first
=
False
),
ResizeImage
(
is_channel_first
=
False
),
target_size
=
800
,
ResizeImage
(
target_size
=
800
,
max_size
=
1333
,
max_size
=
1333
,
interp
=
1
,
interp
=
1
,
use_cv2
=
True
),
Permute
(
use_cv2
=
True
),
to_bgr
=
False
,
channel_first
=
True
)
Permute
(
to_bgr
=
False
,
channel_first
=
True
)
],
],
batch_transforms
=
[
PadBatch
()],
batch_transforms
=
[
PadBatch
()],
batch_size
=
1
,
batch_size
=
1
,
...
@@ -643,12 +644,13 @@ class MaskRCNNTestFeed(DataFeed):
...
@@ -643,12 +644,13 @@ class MaskRCNNTestFeed(DataFeed):
fields
=
[
'image'
,
'im_info'
,
'im_id'
,
'im_shape'
],
fields
=
[
'image'
,
'im_info'
,
'im_id'
,
'im_shape'
],
image_shape
=
[
3
,
1333
,
800
],
image_shape
=
[
3
,
1333
,
800
],
sample_transforms
=
[
sample_transforms
=
[
DecodeImage
(
to_rgb
=
True
),
NormalizeImage
(
DecodeImage
(
to_rgb
=
True
),
NormalizeImage
(
mean
=
[
0.485
,
0.456
,
0.406
],
mean
=
[
0.485
,
0.456
,
0.406
],
std
=
[
0.229
,
0.224
,
0.225
],
std
=
[
0.229
,
0.224
,
0.225
],
is_scale
=
True
,
is_scale
=
True
,
is_channel_first
=
False
),
Permute
(
is_channel_first
=
False
),
to_bgr
=
False
,
channel_first
=
True
)
Permute
(
to_bgr
=
False
,
channel_first
=
True
)
],
],
batch_transforms
=
[
PadBatch
()],
batch_transforms
=
[
PadBatch
()],
batch_size
=
1
,
batch_size
=
1
,
...
@@ -688,28 +690,26 @@ class SSDTrainFeed(DataFeed):
...
@@ -688,28 +690,26 @@ class SSDTrainFeed(DataFeed):
fields
=
[
'image'
,
'gt_box'
,
'gt_label'
,
'is_difficult'
],
fields
=
[
'image'
,
'gt_box'
,
'gt_label'
,
'is_difficult'
],
image_shape
=
[
3
,
300
,
300
],
image_shape
=
[
3
,
300
,
300
],
sample_transforms
=
[
sample_transforms
=
[
DecodeImage
(
DecodeImage
(
to_rgb
=
True
,
with_mixup
=
False
),
to_rgb
=
True
,
NormalizeBox
(),
with_mixup
=
False
),
NormalizeBox
(),
RandomDistort
(
RandomDistort
(
brightness_lower
=
0.875
,
brightness_lower
=
0.875
,
brightness_upper
=
1.125
,
brightness_upper
=
1.125
,
is_order
=
True
),
is_order
=
True
),
ExpandImage
(
ExpandImage
(
max_ratio
=
4
,
prob
=
0.5
),
max_ratio
=
4
,
prob
=
0.5
),
CropImage
([[
1
,
1
,
1.0
,
1.0
,
1.0
,
1.0
,
0.0
,
0.0
],
CropImage
(
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.1
,
0.0
],
batch_sampler
=
[[
1
,
1
,
1.0
,
1.0
,
1.0
,
1.0
,
0.0
,
0.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.3
,
0.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.1
,
0.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.5
,
0.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.3
,
0.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.7
,
0.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.5
,
0.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.9
,
0.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.7
,
0.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.0
,
1.0
]],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.9
,
0.0
],
satisfy_all
=
False
),
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.0
,
1.0
]],
ResizeImage
(
target_size
=
300
,
use_cv2
=
False
,
interp
=
1
),
satisfy_all
=
False
),
ResizeImage
(
RandomFlipImage
(
is_normalized
=
True
),
target_size
=
300
,
use_cv2
=
False
,
Permute
(),
interp
=
1
),
RandomFlipImage
(
is_normalized
=
True
),
NormalizeImage
(
mean
=
[
127.5
,
127.5
,
127.5
],
Permute
(),
NormalizeImage
(
std
=
[
127.502231
,
127.502231
,
127.502231
],
mean
=
[
127.5
,
127.5
,
127.5
],
is_scale
=
False
)
std
=
[
127.502231
,
127.502231
,
127.502231
],
is_scale
=
False
)
],
],
batch_transforms
=
[],
batch_transforms
=
[],
batch_size
=
32
,
batch_size
=
32
,
...
@@ -747,10 +747,12 @@ class SSDEvalFeed(DataFeed):
...
@@ -747,10 +747,12 @@ class SSDEvalFeed(DataFeed):
fields
=
[
'image'
,
'gt_box'
,
'gt_label'
,
'is_difficult'
],
fields
=
[
'image'
,
'gt_box'
,
'gt_label'
,
'is_difficult'
],
image_shape
=
[
3
,
300
,
300
],
image_shape
=
[
3
,
300
,
300
],
sample_transforms
=
[
sample_transforms
=
[
DecodeImage
(
DecodeImage
(
to_rgb
=
True
,
with_mixup
=
False
),
to_rgb
=
True
,
with_mixup
=
False
),
NormalizeBox
(),
ResizeImage
(
NormalizeBox
(),
target_size
=
300
,
use_cv2
=
False
,
interp
=
1
),
ResizeImage
(
target_size
=
300
,
use_cv2
=
False
,
interp
=
1
),
RandomFlipImage
(
is_normalized
=
True
),
Permute
(),
NormalizeImage
(
RandomFlipImage
(
is_normalized
=
True
),
Permute
(),
NormalizeImage
(
mean
=
[
127.5
,
127.5
,
127.5
],
mean
=
[
127.5
,
127.5
,
127.5
],
std
=
[
127.502231
,
127.502231
,
127.502231
],
std
=
[
127.502231
,
127.502231
,
127.502231
],
is_scale
=
False
)
is_scale
=
False
)
...
@@ -790,8 +792,9 @@ class SSDTestFeed(DataFeed):
...
@@ -790,8 +792,9 @@ class SSDTestFeed(DataFeed):
fields
=
[
'image'
],
fields
=
[
'image'
],
image_shape
=
[
3
,
300
,
300
],
image_shape
=
[
3
,
300
,
300
],
sample_transforms
=
[
sample_transforms
=
[
DecodeImage
(
to_rgb
=
True
),
ResizeImage
(
DecodeImage
(
to_rgb
=
True
),
target_size
=
300
,
use_cv2
=
False
,
interp
=
1
),
Permute
(),
ResizeImage
(
target_size
=
300
,
use_cv2
=
False
,
interp
=
1
),
Permute
(),
NormalizeImage
(
NormalizeImage
(
mean
=
[
127.5
,
127.5
,
127.5
],
mean
=
[
127.5
,
127.5
,
127.5
],
std
=
[
127.502231
,
127.502231
,
127.502231
],
std
=
[
127.502231
,
127.502231
,
127.502231
],
...
@@ -833,14 +836,12 @@ class YoloTrainFeed(DataFeed):
...
@@ -833,14 +836,12 @@ class YoloTrainFeed(DataFeed):
fields
=
[
'image'
,
'gt_box'
,
'gt_label'
,
'gt_score'
],
fields
=
[
'image'
,
'gt_box'
,
'gt_label'
,
'gt_score'
],
image_shape
=
[
3
,
608
,
608
],
image_shape
=
[
3
,
608
,
608
],
sample_transforms
=
[
sample_transforms
=
[
DecodeImage
(
DecodeImage
(
to_rgb
=
True
,
with_mixup
=
True
),
to_rgb
=
True
,
with_mixup
=
True
),
MixupImage
(
alpha
=
1.5
,
beta
=
1.5
),
MixupImage
(
alpha
=
1.5
,
beta
=
1.5
),
NormalizeBox
(),
NormalizeBox
(),
RandomDistort
(),
RandomDistort
(),
ExpandImage
(
ExpandImage
(
max_ratio
=
4.
,
prob
=
.
5
,
max_ratio
=
4.
,
prob
=
.
5
,
mean
=
[
123.675
,
116.28
,
103.53
]),
mean
=
[
123.675
,
116.28
,
103.53
]),
CropImage
([[
1
,
1
,
1.0
,
1.0
,
1.0
,
1.0
,
0.0
,
0.0
],
CropImage
([[
1
,
1
,
1.0
,
1.0
,
1.0
,
1.0
,
0.0
,
0.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.1
,
1.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.1
,
1.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.3
,
1.0
],
[
1
,
50
,
0.3
,
1.0
,
0.5
,
2.0
,
0.3
,
1.0
],
...
@@ -903,8 +904,7 @@ class YoloEvalFeed(DataFeed):
...
@@ -903,8 +904,7 @@ class YoloEvalFeed(DataFeed):
image_shape
=
[
3
,
608
,
608
],
image_shape
=
[
3
,
608
,
608
],
sample_transforms
=
[
sample_transforms
=
[
DecodeImage
(
to_rgb
=
True
),
DecodeImage
(
to_rgb
=
True
),
ResizeImage
(
ResizeImage
(
target_size
=
608
,
interp
=
2
),
target_size
=
608
,
interp
=
2
),
NormalizeImage
(
NormalizeImage
(
mean
=
[
0.485
,
0.456
,
0.406
],
mean
=
[
0.485
,
0.456
,
0.406
],
std
=
[
0.229
,
0.224
,
0.225
],
std
=
[
0.229
,
0.224
,
0.225
],
...
@@ -951,13 +951,11 @@ class YoloTestFeed(DataFeed):
...
@@ -951,13 +951,11 @@ class YoloTestFeed(DataFeed):
image_shape
=
[
3
,
608
,
608
],
image_shape
=
[
3
,
608
,
608
],
sample_transforms
=
[
sample_transforms
=
[
DecodeImage
(
to_rgb
=
True
),
DecodeImage
(
to_rgb
=
True
),
ResizeImage
(
ResizeImage
(
target_size
=
608
,
interp
=
2
),
target_size
=
608
,
interp
=
2
),
NormalizeImage
(
mean
=
[
0.485
,
0.456
,
0.406
],
NormalizeImage
(
std
=
[
0.229
,
0.224
,
0.225
],
mean
=
[
0.485
,
0.456
,
0.406
],
is_scale
=
True
,
std
=
[
0.229
,
0.224
,
0.225
],
is_channel_first
=
False
),
is_scale
=
True
,
is_channel_first
=
False
),
Permute
(
to_bgr
=
False
),
Permute
(
to_bgr
=
False
),
],
],
batch_transforms
=
[],
batch_transforms
=
[],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录