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
d154e24d
Unverified
Commit
d154e24d
authored
Aug 18, 2021
by
Tai-Wang
Committed by
GitHub
Aug 18, 2021
Browse files
Remove 2D annotations on Lyft (#867)
parent
255e993b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
32 deletions
+10
-32
tools/create_data.py
tools/create_data.py
+6
-32
tools/data_converter/lyft_converter.py
tools/data_converter/lyft_converter.py
+4
-0
No files found.
tools/create_data.py
View file @
d154e24d
...
@@ -81,45 +81,23 @@ def nuscenes_data_prep(root_path,
...
@@ -81,45 +81,23 @@ def nuscenes_data_prep(root_path,
f
'
{
out_dir
}
/
{
info_prefix
}
_infos_train.pkl'
)
f
'
{
out_dir
}
/
{
info_prefix
}
_infos_train.pkl'
)
def
lyft_data_prep
(
root_path
,
def
lyft_data_prep
(
root_path
,
info_prefix
,
version
,
max_sweeps
=
10
):
info_prefix
,
version
,
dataset_name
,
out_dir
,
max_sweeps
=
10
):
"""Prepare data related to Lyft dataset.
"""Prepare data related to Lyft dataset.
Related data consists of '.pkl' files recording basic infos,
Related data consists of '.pkl' files recording basic infos.
and 2D annotations.
Although the ground truth database and 2D annotations are not used in
Although the ground truth database is not used in Lyft, it can also be
Lyft, it can also be generated like nuScenes.
generated like nuScenes.
Args:
Args:
root_path (str): Path of dataset root.
root_path (str): Path of dataset root.
info_prefix (str): The prefix of info filenames.
info_prefix (str): The prefix of info filenames.
version (str): Dataset version.
version (str): Dataset version.
dataset_name (str): The dataset class name.
max_sweeps (int, optional): Number of input consecutive frames.
out_dir (str): Output directory of the groundtruth database info.
Defaults to 10.
Not used here if the groundtruth database is not generated.
max_sweeps (int): Number of input consecutive frames. Default: 10
"""
"""
lyft_converter
.
create_lyft_infos
(
lyft_converter
.
create_lyft_infos
(
root_path
,
info_prefix
,
version
=
version
,
max_sweeps
=
max_sweeps
)
root_path
,
info_prefix
,
version
=
version
,
max_sweeps
=
max_sweeps
)
if
version
==
'v1.01-test'
:
return
train_info_name
=
f
'
{
info_prefix
}
_infos_train'
val_info_name
=
f
'
{
info_prefix
}
_infos_val'
info_train_path
=
osp
.
join
(
root_path
,
f
'
{
train_info_name
}
.pkl'
)
info_val_path
=
osp
.
join
(
root_path
,
f
'
{
val_info_name
}
.pkl'
)
lyft_converter
.
export_2d_annotation
(
root_path
,
info_train_path
,
version
=
version
)
lyft_converter
.
export_2d_annotation
(
root_path
,
info_val_path
,
version
=
version
)
def
scannet_data_prep
(
root_path
,
info_prefix
,
out_dir
,
workers
):
def
scannet_data_prep
(
root_path
,
info_prefix
,
out_dir
,
workers
):
"""Prepare the info file for scannet dataset.
"""Prepare the info file for scannet dataset.
...
@@ -273,16 +251,12 @@ if __name__ == '__main__':
...
@@ -273,16 +251,12 @@ if __name__ == '__main__':
root_path
=
args
.
root_path
,
root_path
=
args
.
root_path
,
info_prefix
=
args
.
extra_tag
,
info_prefix
=
args
.
extra_tag
,
version
=
train_version
,
version
=
train_version
,
dataset_name
=
'LyftDataset'
,
out_dir
=
args
.
out_dir
,
max_sweeps
=
args
.
max_sweeps
)
max_sweeps
=
args
.
max_sweeps
)
test_version
=
f
'
{
args
.
version
}
-test'
test_version
=
f
'
{
args
.
version
}
-test'
lyft_data_prep
(
lyft_data_prep
(
root_path
=
args
.
root_path
,
root_path
=
args
.
root_path
,
info_prefix
=
args
.
extra_tag
,
info_prefix
=
args
.
extra_tag
,
version
=
test_version
,
version
=
test_version
,
dataset_name
=
'LyftDataset'
,
out_dir
=
args
.
out_dir
,
max_sweeps
=
args
.
max_sweeps
)
max_sweeps
=
args
.
max_sweeps
)
elif
args
.
dataset
==
'waymo'
:
elif
args
.
dataset
==
'waymo'
:
waymo_data_prep
(
waymo_data_prep
(
...
...
tools/data_converter/lyft_converter.py
View file @
d154e24d
import
mmcv
import
mmcv
import
numpy
as
np
import
numpy
as
np
import
os
import
os
from
logging
import
warning
from
lyft_dataset_sdk.lyftdataset
import
LyftDataset
as
Lyft
from
lyft_dataset_sdk.lyftdataset
import
LyftDataset
as
Lyft
from
os
import
path
as
osp
from
os
import
path
as
osp
from
pyquaternion
import
Quaternion
from
pyquaternion
import
Quaternion
...
@@ -217,6 +218,9 @@ def export_2d_annotation(root_path, info_path, version):
...
@@ -217,6 +218,9 @@ def export_2d_annotation(root_path, info_path, version):
info_path (str): Path of the info file.
info_path (str): Path of the info file.
version (str): Dataset version.
version (str): Dataset version.
"""
"""
warning
.
warn
(
'DeprecationWarning: 2D annotations are not used on the '
'Lyft dataset. The function export_2d_annotation will be '
'deprecated.'
)
# get bbox annotations for camera
# get bbox annotations for camera
camera_types
=
[
camera_types
=
[
'CAM_FRONT'
,
'CAM_FRONT'
,
...
...
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