From ce810a904542fdfac977657c07d96adb41a339a3 Mon Sep 17 00:00:00 2001 From: anandhu-eng Date: Mon, 24 Feb 2025 11:59:38 +0530 Subject: [PATCH] add script to download waymo calibration dataset --- .../COPYRIGHT.md | 9 +++++ .../customize.py | 35 +++++++++++++++++++ .../get-dataset-waymo-calibration/meta.yaml | 35 +++++++++++++++++++ .../run-rclone.sh | 4 +++ 4 files changed, 83 insertions(+) create mode 100644 script/get-dataset-waymo-calibration/COPYRIGHT.md create mode 100644 script/get-dataset-waymo-calibration/customize.py create mode 100644 script/get-dataset-waymo-calibration/meta.yaml create mode 100644 script/get-dataset-waymo-calibration/run-rclone.sh diff --git a/script/get-dataset-waymo-calibration/COPYRIGHT.md b/script/get-dataset-waymo-calibration/COPYRIGHT.md new file mode 100644 index 000000000..d2ceead84 --- /dev/null +++ b/script/get-dataset-waymo-calibration/COPYRIGHT.md @@ -0,0 +1,9 @@ +# Copyright Notice + +© 2025-2026 MLCommons. All Rights Reserved. + +This file is licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License can be obtained at: + +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software distributed under the License is provided on an "AS IS" basis, without warranties or conditions of any kind, either express or implied. Please refer to the License for the specific language governing permissions and limitations under the License. diff --git a/script/get-dataset-waymo-calibration/customize.py b/script/get-dataset-waymo-calibration/customize.py new file mode 100644 index 000000000..e404aa512 --- /dev/null +++ b/script/get-dataset-waymo-calibration/customize.py @@ -0,0 +1,35 @@ +from mlc import utils +import os + + +def preprocess(i): + + os_info = i['os_info'] + + env = i['env'] + + if os_info['platform'] == "windows": + return {'return': 1, 'error': 'Script not supported in windows yet!'} + + if env.get('MLC_DATASET_WAYMO_CALIBRATION_PATH', '') != '': + if not os.path.exists(env['MLC_DATASET_WAYMO_CALIBRATION_PATH']): + return { + 'return': 1, 'error': f"Path {env['MLC_DATASET_WAYMO_CALIBRATION_PATH']} does not exists!"} + else: + env['MLC_TMP_REQUIRE_DOWNLOAD'] = "yes" + if env['MLC_DOWNLOAD_SRC'] == "mlcommons": + i['run_script_input']['script_name'] = 'run-rclone' + if env.get('MLC_OUTDIRNAME', '') != '': + env['MLC_DATASET_WAYMO_CALIBRATION_PATH'] = env['MLC_OUTDIRNAME'] + else: + env['MLC_DATASET_WAYMO_CALIBRATION_PATH'] = os.path.join( + os.getcwd(), "kitti_format", "calibration") + + return {'return': 0} + + +def postprocess(i): + + env = i['env'] + + return {'return': 0} diff --git a/script/get-dataset-waymo-calibration/meta.yaml b/script/get-dataset-waymo-calibration/meta.yaml new file mode 100644 index 000000000..dbc17d494 --- /dev/null +++ b/script/get-dataset-waymo-calibration/meta.yaml @@ -0,0 +1,35 @@ +alias: get-dataset-waymo-calibration +automation_alias: script +automation_uid: 5b4e0237da074764 +cache: true +input_mapping: + waymo_calibration_path: MLC_DATASET_WAYMO_CALIBRATION_PATH +new_env_keys: +- MLC_DATASET_WAYMO_CALIBRATION_PATH +tags: +- get +- waymo +- dataset +- calibration +uid: 59d3a8d48d5e4767 +variations: + kitti_format: + default: true + env: + MLC_DATASET_WAYMO_FORMAT: kitti + group: dataset-format + mlc: + default: true + env: + MLC_DOWNLOAD_SRC: mlcommons + group: download-src + prehook_deps: + - enable_if_env: + MLC_TMP_REQUIRE_DOWNLOAD: + - true + tags: get,rclone + - enable_if_env: + MLC_TMP_REQUIRE_DOWNLOAD: + - true + force_cache: true + tags: get,rclone-config,_waymo diff --git a/script/get-dataset-waymo-calibration/run-rclone.sh b/script/get-dataset-waymo-calibration/run-rclone.sh new file mode 100644 index 000000000..fd289eff4 --- /dev/null +++ b/script/get-dataset-waymo-calibration/run-rclone.sh @@ -0,0 +1,4 @@ +cmd="rclone sync mlc-waymo:waymo_preprocessed_dataset/kitti_format/testing ${MLC_DATASET_WAYMO_CALIBRATION_PATH} -P" +echo $cmd +eval $cmd +test $? -eq 0 || exit $? \ No newline at end of file