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
OpenPCDet
Commits
4996eb46
"vscode:/vscode.git/clone" did not exist on "de7ccbc2ea2593e65f52ddc8dced0cc01edd3d33"
Commit
4996eb46
authored
Aug 18, 2022
by
Shaoshuai Shi
Browse files
bugfixed: waymo_eval bug when training with speed
parent
1541d269
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
pcdet/datasets/waymo/waymo_dataset.py
pcdet/datasets/waymo/waymo_dataset.py
+5
-5
pcdet/datasets/waymo/waymo_eval.py
pcdet/datasets/waymo/waymo_eval.py
+6
-1
No files found.
pcdet/datasets/waymo/waymo_dataset.py
View file @
4996eb46
...
@@ -272,7 +272,7 @@ class WaymoDataset(DatasetTemplate):
...
@@ -272,7 +272,7 @@ class WaymoDataset(DatasetTemplate):
assert
gt_boxes_lidar
.
shape
[
-
1
]
==
9
assert
gt_boxes_lidar
.
shape
[
-
1
]
==
9
else
:
else
:
gt_boxes_lidar
=
gt_boxes_lidar
[:,
0
:
7
]
gt_boxes_lidar
=
gt_boxes_lidar
[:,
0
:
7
]
if
self
.
training
and
self
.
dataset_cfg
.
get
(
'FILTER_EMPTY_BOXES_FOR_TRAIN'
,
False
):
if
self
.
training
and
self
.
dataset_cfg
.
get
(
'FILTER_EMPTY_BOXES_FOR_TRAIN'
,
False
):
mask
=
(
annos
[
'num_points_in_gt'
]
>
0
)
# filter empty boxes
mask
=
(
annos
[
'num_points_in_gt'
]
>
0
)
# filter empty boxes
annos
[
'name'
]
=
annos
[
'name'
][
mask
]
annos
[
'name'
]
=
annos
[
'name'
][
mask
]
...
@@ -290,14 +290,13 @@ class WaymoDataset(DatasetTemplate):
...
@@ -290,14 +290,13 @@ class WaymoDataset(DatasetTemplate):
data_dict
.
pop
(
'num_points_in_gt'
,
None
)
data_dict
.
pop
(
'num_points_in_gt'
,
None
)
return
data_dict
return
data_dict
@
staticmethod
def
generate_prediction_dicts
(
self
,
batch_dict
,
pred_dicts
,
class_names
,
output_path
=
None
):
def
generate_prediction_dicts
(
batch_dict
,
pred_dicts
,
class_names
,
output_path
=
None
):
"""
"""
Args:
Args:
batch_dict:
batch_dict:
frame_id:
frame_id:
pred_dicts: list of pred_dicts
pred_dicts: list of pred_dicts
pred_boxes: (N, 7), Tensor
pred_boxes: (N, 7
or 9
), Tensor
pred_scores: (N), Tensor
pred_scores: (N), Tensor
pred_labels: (N), Tensor
pred_labels: (N), Tensor
class_names:
class_names:
...
@@ -308,9 +307,10 @@ class WaymoDataset(DatasetTemplate):
...
@@ -308,9 +307,10 @@ class WaymoDataset(DatasetTemplate):
"""
"""
def
get_template_prediction
(
num_samples
):
def
get_template_prediction
(
num_samples
):
box_dim
=
9
if
self
.
dataset_cfg
.
get
(
'TRAIN_WITH_SPEED'
,
False
)
else
7
ret_dict
=
{
ret_dict
=
{
'name'
:
np
.
zeros
(
num_samples
),
'score'
:
np
.
zeros
(
num_samples
),
'name'
:
np
.
zeros
(
num_samples
),
'score'
:
np
.
zeros
(
num_samples
),
'boxes_lidar'
:
np
.
zeros
([
num_samples
,
7
])
'boxes_lidar'
:
np
.
zeros
([
num_samples
,
box_dim
])
}
}
return
ret_dict
return
ret_dict
...
...
pcdet/datasets/waymo/waymo_eval.py
View file @
4996eb46
...
@@ -60,13 +60,18 @@ class OpenPCDetWaymoDetectionMetricsEstimator(tf.test.TestCase):
...
@@ -60,13 +60,18 @@ class OpenPCDetWaymoDetectionMetricsEstimator(tf.test.TestCase):
if
fake_gt_infos
:
if
fake_gt_infos
:
info
[
'gt_boxes_lidar'
]
=
boxes3d_kitti_fakelidar_to_lidar
(
info
[
'gt_boxes_lidar'
])
info
[
'gt_boxes_lidar'
]
=
boxes3d_kitti_fakelidar_to_lidar
(
info
[
'gt_boxes_lidar'
])
boxes3d
.
append
(
info
[
'gt_boxes_lidar'
][
box_mask
])
if
info
[
'gt_boxes_lidar'
].
shape
[
-
1
]
==
9
:
boxes3d
.
append
(
info
[
'gt_boxes_lidar'
][
box_mask
][:,
0
:
7
])
else
:
boxes3d
.
append
(
info
[
'gt_boxes_lidar'
][
box_mask
])
else
:
else
:
num_boxes
=
len
(
info
[
'boxes_lidar'
])
num_boxes
=
len
(
info
[
'boxes_lidar'
])
difficulty
.
append
([
0
]
*
num_boxes
)
difficulty
.
append
([
0
]
*
num_boxes
)
score
.
append
(
info
[
'score'
])
score
.
append
(
info
[
'score'
])
boxes3d
.
append
(
np
.
array
(
info
[
'boxes_lidar'
]))
boxes3d
.
append
(
np
.
array
(
info
[
'boxes_lidar'
]))
box_name
=
info
[
'name'
]
box_name
=
info
[
'name'
]
if
boxes3d
[
-
1
].
shape
[
-
1
]
==
9
:
boxes3d
[
-
1
]
=
boxes3d
[
-
1
][
", 0:7"
]
obj_type
+=
[
self
.
WAYMO_CLASSES
.
index
(
name
)
for
i
,
name
in
enumerate
(
box_name
)]
obj_type
+=
[
self
.
WAYMO_CLASSES
.
index
(
name
)
for
i
,
name
in
enumerate
(
box_name
)]
frame_id
.
append
(
np
.
array
([
frame_index
]
*
num_boxes
))
frame_id
.
append
(
np
.
array
([
frame_index
]
*
num_boxes
))
...
...
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