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
422d3154
Commit
422d3154
authored
May 13, 2020
by
liyinhao
Browse files
add scannet dataset
parent
7cd3060e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
18 deletions
+20
-18
mmdet3d/datasets/scannet_dataset.py
mmdet3d/datasets/scannet_dataset.py
+19
-17
tests/test_scannet_dataset.py
tests/test_scannet_dataset.py
+1
-1
No files found.
mmdet3d/datasets/scannet_dataset.py
View file @
422d3154
...
...
@@ -134,7 +134,7 @@ class ScannetDataset(torch_data.Dataset):
return
input_dict
def
_get_pts_filename
(
self
,
sample_idx
):
pts_filename
=
os
.
path
.
join
(
self
.
data_path
,
sample_idx
+
'
_vert.npy'
)
pts_filename
=
os
.
path
.
join
(
self
.
data_path
,
f
'
{
sample_idx
}
_vert.npy'
)
mmcv
.
check_file_exist
(
pts_filename
)
return
pts_filename
...
...
@@ -150,9 +150,9 @@ class ScannetDataset(torch_data.Dataset):
gt_labels
=
np
.
zeros
(
1
,
).
astype
(
np
.
bool
)
gt_bboxes_3d_mask
=
np
.
zeros
(
1
,
).
astype
(
np
.
bool
)
pts_instance_mask_path
=
osp
.
join
(
self
.
data_path
,
sample_idx
+
'
_ins_label.npy'
)
f
'
{
sample_idx
}
_ins_label.npy'
)
pts_semantic_mask_path
=
osp
.
join
(
self
.
data_path
,
sample_idx
+
'
_sem_label.npy'
)
f
'
{
sample_idx
}
_sem_label.npy'
)
anns_results
=
dict
(
gt_bboxes_3d
=
gt_bboxes_3d
,
...
...
@@ -167,19 +167,13 @@ class ScannetDataset(torch_data.Dataset):
return
np
.
random
.
choice
(
pool
)
def
_generate_annotations
(
self
,
output
):
'''
transfer input_dict & pred_dicts to anno format
which is needed by AP calculator
return annos: a tuple (batch_pred_map_cls,batch_gt_map_cls)
batch_pred_map_cls is a list: i=0,1..bs-1
pred_list_i:[(pred_sem_cls,
box_params, box_score)_j]
j=0,1..num_pred_obj -1
batch_gt_map_cls is a list: i=0,1..bs-1
gt_list_i: [(sem_cls_label, box_params)_j]
j=0,1..num_gt_obj -1
'''
"""Generate Annotations.
Transform results of the model to the form of the evaluation.
Args:
output (List): The output of the model.
"""
result
=
[]
bs
=
len
(
output
)
for
i
in
range
(
bs
):
...
...
@@ -209,7 +203,15 @@ class ScannetDataset(torch_data.Dataset):
results
.
append
(
result
)
return
results
def
evaluate
(
self
,
results
,
metric
=
None
,
logger
=
None
,
pklfile_prefix
=
None
):
def
evaluate
(
self
,
results
,
metric
=
None
):
"""Evaluate.
Evaluation in indoor protocol.
Args:
results (List): List of result.
metric (dict): AP_IOU_THRESHHOLDS.
"""
results
=
self
.
_format_results
(
results
)
from
mmdet3d.core.evaluation
import
indoor_eval
assert
(
'AP_IOU_THRESHHOLDS'
in
metric
)
...
...
tests/test_scannet_dataset.py
View file @
422d3154
...
...
@@ -2,7 +2,7 @@ import numpy as np
import
pytest
import
torch
from
mmdet3d.datasets
.scannet_dataset
import
ScannetDataset
from
mmdet3d.datasets
import
ScannetDataset
def
test_getitem
():
...
...
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