add script for parsing data
This commit is contained in:
@@ -6,11 +6,13 @@ import math
|
|||||||
import os
|
import os
|
||||||
import pickle
|
import pickle
|
||||||
import shutil
|
import shutil
|
||||||
from scenarionet.common_utils import save_summary_anda_mapping
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import tqdm
|
import tqdm
|
||||||
from metadrive.scenario import ScenarioDescription as SD
|
from metadrive.scenario import ScenarioDescription as SD
|
||||||
|
|
||||||
|
from scenarionet.common_utils import save_summary_anda_mapping
|
||||||
|
|
||||||
logger = logging.getLogger(__file__)
|
logger = logging.getLogger(__file__)
|
||||||
|
|
||||||
|
|
||||||
@@ -81,7 +83,8 @@ def write_to_directory(
|
|||||||
if force_overwrite:
|
if force_overwrite:
|
||||||
delay_remove = save_path
|
delay_remove = save_path
|
||||||
else:
|
else:
|
||||||
raise ValueError("Directory already exists! Abort")
|
raise ValueError("Directory already exists! Abort."
|
||||||
|
"\n Try setting force_overwrite=True or using --overwrite")
|
||||||
|
|
||||||
summary_file = SD.DATASET.SUMMARY_FILE
|
summary_file = SD.DATASET.SUMMARY_FILE
|
||||||
mapping_file = SD.DATASET.MAPPING_FILE
|
mapping_file = SD.DATASET.MAPPING_FILE
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ if __name__ == '__main__':
|
|||||||
help="Dataset name, will be used to generate scenario files")
|
help="Dataset name, will be used to generate scenario files")
|
||||||
parser.add_argument("--dataset_path", "-d", default=os.path.join(SCENARIONET_DATASET_PATH, "nuplan"),
|
parser.add_argument("--dataset_path", "-d", default=os.path.join(SCENARIONET_DATASET_PATH, "nuplan"),
|
||||||
help="The path of the dataset")
|
help="The path of the dataset")
|
||||||
parser.add_argument("--version", "-v", default='v1.1', required=True, help="version")
|
parser.add_argument("--version", "-v", default='v1.1', help="version")
|
||||||
parser.add_argument("--overwrite", action="store_true", help="If the dataset_path exists, overwrite it")
|
parser.add_argument("--overwrite", action="store_true", help="If the dataset_path exists, overwrite it")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ if __name__ == '__main__':
|
|||||||
help="Dataset name, will be used to generate scenario files")
|
help="Dataset name, will be used to generate scenario files")
|
||||||
parser.add_argument("--dataset_path", "-d", default=os.path.join(SCENARIONET_DATASET_PATH, "nuscenes"),
|
parser.add_argument("--dataset_path", "-d", default=os.path.join(SCENARIONET_DATASET_PATH, "nuscenes"),
|
||||||
help="The path of the dataset")
|
help="The path of the dataset")
|
||||||
parser.add_argument("--version", "-v", default='v1.0-mini', required=True, help="version")
|
parser.add_argument("--version", "-v", default='v1.0-mini', help="version")
|
||||||
parser.add_argument("--overwrite", action="store_true", help="If the dataset_path exists, overwrite it")
|
parser.add_argument("--overwrite", action="store_true", help="If the dataset_path exists, overwrite it")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ if __name__ == '__main__':
|
|||||||
help="Dataset name, will be used to generate scenario files")
|
help="Dataset name, will be used to generate scenario files")
|
||||||
parser.add_argument("--dataset_path", "-d", default=os.path.join(SCENARIONET_DATASET_PATH, "pg"),
|
parser.add_argument("--dataset_path", "-d", default=os.path.join(SCENARIONET_DATASET_PATH, "pg"),
|
||||||
help="The path of the dataset")
|
help="The path of the dataset")
|
||||||
parser.add_argument("--version", "-v", default=metadrive.constants.DATA_VERSION, required=True, help="version")
|
parser.add_argument("--version", "-v", default=metadrive.constants.DATA_VERSION, help="version")
|
||||||
parser.add_argument("--overwrite", action="store_true", help="If the dataset_path exists, overwrite it")
|
parser.add_argument("--overwrite", action="store_true", help="If the dataset_path exists, overwrite it")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ if __name__ == '__main__':
|
|||||||
help="Dataset name, will be used to generate scenario files")
|
help="Dataset name, will be used to generate scenario files")
|
||||||
parser.add_argument("--dataset_path", "-d", default=os.path.join(SCENARIONET_DATASET_PATH, "waymo"),
|
parser.add_argument("--dataset_path", "-d", default=os.path.join(SCENARIONET_DATASET_PATH, "waymo"),
|
||||||
help="The path of the dataset")
|
help="The path of the dataset")
|
||||||
parser.add_argument("--version", "-v", default='v1.2', required=True, help="version")
|
parser.add_argument("--version", "-v", default='v1.2', help="version")
|
||||||
parser.add_argument("--overwrite", action="store_true", help="If the dataset_path exists, overwrite it")
|
parser.add_argument("--overwrite", action="store_true", help="If the dataset_path exists, overwrite it")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user