PG+waymo+nuscenes

This commit is contained in:
QuanyiLi
2023-08-27 18:17:47 +01:00
parent 1c59ee0421
commit 8fff2c215c
5 changed files with 111 additions and 4 deletions

View File

@@ -2,6 +2,10 @@
PG PG
############ ############
| Website: https://metadriverse.github.io/metadrive/
| Download: *N/A (collected online)*
| Paper: https://arxiv.org/pdf/2109.12674.pdf
The PG scenarios are collected by running simulation and record the episodes in MetaDrive simulator. The PG scenarios are collected by running simulation and record the episodes in MetaDrive simulator.
The name PG refers to Procedural Generation, which is a technique used to generate maps. The name PG refers to Procedural Generation, which is a technique used to generate maps.
When a map is determined, the vehicles and objects will be spawned and actuated according to a hand-crafted rules. When a map is determined, the vehicles and objects will be spawned and actuated according to a hand-crafted rules.

View File

@@ -2,6 +2,109 @@
nuScenes nuScenes
############################# #############################
| Website: https://www.nuscenes.org/nuscenes
| Download: https://www.nuscenes.org/nuscenes (Registration required)
| Paper: https://arxiv.org/pdf/1903.11027.pdf
The nuScenes dataset (pronounced /nuːsiːnz/) is a public large-scale dataset for autonomous driving developed by the team at Motional (formerly nuTonomy).
Motional is making driverless vehicles a safe, reliable, and accessible reality.
By releasing a subset of our data to the public,
Motional aims to support public research into computer vision and autonomous driving.
For this purpose nuScenes contains 1000 driving scenes in Boston and Singapore,
two cities that are known for their dense traffic and highly challenging driving situations.
The scenes of 20 second length are manually selected to show a diverse and interesting set of driving maneuvers,
traffic situations and unexpected behaviors.
The rich complexity of nuScenes will encourage development of methods that enable safe driving in urban areas with dozens of objects per scene.
Gathering data on different continents further allows us to study the generalization of computer vision algorithms across different locations, weather conditions, vehicle types, vegetation, road markings and left versus right hand traffic.
1. Install nuScenes Toolkit
============================
First of all, we have to install the ``nuscenes-devkit``.
.. code-block:: bash
# install from github (Recommend)
git clone git@github.com:nutonomy/nuscenes-devkit.git
cd nuscenes-devkit/setup
pip install -e .
# or install from PyPI
pip install nuscenes-devkit
# or install with scenarionet
pip install -e .[nuscenes]
By installing from github, you can access examples and source code the toolkit.
The examples are useful to verify whether the installation and dataset setup is correct or not.
2. Download nuScenes Data
==============================
The official instruction is available at https://github.com/nutonomy/nuscenes-devkit#nuscenes-setup.
Here we provide a simplified installation procedure.
First of all, please complete the registration on nuScenes website: https://www.nuscenes.org/nuscenes.
After this, go to the Download section and download the following files/expansions:
- mini/train/test splits
- Can bus expansion
- Map expansion
We recommend to download the mini split first to verify and get yourself familiar with the process.
All downloaded files are ``.tgz`` files and can be uncompressed by ``tar -zxf xyz.tgz``.
Secondly, all files should be organized to the following structure::
/nuscenes/data/path/
├── maps/
| ├──basemap/
| ├──prediction/
| ├──expansion/
| └──...
├── samples/
| ├──CAM_BACK
| └──...
├── sweeps/
| ├──CAM_BACK
| └──...
├── v1.0-mini/
| ├──attribute.json
| ├──calibrated_sensor.json
| ├──map.json
| ├──log.json
| ├──ego_pose.json
| └──...
└── v1.0-trainval/
The ``/nuscenes/data/path`` should be ``/data/sets/nuscenes`` by default according to the official instructions,
allowing the ``nuscens-devkit`` to find it.
But you can still place it to any other places and:
- build a soft link connect your data folder and ``/data/sets/nuscenes``
- or specify the ``dataroot`` when calling nuScenes APIs and our convertors.
After this step, the examples in ``nuscenes-devkit`` is supposed to work well.
Please try ``nuscenes-devkit/python-sdk/tutorials/nuscenes_tutorial.ipynb`` and see if the demo can successfully run.
3. Build nuScenes Database
===========================
After setup the raw data, convertors in ScenarioNet can read the raw data, convert scenario format and build the database.
Here we take converting raw data in ``nuscenes-mini`` as an example::
python -m scenarionet.convert_waymo -d /path/to/your/database --version v1.0-mini --dataroot /nuscens/data/path
The ``version`` is to determine which split to convert. ``dataroot`` is set to ``/data/sets/nuscenes`` by default,
but you need to specify it if your data is stored in any other directory.
Now all converted scenarios will be placed at ``/path/to/your/database`` and are ready to be used in your work.
Known Issues: nuScenes Known Issues: nuScenes
======================= =======================

View File

@@ -83,6 +83,5 @@ Here we take converting raw data in ``training_20s`` as an example::
Now all converted scenarios will be placed at ``/path/to/your/database`` and are ready to be used in your work. Now all converted scenarios will be placed at ``/path/to/your/database`` and are ready to be used in your work.
Known Issues: Waymo Known Issues: Waymo
===================== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
N/A N/A

View File

@@ -24,6 +24,7 @@ if __name__ == '__main__':
default='v1.0-mini', default='v1.0-mini',
help="version of nuscenes data, scenario of this version will be converted " help="version of nuscenes data, scenario of this version will be converted "
) )
parser.add_argument("--dataroot", default="/data/sets/nuscenes", help="The path of nuscenes data")
parser.add_argument("--overwrite", action="store_true", help="If the database_path exists, whether to overwrite it") parser.add_argument("--overwrite", action="store_true", help="If the database_path exists, whether to overwrite it")
parser.add_argument("--num_workers", type=int, default=8, help="number of workers to use") parser.add_argument("--num_workers", type=int, default=8, help="number of workers to use")
args = parser.parse_args() args = parser.parse_args()
@@ -33,8 +34,7 @@ if __name__ == '__main__':
output_path = args.database_path output_path = args.database_path
version = args.version version = args.version
dataroot = '/home/shady/data/nuscenes' scenarios, nuscs = get_nuscenes_scenarios(args.dataroot, version, args.num_workers)
scenarios, nuscs = get_nuscenes_scenarios(dataroot, version, args.num_workers)
write_to_directory( write_to_directory(
convert_func=convert_nuscenes_scenario, convert_func=convert_nuscenes_scenario,

View File

@@ -75,6 +75,7 @@ setup(
"waymo": waymo, "waymo": waymo,
"nuplan": nuplan, "nuplan": nuplan,
"nuscenes": nuscenes, "nuscenes": nuscenes,
"all": nuscenes + waymo + nuplan
}, },
include_package_data=True, include_package_data=True,
license="Apache 2.0", license="Apache 2.0",