Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
mmdetection3d
Commits
957e5bd1
"examples/vscode:/vscode.git/clone" did not exist on "b57bedb7ba3f38e7e54ab3adf5ba3657cd7912a1"
Commit
957e5bd1
authored
May 09, 2020
by
liyinhao
Browse files
enrich assertion
parent
5d602360
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
mmdet3d/datasets/pipelines/indoor_augment.py
mmdet3d/datasets/pipelines/indoor_augment.py
+8
-3
No files found.
mmdet3d/datasets/pipelines/indoor_augment.py
View file @
957e5bd1
...
@@ -87,7 +87,8 @@ class IndoorPointsColorJitter(object):
...
@@ -87,7 +87,8 @@ class IndoorPointsColorJitter(object):
def
__call__
(
self
,
results
):
def
__call__
(
self
,
results
):
points
=
results
[
'points'
]
points
=
results
[
'points'
]
assert
points
.
shape
[
1
]
>=
6
assert
points
.
shape
[
1
]
>=
6
,
\
f
'Expect points have channel >=6, got
{
points
.
shape
[
1
]
}
.'
rgb_color
=
points
[:,
3
:
6
]
+
self
.
color_mean
rgb_color
=
points
[:,
3
:
6
]
+
self
.
color_mean
# brightness change for each channel
# brightness change for each channel
rgb_color
*=
np
.
random
.
uniform
(
self
.
bright_range
[
0
],
rgb_color
*=
np
.
random
.
uniform
(
self
.
bright_range
[
0
],
...
@@ -192,7 +193,9 @@ class IndoorGlobalRotScale(object):
...
@@ -192,7 +193,9 @@ class IndoorGlobalRotScale(object):
aligned
=
True
if
gt_bboxes_3d
.
shape
[
1
]
==
6
else
False
aligned
=
True
if
gt_bboxes_3d
.
shape
[
1
]
==
6
else
False
if
self
.
rot_range
is
not
None
:
if
self
.
rot_range
is
not
None
:
assert
len
(
self
.
rot_range
)
==
2
assert
len
(
self
.
rot_range
)
==
2
,
\
f
'Except length of rot range =2, '
\
f
'got
{
len
(
self
.
rot_range
)
}
.'
rot_angle
=
np
.
random
.
uniform
(
self
.
rot_range
[
0
],
self
.
rot_range
[
1
])
rot_angle
=
np
.
random
.
uniform
(
self
.
rot_range
[
0
],
self
.
rot_range
[
1
])
rot_mat
=
self
.
_rotz
(
rot_angle
)
rot_mat
=
self
.
_rotz
(
rot_angle
)
points
[:,
:
3
]
=
np
.
dot
(
points
[:,
:
3
],
rot_mat
.
T
)
points
[:,
:
3
]
=
np
.
dot
(
points
[:,
:
3
],
rot_mat
.
T
)
...
@@ -204,7 +207,9 @@ class IndoorGlobalRotScale(object):
...
@@ -204,7 +207,9 @@ class IndoorGlobalRotScale(object):
gt_bboxes_3d
[:,
6
]
-=
rot_angle
gt_bboxes_3d
[:,
6
]
-=
rot_angle
if
self
.
scale_range
is
not
None
:
if
self
.
scale_range
is
not
None
:
assert
len
(
self
.
scale_range
)
==
2
assert
len
(
self
.
scale_range
)
==
2
,
\
f
'Except length of scale range =2, '
\
f
'got
{
len
(
self
.
scale_range
)
}
.'
# Augment point cloud scale
# Augment point cloud scale
scale_ratio
=
np
.
random
.
uniform
(
self
.
scale_range
[
0
],
scale_ratio
=
np
.
random
.
uniform
(
self
.
scale_range
[
0
],
self
.
scale_range
[
1
])
self
.
scale_range
[
1
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment