|
13 | 13 | from mmdet3d.registry import MODELS
|
14 | 14 | from mmdet3d.utils import OptConfigType
|
15 | 15 | from mmdet.models import DetDataPreprocessor
|
16 |
| -from mmdet.models.utils.misc import samplelist_boxtype2tensor |
17 | 16 | from .utils import multiview_img_stack_batch
|
18 | 17 |
|
19 | 18 |
|
20 |
| - |
21 | 19 | @MODELS.register_module()
|
22 | 20 | class Det3DDataPreprocessor(DetDataPreprocessor):
|
23 | 21 | """Points / Image pre-processor for point clouds / vision-only / multi-
|
@@ -90,7 +88,6 @@ def __init__(self,
|
90 | 88 | seg_pad_value=seg_pad_value,
|
91 | 89 | bgr_to_rgb=bgr_to_rgb,
|
92 | 90 | rgb_to_bgr=rgb_to_bgr,
|
93 |
| - boxtype2tensor=boxtype2tensor, |
94 | 91 | batch_augments=batch_augments)
|
95 | 92 | self.voxel = voxel
|
96 | 93 | self.voxel_type = voxel_type
|
@@ -170,9 +167,14 @@ def simple_process(self, data: dict, training: bool = False) -> dict:
|
170 | 167 | 'pad_shape': pad_shape
|
171 | 168 | })
|
172 | 169 |
|
173 |
| - if self.boxtype2tensor: |
| 170 | + if hasattr(self, 'boxtype2tensor') and self.boxtype2tensor: |
| 171 | + from mmdet.models.utils.misc import \ |
| 172 | + samplelist_boxtype2tensor |
174 | 173 | samplelist_boxtype2tensor(data_samples)
|
175 |
| - |
| 174 | + elif hasattr(self, 'boxlist2tensor') and self.boxlist2tensor: |
| 175 | + from mmdet.models.utils.misc import \ |
| 176 | + samplelist_boxlist2tensor |
| 177 | + samplelist_boxlist2tensor(data_samples) |
176 | 178 | if self.pad_mask:
|
177 | 179 | self.pad_gt_masks(data_samples)
|
178 | 180 |
|
|
0 commit comments