Commit 4fc020f6 authored by liyinhao's avatar liyinhao
Browse files

change mmcv.check, add init file

parent 5bc5222e
......@@ -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'
]
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'
]
......@@ -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
......
......@@ -3,8 +3,8 @@ import os.path as osp
import mmcv
import numpy as np
from mmdet3d.datasets.pipelines.indoor_loading import ( # yapf: enable
IndoorLoadAnnotations3D, IndoorLoadPointsFromFile)
from mmdet3d.datasets.pipelines import (IndoorLoadAnnotations3D,
IndoorLoadPointsFromFile)
def test_indoor_load_points_from_file():
......
import numpy as np
from mmdet3d.datasets.pipelines.indoor_sample import PointSample
from mmdet3d.datasets.pipelines import PointSample
def test_indoor_sample():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment