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
4fc020f6
Commit
4fc020f6
authored
May 09, 2020
by
liyinhao
Browse files
change mmcv.check, add init file
parent
5bc5222e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
16 deletions
+19
-16
mmdet3d/datasets/__init__.py
mmdet3d/datasets/__init__.py
+7
-3
mmdet3d/datasets/pipelines/__init__.py
mmdet3d/datasets/pipelines/__init__.py
+5
-1
mmdet3d/datasets/pipelines/indoor_loading.py
mmdet3d/datasets/pipelines/indoor_loading.py
+4
-9
tests/test_indoor_loading.py
tests/test_indoor_loading.py
+2
-2
tests/test_indoor_sample.py
tests/test_indoor_sample.py
+1
-1
No files found.
mmdet3d/datasets/__init__.py
View file @
4fc020f6
...
...
@@ -5,8 +5,10 @@ from .kitti2d_dataset import Kitti2DDataset
from
.kitti_dataset
import
KittiDataset
from
.loader
import
DistributedGroupSampler
,
GroupSampler
,
build_dataloader
from
.nuscenes_dataset
import
NuScenesDataset
from
.pipelines
import
(
GlobalRotScale
,
ObjectNoise
,
ObjectRangeFilter
,
ObjectSample
,
PointShuffle
,
PointsRangeFilter
,
from
.pipelines
import
(
GlobalRotScale
,
IndoorLoadAnnotations3D
,
IndoorLoadPointsFromFile
,
IndoorPointsColorNormalize
,
ObjectNoise
,
ObjectRangeFilter
,
ObjectSample
,
PointSample
,
PointShuffle
,
PointsRangeFilter
,
RandomFlip3D
)
__all__
=
[
...
...
@@ -14,5 +16,7 @@ __all__ = [
'build_dataloader'
,
'RepeatFactorDataset'
,
'DATASETS'
,
'build_dataset'
,
'CocoDataset'
,
'Kitti2DDataset'
,
'NuScenesDataset'
,
'ObjectSample'
,
'RandomFlip3D'
,
'ObjectNoise'
,
'GlobalRotScale'
,
'PointShuffle'
,
'ObjectRangeFilter'
,
'PointsRangeFilter'
,
'Collect3D'
'ObjectRangeFilter'
,
'PointsRangeFilter'
,
'Collect3D'
,
'IndoorLoadPointsFromFile'
,
'IndoorPointsColorNormalize'
,
'PointSample'
,
'IndoorLoadAnnotations3D'
]
mmdet3d/datasets/pipelines/__init__.py
View file @
4fc020f6
from
mmdet.datasets.pipelines
import
Compose
from
.dbsampler
import
DataBaseSampler
,
MMDataBaseSampler
from
.formating
import
DefaultFormatBundle
,
DefaultFormatBundle3D
from
.indoor_loading
import
(
IndoorLoadAnnotations3D
,
IndoorLoadPointsFromFile
,
IndoorPointsColorNormalize
)
from
.indoor_sample
import
PointSample
from
.loading
import
LoadMultiViewImageFromFiles
,
LoadPointsFromFile
from
.train_aug
import
(
GlobalRotScale
,
ObjectNoise
,
ObjectRangeFilter
,
ObjectSample
,
PointShuffle
,
PointsRangeFilter
,
...
...
@@ -11,5 +14,6 @@ __all__ = [
'PointShuffle'
,
'ObjectRangeFilter'
,
'PointsRangeFilter'
,
'Collect3D'
,
'Compose'
,
'LoadMultiViewImageFromFiles'
,
'LoadPointsFromFile'
,
'DefaultFormatBundle'
,
'DefaultFormatBundle3D'
,
'DataBaseSampler'
,
'MMDataBaseSampler'
'MMDataBaseSampler'
,
'IndoorLoadPointsFromFile'
,
'IndoorPointsColorNormalize'
,
'IndoorLoadAnnotations3D'
,
'PointSample'
]
mmdet3d/datasets/pipelines/indoor_loading.py
View file @
4fc020f6
...
...
@@ -50,14 +50,13 @@ class IndoorLoadPointsFromFile(object):
assert
max
(
use_dim
)
<
load_dim
,
f
'Expect all used dimensions <
{
load_dim
}
, '
\
f
'got
{
[
dim
for
dim
in
use_dim
if
dim
>=
load_dim
]
}
'
f
'got
{
use_dim
}
'
self
.
load_dim
=
load_dim
self
.
use_dim
=
use_dim
def
__call__
(
self
,
results
):
pts_filename
=
results
[
'pts_filename'
]
mmcv
.
check_file_exist
(
pts_filename
,
msg_tmpl
=
f
'
{
pts_filename
}
does not exist.'
)
mmcv
.
check_file_exist
(
pts_filename
)
points
=
np
.
load
(
pts_filename
)
points
=
points
.
reshape
(
-
1
,
self
.
load_dim
)
points
=
points
[:,
self
.
use_dim
]
...
...
@@ -92,12 +91,8 @@ class IndoorLoadAnnotations3D(object):
pts_instance_mask_path
=
results
[
'pts_instance_mask_path'
]
pts_semantic_mask_path
=
results
[
'pts_semantic_mask_path'
]
mmcv
.
check_file_exist
(
pts_instance_mask_path
,
msg_tmpl
=
f
'
{
pts_instance_mask_path
}
does not exist.'
)
mmcv
.
check_file_exist
(
pts_semantic_mask_path
,
msg_tmpl
=
f
'
{
pts_semantic_mask_path
}
does not exist.'
)
mmcv
.
check_file_exist
(
pts_instance_mask_path
)
mmcv
.
check_file_exist
(
pts_semantic_mask_path
)
pts_instance_mask
=
np
.
load
(
pts_instance_mask_path
)
pts_semantic_mask
=
np
.
load
(
pts_semantic_mask_path
)
results
[
'pts_instance_mask'
]
=
pts_instance_mask
...
...
tests/test_indoor_loading.py
View file @
4fc020f6
...
...
@@ -3,8 +3,8 @@ import os.path as osp
import
mmcv
import
numpy
as
np
from
mmdet3d.datasets.pipelines
.i
ndoor
_l
oad
ing
import
(
# yapf: enable
IndoorLoadAnnotations3D
,
IndoorLoadPointsFromFile
)
from
mmdet3d.datasets.pipelines
import
(
I
ndoor
L
oad
Annotations3D
,
IndoorLoadPointsFromFile
)
def
test_indoor_load_points_from_file
():
...
...
tests/test_indoor_sample.py
View file @
4fc020f6
import
numpy
as
np
from
mmdet3d.datasets.pipelines
.indoor_sample
import
PointSample
from
mmdet3d.datasets.pipelines
import
PointSample
def
test_indoor_sample
():
...
...
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