Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
86720c1f
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看板
未验证
提交
86720c1f
编写于
5月 31, 2021
作者:
G
George Ni
提交者:
GitHub
5月 31, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[cherry-pick][MOT]fix decode permute rgb (#3214)
上级
24e1a7d5
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
34 addition
and
19 deletion
+34
-19
configs/mot/fairmot/_base_/fairmot_reader_1088x608.yml
configs/mot/fairmot/_base_/fairmot_reader_1088x608.yml
+8
-6
configs/mot/jde/_base_/jde_reader_1088x608.yml
configs/mot/jde/_base_/jde_reader_1088x608.yml
+2
-0
configs/mot/jde/_base_/jde_reader_576x320.yml
configs/mot/jde/_base_/jde_reader_576x320.yml
+3
-1
configs/mot/jde/_base_/jde_reader_864x480.yml
configs/mot/jde/_base_/jde_reader_864x480.yml
+2
-0
configs/mot/jde/jde_darknet53_30e_576x320.yml
configs/mot/jde/jde_darknet53_30e_576x320.yml
+1
-1
ppdet/data/transform/mot_operators.py
ppdet/data/transform/mot_operators.py
+15
-1
ppdet/data/transform/operators.py
ppdet/data/transform/operators.py
+3
-10
未找到文件。
configs/mot/fairmot/_base_/fairmot_reader_1088x608.yml
浏览文件 @
86720c1f
...
...
@@ -3,15 +3,17 @@ TrainReader:
inputs_def
:
image_shape
:
[
3
,
608
,
1088
]
sample_transforms
:
-
Decode
:
{
to_rgb
:
False
}
-
AugmentHSV
:
{
is_bgr
:
True
}
-
Decode
:
{}
-
RGBReverse
:
{}
-
AugmentHSV
:
{}
-
LetterBoxResize
:
{
target_size
:
[
608
,
1088
]}
-
MOTRandomAffine
:
{
reject_outside
:
False
}
-
RandomFlip
:
{}
-
BboxXYXY2XYWH
:
{}
-
NormalizeBox
:
{}
-
NormalizeImage
:
{
mean
:
[
0
,
0
,
0
],
std
:
[
1
,
1
,
1
]}
-
Permute
:
{
to_rgb
:
True
}
-
RGBReverse
:
{}
-
Permute
:
{}
batch_transforms
:
-
Gt2FairMOTTarget
:
{}
batch_size
:
6
...
...
@@ -23,10 +25,10 @@ EvalMOTReader:
inputs_def
:
image_shape
:
[
3
,
608
,
1088
]
sample_transforms
:
-
Decode
:
{
to_rgb
:
False
}
-
Decode
:
{}
-
LetterBoxResize
:
{
target_size
:
[
608
,
1088
]}
-
NormalizeImage
:
{
mean
:
[
0
,
0
,
0
],
std
:
[
1
,
1
,
1
]}
-
Permute
:
{
to_rgb
:
True
}
-
Permute
:
{}
batch_size
:
1
...
...
@@ -36,5 +38,5 @@ TestMOTReader:
sample_transforms
:
-
LetterBoxResize
:
{
target_size
:
[
608
,
1088
]}
-
NormalizeImage
:
{
mean
:
[
0
,
0
,
0
],
std
:
[
1
,
1
,
1
]}
-
Permute
:
{
to_rgb
:
True
}
-
Permute
:
{}
batch_size
:
1
configs/mot/jde/_base_/jde_reader_1088x608.yml
浏览文件 @
86720c1f
...
...
@@ -2,6 +2,7 @@ worker_num: 2
TrainReader
:
sample_transforms
:
-
Decode
:
{}
-
RGBReverse
:
{}
-
AugmentHSV
:
{}
-
LetterBoxResize
:
{
target_size
:
[
608
,
1088
]}
-
MOTRandomAffine
:
{}
...
...
@@ -9,6 +10,7 @@ TrainReader:
-
BboxXYXY2XYWH
:
{}
-
NormalizeBox
:
{}
-
NormalizeImage
:
{
mean
:
[
0
,
0
,
0
],
std
:
[
1
,
1
,
1
],
is_scale
:
True
}
-
RGBReverse
:
{}
-
Permute
:
{}
batch_transforms
:
-
Gt2JDETargetThres
:
...
...
configs/mot/jde/_base_/jde_reader_576x320.yml
浏览文件 @
86720c1f
...
...
@@ -2,6 +2,7 @@ worker_num: 2
TrainReader
:
sample_transforms
:
-
Decode
:
{}
-
RGBReverse
:
{}
-
AugmentHSV
:
{}
-
LetterBoxResize
:
{
target_size
:
[
320
,
576
]}
-
MOTRandomAffine
:
{}
...
...
@@ -9,11 +10,12 @@ TrainReader:
-
BboxXYXY2XYWH
:
{}
-
NormalizeBox
:
{}
-
NormalizeImage
:
{
mean
:
[
0
,
0
,
0
],
std
:
[
1
,
1
,
1
],
is_scale
:
True
}
-
RGBReverse
:
{}
-
Permute
:
{}
batch_transforms
:
-
Gt2JDETargetThres
:
anchor_masks
:
[[
0
,
1
,
2
,
3
],
[
4
,
5
,
6
,
7
],
[
8
,
9
,
10
,
11
]]
anchors
:
[[[
85
,
255
],
[
120
,
3
20
],
[
170
,
320
],
[
340
,
3
20
]],
anchors
:
[[[
85
,
255
],
[
120
,
3
60
],
[
170
,
420
],
[
340
,
4
20
]],
[[
21
,
64
],
[
30
,
90
],
[
43
,
128
],
[
60
,
180
]],
[[
6
,
16
],
[
8
,
23
],
[
11
,
32
],
[
16
,
45
]]]
downsample_ratios
:
[
32
,
16
,
8
]
...
...
configs/mot/jde/_base_/jde_reader_864x480.yml
浏览文件 @
86720c1f
...
...
@@ -2,6 +2,7 @@ worker_num: 2
TrainReader
:
sample_transforms
:
-
Decode
:
{}
-
RGBReverse
:
{}
-
AugmentHSV
:
{}
-
LetterBoxResize
:
{
target_size
:
[
480
,
864
]}
-
MOTRandomAffine
:
{}
...
...
@@ -9,6 +10,7 @@ TrainReader:
-
BboxXYXY2XYWH
:
{}
-
NormalizeBox
:
{}
-
NormalizeImage
:
{
mean
:
[
0
,
0
,
0
],
std
:
[
1
,
1
,
1
],
is_scale
:
True
}
-
RGBReverse
:
{}
-
Permute
:
{}
batch_transforms
:
-
Gt2JDETargetThres
:
...
...
configs/mot/jde/jde_darknet53_30e_576x320.yml
浏览文件 @
86720c1f
...
...
@@ -20,7 +20,7 @@ YOLOv3:
for_mot
:
True
YOLOv3Head
:
anchors
:
[[
85
,
255
],
[
120
,
3
20
],
[
170
,
320
],
[
340
,
3
20
],
anchors
:
[[
85
,
255
],
[
120
,
3
60
],
[
170
,
420
],
[
340
,
4
20
],
[
21
,
64
],
[
30
,
90
],
[
43
,
128
],
[
60
,
180
],
[
6
,
16
],
[
8
,
23
],
[
11
,
32
],
[
16
,
45
]]
anchor_masks
:
[[
0
,
1
,
2
,
3
],
[
4
,
5
,
6
,
7
],
[
8
,
9
,
10
,
11
]]
...
...
ppdet/data/transform/mot_operators.py
浏览文件 @
86720c1f
...
...
@@ -36,11 +36,25 @@ from ppdet.utils.logger import setup_logger
logger
=
setup_logger
(
__name__
)
__all__
=
[
'LetterBoxResize'
,
'MOTRandomAffine'
,
'Gt2JDETargetThres'
,
'
RGBReverse'
,
'
LetterBoxResize'
,
'MOTRandomAffine'
,
'Gt2JDETargetThres'
,
'Gt2JDETargetMax'
,
'Gt2FairMOTTarget'
]
@
register_op
class
RGBReverse
(
BaseOperator
):
"""RGB to BGR, or BGR to RGB, sensitive to MOTRandomAffine
"""
def
__init__
(
self
):
super
(
RGBReverse
,
self
).
__init__
()
def
apply
(
self
,
sample
,
context
=
None
):
im
=
sample
[
'image'
]
sample
[
'image'
]
=
np
.
ascontiguousarray
(
im
[:,
:,
::
-
1
])
return
sample
@
register_op
class
LetterBoxResize
(
BaseOperator
):
def
__init__
(
self
,
target_size
):
...
...
ppdet/data/transform/operators.py
浏览文件 @
86720c1f
...
...
@@ -107,12 +107,10 @@ class BaseOperator(object):
@
register_op
class
Decode
(
BaseOperator
):
def
__init__
(
self
,
to_rgb
=
True
):
def
__init__
(
self
):
""" Transform the image data to numpy format following the rgb format
"""
super
(
Decode
,
self
).
__init__
()
# TODO: remove this parameter
self
.
to_rgb
=
to_rgb
def
apply
(
self
,
sample
,
context
=
None
):
""" load image if 'im_file' field is not empty but 'image' is"""
...
...
@@ -126,8 +124,7 @@ class Decode(BaseOperator):
im
=
cv2
.
imdecode
(
data
,
1
)
# BGR mode, but need RGB mode
if
'keep_ori_im'
in
sample
and
sample
[
'keep_ori_im'
]:
sample
[
'ori_image'
]
=
im
if
self
.
to_rgb
:
im
=
cv2
.
cvtColor
(
im
,
cv2
.
COLOR_BGR2RGB
)
im
=
cv2
.
cvtColor
(
im
,
cv2
.
COLOR_BGR2RGB
)
sample
[
'image'
]
=
im
if
'h'
not
in
sample
:
...
...
@@ -154,18 +151,14 @@ class Decode(BaseOperator):
@
register_op
class
Permute
(
BaseOperator
):
def
__init__
(
self
,
to_rgb
=
False
):
def
__init__
(
self
):
"""
Change the channel to be (C, H, W)
"""
super
(
Permute
,
self
).
__init__
()
# TODO: remove this parameter
self
.
to_rgb
=
to_rgb
def
apply
(
self
,
sample
,
context
=
None
):
im
=
sample
[
'image'
]
if
self
.
to_rgb
:
im
=
np
.
ascontiguousarray
(
im
[:,
:,
::
-
1
])
im
=
im
.
transpose
((
2
,
0
,
1
))
sample
[
'image'
]
=
im
return
sample
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录