Unverified Commit fc679dc8 authored by VVsssssk's avatar VVsssssk Committed by GitHub
Browse files

solve bc breaking (#1908)

parent 6d3518d0
...@@ -13,11 +13,9 @@ from torch.nn import functional as F ...@@ -13,11 +13,9 @@ from torch.nn import functional as F
from mmdet3d.registry import MODELS from mmdet3d.registry import MODELS
from mmdet3d.utils import OptConfigType from mmdet3d.utils import OptConfigType
from mmdet.models import DetDataPreprocessor from mmdet.models import DetDataPreprocessor
from mmdet.models.utils.misc import samplelist_boxtype2tensor
from .utils import multiview_img_stack_batch from .utils import multiview_img_stack_batch
@MODELS.register_module() @MODELS.register_module()
class Det3DDataPreprocessor(DetDataPreprocessor): class Det3DDataPreprocessor(DetDataPreprocessor):
"""Points / Image pre-processor for point clouds / vision-only / multi- """Points / Image pre-processor for point clouds / vision-only / multi-
...@@ -90,7 +88,6 @@ class Det3DDataPreprocessor(DetDataPreprocessor): ...@@ -90,7 +88,6 @@ class Det3DDataPreprocessor(DetDataPreprocessor):
seg_pad_value=seg_pad_value, seg_pad_value=seg_pad_value,
bgr_to_rgb=bgr_to_rgb, bgr_to_rgb=bgr_to_rgb,
rgb_to_bgr=rgb_to_bgr, rgb_to_bgr=rgb_to_bgr,
boxtype2tensor=boxtype2tensor,
batch_augments=batch_augments) batch_augments=batch_augments)
self.voxel = voxel self.voxel = voxel
self.voxel_type = voxel_type self.voxel_type = voxel_type
...@@ -170,9 +167,14 @@ class Det3DDataPreprocessor(DetDataPreprocessor): ...@@ -170,9 +167,14 @@ class Det3DDataPreprocessor(DetDataPreprocessor):
'pad_shape': pad_shape 'pad_shape': pad_shape
}) })
if self.boxtype2tensor: if hasattr(self, 'boxtype2tensor') and self.boxtype2tensor:
from mmdet.models.utils.misc import \
samplelist_boxtype2tensor
samplelist_boxtype2tensor(data_samples) samplelist_boxtype2tensor(data_samples)
elif hasattr(self, 'boxlist2tensor') and self.boxlist2tensor:
from mmdet.models.utils.misc import \
samplelist_boxlist2tensor
samplelist_boxlist2tensor(data_samples)
if self.pad_mask: if self.pad_mask:
self.pad_gt_masks(data_samples) self.pad_gt_masks(data_samples)
......
...@@ -6,7 +6,9 @@ try: ...@@ -6,7 +6,9 @@ try:
except ImportError: except ImportError:
IS_SPCONV2_AVAILABLE = False IS_SPCONV2_AVAILABLE = False
else: else:
if hasattr(spconv, '__version__') and spconv.__version__ >= '2.0.0': if hasattr(spconv,
'__version__') and spconv.__version__ >= '2.0.0' and hasattr(
spconv, 'pytorch'):
IS_SPCONV2_AVAILABLE = register_spconv2() IS_SPCONV2_AVAILABLE = register_spconv2()
else: else:
IS_SPCONV2_AVAILABLE = False IS_SPCONV2_AVAILABLE = False
......
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