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
937e7f88
Unverified
Commit
937e7f88
authored
Oct 12, 2022
by
Qing Lian
Committed by
GitHub
Oct 12, 2022
Browse files
fix data loading, formating bugs and dataset path (#1913)
parent
fc679dc8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
8 deletions
+11
-8
configs/_base_/datasets/waymoD5-3d-3class.py
configs/_base_/datasets/waymoD5-3d-3class.py
+4
-3
mmdet3d/datasets/transforms/formating.py
mmdet3d/datasets/transforms/formating.py
+3
-1
mmdet3d/datasets/transforms/loading.py
mmdet3d/datasets/transforms/loading.py
+1
-1
mmdet3d/datasets/transforms/transforms_3d.py
mmdet3d/datasets/transforms/transforms_3d.py
+3
-3
No files found.
configs/_base_/datasets/waymoD5-3d-3class.py
View file @
937e7f88
...
@@ -88,7 +88,8 @@ train_dataloader = dict(
...
@@ -88,7 +88,8 @@ train_dataloader = dict(
type
=
dataset_type
,
type
=
dataset_type
,
data_root
=
data_root
,
data_root
=
data_root
,
ann_file
=
'waymo_infos_train.pkl'
,
ann_file
=
'waymo_infos_train.pkl'
,
data_prefix
=
dict
(
pts
=
'training/velodyne'
),
data_prefix
=
dict
(
pts
=
'training/velodyne'
,
sweeps
=
'training/velodyne'
),
pipeline
=
train_pipeline
,
pipeline
=
train_pipeline
,
modality
=
input_modality
,
modality
=
input_modality
,
test_mode
=
False
,
test_mode
=
False
,
...
@@ -107,7 +108,7 @@ val_dataloader = dict(
...
@@ -107,7 +108,7 @@ val_dataloader = dict(
dataset
=
dict
(
dataset
=
dict
(
type
=
dataset_type
,
type
=
dataset_type
,
data_root
=
data_root
,
data_root
=
data_root
,
data_prefix
=
dict
(
pts
=
'training/velodyne'
),
data_prefix
=
dict
(
pts
=
'training/velodyne'
,
sweeps
=
'training/velodyne'
),
ann_file
=
'waymo_infos_val.pkl'
,
ann_file
=
'waymo_infos_val.pkl'
,
pipeline
=
eval_pipeline
,
pipeline
=
eval_pipeline
,
modality
=
input_modality
,
modality
=
input_modality
,
...
@@ -124,7 +125,7 @@ test_dataloader = dict(
...
@@ -124,7 +125,7 @@ test_dataloader = dict(
dataset
=
dict
(
dataset
=
dict
(
type
=
dataset_type
,
type
=
dataset_type
,
data_root
=
data_root
,
data_root
=
data_root
,
data_prefix
=
dict
(
pts
=
'training/velodyne'
),
data_prefix
=
dict
(
pts
=
'training/velodyne'
,
sweeps
=
'training/velodyne'
),
ann_file
=
'waymo_infos_val.pkl'
,
ann_file
=
'waymo_infos_val.pkl'
,
pipeline
=
eval_pipeline
,
pipeline
=
eval_pipeline
,
modality
=
input_modality
,
modality
=
input_modality
,
...
...
mmdet3d/datasets/transforms/formating.py
View file @
937e7f88
...
@@ -63,6 +63,7 @@ class Pack3DDetInputs(BaseTransform):
...
@@ -63,6 +63,7 @@ class Pack3DDetInputs(BaseTransform):
def
__init__
(
def
__init__
(
self
,
self
,
keys
:
tuple
,
meta_keys
:
tuple
=
(
'img_path'
,
'ori_shape'
,
'img_shape'
,
'lidar2img'
,
meta_keys
:
tuple
=
(
'img_path'
,
'ori_shape'
,
'img_shape'
,
'lidar2img'
,
'depth2img'
,
'cam2img'
,
'pad_shape'
,
'depth2img'
,
'cam2img'
,
'pad_shape'
,
'scale_factor'
,
'flip'
,
'pcd_horizontal_flip'
,
'scale_factor'
,
'flip'
,
'pcd_horizontal_flip'
,
...
@@ -74,7 +75,8 @@ class Pack3DDetInputs(BaseTransform):
...
@@ -74,7 +75,8 @@ class Pack3DDetInputs(BaseTransform):
'affine_aug'
,
'sweep_img_metas'
,
'ori_cam2img'
,
'affine_aug'
,
'sweep_img_metas'
,
'ori_cam2img'
,
'cam2global'
,
'crop_offset'
,
'img_crop_offset'
,
'cam2global'
,
'crop_offset'
,
'img_crop_offset'
,
'resize_img_shape'
,
'lidar2cam'
,
'ori_lidar2img'
,
'resize_img_shape'
,
'lidar2cam'
,
'ori_lidar2img'
,
'num_ref_frames'
,
'num_views'
,
'ego2global'
))
->
None
:
'num_ref_frames'
,
'num_views'
,
'ego2global'
)
)
->
None
:
self
.
keys
=
keys
self
.
keys
=
keys
self
.
meta_keys
=
meta_keys
self
.
meta_keys
=
meta_keys
...
...
mmdet3d/datasets/transforms/loading.py
View file @
937e7f88
...
@@ -165,7 +165,7 @@ class LoadMultiViewImageFromFiles(BaseTransform):
...
@@ -165,7 +165,7 @@ class LoadMultiViewImageFromFiles(BaseTransform):
results
[
'ori_cam2img'
]
=
copy
.
deepcopy
(
results
[
'cam2img'
])
results
[
'ori_cam2img'
]
=
copy
.
deepcopy
(
results
[
'cam2img'
])
if
self
.
file_client
is
None
:
if
self
.
file_client
is
None
:
self
.
file_client
=
mm
cv
.
FileClient
(
**
self
.
file_client_args
)
self
.
file_client
=
mm
engine
.
FileClient
(
**
self
.
file_client_args
)
# img is of shape (h, w, c, num_views)
# img is of shape (h, w, c, num_views)
# h and w can be different for different views
# h and w can be different for different views
...
...
mmdet3d/datasets/transforms/transforms_3d.py
View file @
937e7f88
...
@@ -2245,7 +2245,7 @@ class PhotoMetricDistortion3D(PhotoMetricDistortion):
...
@@ -2245,7 +2245,7 @@ class PhotoMetricDistortion3D(PhotoMetricDistortion):
@
TRANSFORMS
.
register_module
()
@
TRANSFORMS
.
register_module
()
class
MultiViewWrapper
(
object
):
class
MultiViewWrapper
(
BaseTransform
):
"""Wrap transformation from single-view into multi-view.
"""Wrap transformation from single-view into multi-view.
The wrapper processes the images from multi-view one by one. For each
The wrapper processes the images from multi-view one by one. For each
...
@@ -2290,7 +2290,7 @@ class MultiViewWrapper(object):
...
@@ -2290,7 +2290,7 @@ class MultiViewWrapper(object):
'scale'
,
'scale_factor'
,
'crop_size'
,
'img_crop_offset'
,
'scale'
,
'scale_factor'
,
'crop_size'
,
'img_crop_offset'
,
'flip'
,
'flip_direction'
,
'photometric_param'
'flip'
,
'flip_direction'
,
'photometric_param'
]):
]):
self
.
transform
=
Compose
(
transforms
)
self
.
transform
s
=
Compose
(
transforms
)
self
.
override_aug_config
=
override_aug_config
self
.
override_aug_config
=
override_aug_config
self
.
collected_keys
=
collected_keys
self
.
collected_keys
=
collected_keys
self
.
process_fields
=
process_fields
self
.
process_fields
=
process_fields
...
@@ -2325,7 +2325,7 @@ class MultiViewWrapper(object):
...
@@ -2325,7 +2325,7 @@ class MultiViewWrapper(object):
for
key
in
self
.
process_fields
:
for
key
in
self
.
process_fields
:
if
key
in
input_dict
:
if
key
in
input_dict
:
process_dict
[
key
]
=
input_dict
[
key
][
img_id
]
process_dict
[
key
]
=
input_dict
[
key
][
img_id
]
process_dict
=
self
.
transform
(
process_dict
)
process_dict
=
self
.
transform
s
(
process_dict
)
# store the randomness variable in transformation.
# store the randomness variable in transformation.
prev_process_dict
=
process_dict
prev_process_dict
=
process_dict
...
...
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