Download dataset_post_processing.py from InternRobotics/IROS-2025-Challenge-Manip: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/datasets/InternRobotics/IROS-2025-Challenge-Manip/resolve/refs%2Fpr%2F4/dataset_post_processing.py
- Command line
-
hf download hf://datasets/InternRobotics/IROS-2025-Challenge-Manip@refs/pr/4/dataset_post_processing.py
-
curl -L -o dataset_post_processing.py https://huggingface.co/datasets/InternRobotics/IROS-2025-Challenge-Manip/resolve/refs%2Fpr%2F4/dataset_post_processing.py
1.26 kB
| import argparse | |
| import os | |
| import subprocess | |
| def execute_in_directory(directory, command): | |
| original_dir = os.getcwd() | |
| try: | |
| os.chdir(directory) | |
| result = subprocess.run( | |
| command, | |
| shell=True, | |
| check=True, | |
| stdout=subprocess.PIPE, | |
| stderr=subprocess.PIPE, | |
| text=True | |
| ) | |
| # print(f"success:\n{result.stdout}") | |
| return result.returncode | |
| except subprocess.CalledProcessError as e: | |
| print(f"error:\n{e.stderr}") | |
| return e.returncode | |
| finally: | |
| os.chdir(original_dir) | |
| def main(root_dir): | |
| for root, _, files in os.walk(root_dir): | |
| if "scene.usd" in files: | |
| if os.path.exists(os.path.join(root, "SubUSDs")): | |
| bash_command = "rm ./SubUSDs" | |
| execute_in_directory(root, bash_command) | |
| bash_command = "ln -s ../SubUSDs ./SubUSDs" | |
| execute_in_directory(root, bash_command) | |
| if __name__ == "__main__": | |
| parser = argparse.ArgumentParser(description='add soft link file') | |
| parser.add_argument('val_dataset_path', | |
| type=str, | |
| help='dataset path') | |
| args = parser.parse_args() | |
| main(args.val_dataset_path) |