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
ed4135c3
Commit
ed4135c3
authored
May 22, 2020
by
liyinhao
Committed by
zhangwenwei
May 22, 2020
Browse files
Indoor dataset fix bug
parent
546fe9d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
15 deletions
+9
-15
mmdet3d/datasets/custom_3d.py
mmdet3d/datasets/custom_3d.py
+1
-1
mmdet3d/datasets/scannet_dataset.py
mmdet3d/datasets/scannet_dataset.py
+4
-6
mmdet3d/datasets/sunrgbd_dataset.py
mmdet3d/datasets/sunrgbd_dataset.py
+4
-8
No files found.
mmdet3d/datasets/custom_3d.py
View file @
ed4135c3
...
@@ -43,7 +43,7 @@ class Custom3DDataset(Dataset):
...
@@ -43,7 +43,7 @@ class Custom3DDataset(Dataset):
input_dict
=
dict
(
pts_filename
=
pts_filename
)
input_dict
=
dict
(
pts_filename
=
pts_filename
)
if
not
self
.
test_mode
:
if
not
self
.
test_mode
:
annos
=
self
.
get_ann_info
(
index
,
sample_idx
)
annos
=
self
.
get_ann_info
(
index
)
input_dict
[
'ann_info'
]
=
annos
input_dict
[
'ann_info'
]
=
annos
if
len
(
annos
[
'gt_bboxes_3d'
])
==
0
:
if
len
(
annos
[
'gt_bboxes_3d'
])
==
0
:
return
None
return
None
...
...
mmdet3d/datasets/scannet_dataset.py
View file @
ed4135c3
...
@@ -26,17 +26,16 @@ class ScanNetDataset(Custom3DDataset):
...
@@ -26,17 +26,16 @@ class ScanNetDataset(Custom3DDataset):
pts_filename
=
osp
.
join
(
self
.
data_root
,
f
'
{
sample_idx
}
_vert.npy'
)
pts_filename
=
osp
.
join
(
self
.
data_root
,
f
'
{
sample_idx
}
_vert.npy'
)
return
pts_filename
return
pts_filename
def
get_ann_info
(
self
,
index
,
sample_idx
):
def
get_ann_info
(
self
,
index
):
# Use index to get the annos, thus the evalhook could also use this api
# Use index to get the annos, thus the evalhook could also use this api
info
=
self
.
data_infos
[
index
]
info
=
self
.
data_infos
[
index
]
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
]
# k, 6
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
]
# k, 6
gt_labels_3d
=
info
[
'annos'
][
'class'
]
gt_labels_3d
=
info
[
'annos'
][
'class'
]
gt_bboxes_3d_mask
=
np
.
ones_like
(
gt_labels_3d
,
dtype
=
np
.
bool
)
else
:
else
:
gt_bboxes_3d
=
np
.
zeros
((
1
,
6
),
dtype
=
np
.
float32
)
gt_bboxes_3d
=
np
.
zeros
((
0
,
6
),
dtype
=
np
.
float32
)
gt_labels_3d
=
np
.
zeros
(
1
,
dtype
=
np
.
bool
)
gt_labels_3d
=
np
.
zeros
(
0
,
)
gt_bboxes_3d_mask
=
np
.
zeros
(
1
,
dtype
=
np
.
bool
)
sample_idx
=
info
[
'point_cloud'
][
'lidar_idx'
]
pts_instance_mask_path
=
osp
.
join
(
self
.
data_root
,
pts_instance_mask_path
=
osp
.
join
(
self
.
data_root
,
f
'
{
sample_idx
}
_ins_label.npy'
)
f
'
{
sample_idx
}
_ins_label.npy'
)
pts_semantic_mask_path
=
osp
.
join
(
self
.
data_root
,
pts_semantic_mask_path
=
osp
.
join
(
self
.
data_root
,
...
@@ -45,7 +44,6 @@ class ScanNetDataset(Custom3DDataset):
...
@@ -45,7 +44,6 @@ class ScanNetDataset(Custom3DDataset):
anns_results
=
dict
(
anns_results
=
dict
(
gt_bboxes_3d
=
gt_bboxes_3d
,
gt_bboxes_3d
=
gt_bboxes_3d
,
gt_labels_3d
=
gt_labels_3d
,
gt_labels_3d
=
gt_labels_3d
,
gt_bboxes_3d_mask
=
gt_bboxes_3d_mask
,
pts_instance_mask_path
=
pts_instance_mask_path
,
pts_instance_mask_path
=
pts_instance_mask_path
,
pts_semantic_mask_path
=
pts_semantic_mask_path
)
pts_semantic_mask_path
=
pts_semantic_mask_path
)
return
anns_results
return
anns_results
mmdet3d/datasets/sunrgbd_dataset.py
View file @
ed4135c3
...
@@ -25,20 +25,16 @@ class SUNRGBDDataset(Custom3DDataset):
...
@@ -25,20 +25,16 @@ class SUNRGBDDataset(Custom3DDataset):
f
'
{
sample_idx
:
06
d
}
.npy'
)
f
'
{
sample_idx
:
06
d
}
.npy'
)
return
pts_filename
return
pts_filename
def
get_ann_info
(
self
,
index
,
sample_idx
):
def
get_ann_info
(
self
,
index
):
# Use index to get the annos, thus the evalhook could also use this api
# Use index to get the annos, thus the evalhook could also use this api
info
=
self
.
data_infos
[
index
]
info
=
self
.
data_infos
[
index
]
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
if
info
[
'annos'
][
'gt_num'
]
!=
0
:
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
]
# k, 6
gt_bboxes_3d
=
info
[
'annos'
][
'gt_boxes_upright_depth'
]
# k, 6
gt_labels_3d
=
info
[
'annos'
][
'class'
]
gt_labels_3d
=
info
[
'annos'
][
'class'
]
gt_bboxes_3d_mask
=
np
.
ones_like
(
gt_labels_3d
,
dtype
=
np
.
bool
)
else
:
else
:
gt_bboxes_3d
=
np
.
zeros
((
1
,
6
),
dtype
=
np
.
float32
)
gt_bboxes_3d
=
np
.
zeros
((
0
,
7
),
dtype
=
np
.
float32
)
gt_labels_3d
=
np
.
zeros
(
1
,
dtype
=
np
.
bool
)
gt_labels_3d
=
np
.
zeros
(
0
,
)
gt_bboxes_3d_mask
=
np
.
zeros
(
1
,
dtype
=
np
.
bool
)
anns_results
=
dict
(
anns_results
=
dict
(
gt_bboxes_3d
=
gt_bboxes_3d
,
gt_bboxes_3d
=
gt_bboxes_3d
,
gt_labels_3d
=
gt_labels_3d
)
gt_labels_3d
=
gt_labels_3d
,
gt_bboxes_3d_mask
=
gt_bboxes_3d_mask
)
return
anns_results
return
anns_results
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