"git@developer.sourcefind.cn:OpenDAS/torch-scatter.git" did not exist on "21c467db8fae2fdee74098cfadd1188c0e78984e"
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 ...@@ -5,8 +5,10 @@ from .kitti2d_dataset import Kitti2DDataset
from .kitti_dataset import KittiDataset from .kitti_dataset import KittiDataset
from .loader import DistributedGroupSampler, GroupSampler, build_dataloader from .loader import DistributedGroupSampler, GroupSampler, build_dataloader
from .nuscenes_dataset import NuScenesDataset from .nuscenes_dataset import NuScenesDataset
from .pipelines import (GlobalRotScale, ObjectNoise, ObjectRangeFilter, from .pipelines import (GlobalRotScale, IndoorLoadAnnotations3D,
ObjectSample, PointShuffle, PointsRangeFilter, IndoorLoadPointsFromFile, IndoorPointsColorNormalize,
ObjectNoise, ObjectRangeFilter, ObjectSample,
PointSample, PointShuffle, PointsRangeFilter,
RandomFlip3D) RandomFlip3D)
__all__ = [ __all__ = [
...@@ -14,5 +16,7 @@ __all__ = [ ...@@ -14,5 +16,7 @@ __all__ = [
'build_dataloader', 'RepeatFactorDataset', 'DATASETS', 'build_dataset', 'build_dataloader', 'RepeatFactorDataset', 'DATASETS', 'build_dataset',
'CocoDataset', 'Kitti2DDataset', 'NuScenesDataset', 'ObjectSample', 'CocoDataset', 'Kitti2DDataset', 'NuScenesDataset', 'ObjectSample',
'RandomFlip3D', 'ObjectNoise', 'GlobalRotScale', 'PointShuffle', 'RandomFlip3D', 'ObjectNoise', 'GlobalRotScale', 'PointShuffle',
'ObjectRangeFilter', 'PointsRangeFilter', 'Collect3D' 'ObjectRangeFilter', 'PointsRangeFilter', 'Collect3D',
'IndoorLoadPointsFromFile', 'IndoorPointsColorNormalize', 'PointSample',
'IndoorLoadAnnotations3D'
] ]
from mmdet.datasets.pipelines import Compose from mmdet.datasets.pipelines import Compose
from .dbsampler import DataBaseSampler, MMDataBaseSampler from .dbsampler import DataBaseSampler, MMDataBaseSampler
from .formating import DefaultFormatBundle, DefaultFormatBundle3D from .formating import DefaultFormatBundle, DefaultFormatBundle3D
from .indoor_loading import (IndoorLoadAnnotations3D, IndoorLoadPointsFromFile,
IndoorPointsColorNormalize)
from .indoor_sample import PointSample
from .loading import LoadMultiViewImageFromFiles, LoadPointsFromFile from .loading import LoadMultiViewImageFromFiles, LoadPointsFromFile
from .train_aug import (GlobalRotScale, ObjectNoise, ObjectRangeFilter, from .train_aug import (GlobalRotScale, ObjectNoise, ObjectRangeFilter,
ObjectSample, PointShuffle, PointsRangeFilter, ObjectSample, PointShuffle, PointsRangeFilter,
...@@ -11,5 +14,6 @@ __all__ = [ ...@@ -11,5 +14,6 @@ __all__ = [
'PointShuffle', 'ObjectRangeFilter', 'PointsRangeFilter', 'Collect3D', 'PointShuffle', 'ObjectRangeFilter', 'PointsRangeFilter', 'Collect3D',
'Compose', 'LoadMultiViewImageFromFiles', 'LoadPointsFromFile', 'Compose', 'LoadMultiViewImageFromFiles', 'LoadPointsFromFile',
'DefaultFormatBundle', 'DefaultFormatBundle3D', 'DataBaseSampler', 'DefaultFormatBundle', 'DefaultFormatBundle3D', 'DataBaseSampler',
'MMDataBaseSampler' 'MMDataBaseSampler', 'IndoorLoadPointsFromFile',
'IndoorPointsColorNormalize', 'IndoorLoadAnnotations3D', 'PointSample'
] ]
...@@ -50,14 +50,13 @@ class IndoorLoadPointsFromFile(object): ...@@ -50,14 +50,13 @@ class IndoorLoadPointsFromFile(object):
assert max( assert max(
use_dim use_dim
) < load_dim, f'Expect all used dimensions < {load_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.load_dim = load_dim
self.use_dim = use_dim self.use_dim = use_dim
def __call__(self, results): def __call__(self, results):
pts_filename = results['pts_filename'] pts_filename = results['pts_filename']
mmcv.check_file_exist( mmcv.check_file_exist(pts_filename)
pts_filename, msg_tmpl=f'{pts_filename} does not exist.')
points = np.load(pts_filename) points = np.load(pts_filename)
points = points.reshape(-1, self.load_dim) points = points.reshape(-1, self.load_dim)
points = points[:, self.use_dim] points = points[:, self.use_dim]
...@@ -92,12 +91,8 @@ class IndoorLoadAnnotations3D(object): ...@@ -92,12 +91,8 @@ class IndoorLoadAnnotations3D(object):
pts_instance_mask_path = results['pts_instance_mask_path'] pts_instance_mask_path = results['pts_instance_mask_path']
pts_semantic_mask_path = results['pts_semantic_mask_path'] pts_semantic_mask_path = results['pts_semantic_mask_path']
mmcv.check_file_exist( mmcv.check_file_exist(pts_instance_mask_path)
pts_instance_mask_path, mmcv.check_file_exist(pts_semantic_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.')
pts_instance_mask = np.load(pts_instance_mask_path) pts_instance_mask = np.load(pts_instance_mask_path)
pts_semantic_mask = np.load(pts_semantic_mask_path) pts_semantic_mask = np.load(pts_semantic_mask_path)
results['pts_instance_mask'] = pts_instance_mask results['pts_instance_mask'] = pts_instance_mask
......
...@@ -3,8 +3,8 @@ import os.path as osp ...@@ -3,8 +3,8 @@ import os.path as osp
import mmcv import mmcv
import numpy as np import numpy as np
from mmdet3d.datasets.pipelines.indoor_loading import ( # yapf: enable from mmdet3d.datasets.pipelines import (IndoorLoadAnnotations3D,
IndoorLoadAnnotations3D, IndoorLoadPointsFromFile) IndoorLoadPointsFromFile)
def test_indoor_load_points_from_file(): def test_indoor_load_points_from_file():
......
import numpy as np import numpy as np
from mmdet3d.datasets.pipelines.indoor_sample import PointSample from mmdet3d.datasets.pipelines import PointSample
def test_indoor_sample(): 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