From df6c21a2063a91f265cd282e6c6d5005141d7d3b Mon Sep 17 00:00:00 2001 From: Leonard Bruns Date: Thu, 14 Dec 2023 18:42:03 +0100 Subject: [PATCH] Use hyphen instead of underscore for example arguments --- examples/python/controlnet/README.md | 2 +- examples/python/controlnet/main.py | 4 ++-- examples/python/depth_guided_stable_diffusion/main.py | 10 +++++----- examples/python/detect_and_track_objects/main.py | 4 ++-- examples/python/human_pose_tracking/main.py | 4 ++-- examples/python/lidar/main.py | 6 +++--- examples/python/nuscenes/main.py | 6 +++--- examples/python/objectron/main.py | 2 +- examples/python/raw_mesh/main.py | 2 +- examples/python/signed_distance_fields/main.py | 2 +- .../python/structure_from_motion/read_write_model.py | 8 ++++---- 11 files changed, 25 insertions(+), 25 deletions(-) diff --git a/examples/python/controlnet/README.md b/examples/python/controlnet/README.md index a8086215f526..666de0ac6d48 100644 --- a/examples/python/controlnet/README.md +++ b/examples/python/controlnet/README.md @@ -18,5 +18,5 @@ python examples/python/controlnet/main.py You can specify your own image and prompts using ```bash -main.py [--img_path IMG_PATH] [--prompt PROMPT] [--negative_prompt NEGATIVE_PROMPT] +main.py [--img-path IMG_PATH] [--prompt PROMPT] [--negative-prompt NEGATIVE_PROMPT] ``` diff --git a/examples/python/controlnet/main.py b/examples/python/controlnet/main.py index 9cdc619072b1..53d6193d334f 100755 --- a/examples/python/controlnet/main.py +++ b/examples/python/controlnet/main.py @@ -107,7 +107,7 @@ def run_canny_controlnet(image_path: str, prompt: str, negative_prompt: str) -> def main() -> None: parser = argparse.ArgumentParser(description="Use Canny-conditioned ControlNet to generate image.") parser.add_argument( - "--img_path", + "--img-path", type=str, help="Path to image used as input for Canny edge detector.", default=RERUN_LOGO_URL, @@ -119,7 +119,7 @@ def main() -> None: default="aerial view, a futuristic research complex in a bright foggy jungle, hard lighting", ) parser.add_argument( - "--negative_prompt", + "--negative-prompt", type=str, help="Negative prompt used as input for ControlNet.", default="low quality, bad quality, sketches", diff --git a/examples/python/depth_guided_stable_diffusion/main.py b/examples/python/depth_guided_stable_diffusion/main.py index 6f659393339d..214fad722d40 100755 --- a/examples/python/depth_guided_stable_diffusion/main.py +++ b/examples/python/depth_guided_stable_diffusion/main.py @@ -60,8 +60,8 @@ def main() -> None: choices=IMAGE_NAMES, help="The example image to run on.", ) - parser.add_argument("--dataset_dir", type=Path, default=DATASET_DIR, help="Directory to save example images to.") - parser.add_argument("--image_path", type=str, default="", help="Full path to image to run on. Overrides `--image`.") + parser.add_argument("--dataset-dir", type=Path, default=DATASET_DIR, help="Directory to save example images to.") + parser.add_argument("--image-path", type=str, default="", help="Full path to image to run on. Overrides `--image`.") parser.add_argument( "--prompt", @@ -70,7 +70,7 @@ def main() -> None: default="A tired robot sitting down on a dirt floor. Rusty metal. Unreal Engine. Wall-e", ) parser.add_argument( - "--n_prompt", + "--n-prompt", type=str, help="Negative prompt describing what you don't want in the image you generate.", default="White uniform floor and background", @@ -88,7 +88,7 @@ def main() -> None: """, ) parser.add_argument( - "--guidance_scale", + "--guidance-scale", type=float, default=11, help=""" @@ -100,7 +100,7 @@ def main() -> None: """, ) parser.add_argument( - "--num_inference_steps", + "--num-inference-steps", type=int, default=10, help=""" diff --git a/examples/python/detect_and_track_objects/main.py b/examples/python/detect_and_track_objects/main.py index 50e64944269d..25cab6fe7235 100755 --- a/examples/python/detect_and_track_objects/main.py +++ b/examples/python/detect_and_track_objects/main.py @@ -446,8 +446,8 @@ def main() -> None: choices=["horses, driving", "boats"], help="The example video to run on.", ) - parser.add_argument("--dataset_dir", type=Path, default=DATASET_DIR, help="Directory to save example videos to.") - parser.add_argument("--video_path", type=str, default="", help="Full path to video to run on. Overrides `--video`.") + parser.add_argument("--dataset-dir", type=Path, default=DATASET_DIR, help="Directory to save example videos to.") + parser.add_argument("--video-path", type=str, default="", help="Full path to video to run on. Overrides `--video`.") parser.add_argument( "--max-frame", type=int, diff --git a/examples/python/human_pose_tracking/main.py b/examples/python/human_pose_tracking/main.py index 38bfffeb908f..60e712b03bf3 100755 --- a/examples/python/human_pose_tracking/main.py +++ b/examples/python/human_pose_tracking/main.py @@ -203,8 +203,8 @@ def main() -> None: choices=["backflip", "soccer"], help="The example video to run on.", ) - parser.add_argument("--dataset_dir", type=Path, default=DATASET_DIR, help="Directory to save example videos to.") - parser.add_argument("--video_path", type=str, default="", help="Full path to video to run on. Overrides `--video`.") + parser.add_argument("--dataset-dir", type=Path, default=DATASET_DIR, help="Directory to save example videos to.") + parser.add_argument("--video-path", type=str, default="", help="Full path to video to run on. Overrides `--video`.") parser.add_argument("--no-segment", action="store_true", help="Don't run person segmentation.") parser.add_argument( "--max-frame", diff --git a/examples/python/lidar/main.py b/examples/python/lidar/main.py index 17751652f700..31aeaed0f85d 100755 --- a/examples/python/lidar/main.py +++ b/examples/python/lidar/main.py @@ -75,18 +75,18 @@ def log_nuscenes_lidar(root_dir: pathlib.Path, dataset_version: str, scene_name: def main() -> None: parser = argparse.ArgumentParser(description="Visualizes lidar scans using the Rerun SDK.") parser.add_argument( - "--root_dir", + "--root-dir", type=pathlib.Path, default=DATASET_DIR, help="Root directory of nuScenes dataset", ) parser.add_argument( - "--scene_name", + "--scene-name", type=str, default="scene-0061", help="Scene name to visualize (typically of form 'scene-xxxx')", ) - parser.add_argument("--dataset_version", type=str, default="v1.0-mini", help="Scene id to visualize") + parser.add_argument("--dataset-version", type=str, default="v1.0-mini", help="Scene id to visualize") rr.script_add_args(parser) args = parser.parse_args() diff --git a/examples/python/nuscenes/main.py b/examples/python/nuscenes/main.py index d8e489358979..f8e6c36dfc29 100755 --- a/examples/python/nuscenes/main.py +++ b/examples/python/nuscenes/main.py @@ -201,18 +201,18 @@ def log_sensor_calibration(sample_data: dict[str, Any], nusc: nuscenes.NuScenes) def main() -> None: parser = argparse.ArgumentParser(description="Visualizes the nuScenes dataset using the Rerun SDK.") parser.add_argument( - "--root_dir", + "--root-dir", type=pathlib.Path, default=DATASET_DIR, help="Root directory of nuScenes dataset", ) parser.add_argument( - "--scene_name", + "--scene-name", type=str, default="scene-0061", help="Scene name to visualize (typically of form 'scene-xxxx')", ) - parser.add_argument("--dataset_version", type=str, default="v1.0-mini", help="Scene id to visualize") + parser.add_argument("--dataset-version", type=str, default="v1.0-mini", help="Scene id to visualize") rr.script_add_args(parser) args = parser.parse_args() diff --git a/examples/python/objectron/main.py b/examples/python/objectron/main.py index 121c3c49b305..5deb1ac7f2bf 100755 --- a/examples/python/objectron/main.py +++ b/examples/python/objectron/main.py @@ -267,7 +267,7 @@ def main() -> None: help="Reprocess video frames even if they already exist", ) parser.add_argument( - "--dataset_dir", type=Path, default=LOCAL_DATASET_DIR, help="Directory to save example videos to." + "--dataset-dir", type=Path, default=LOCAL_DATASET_DIR, help="Directory to save example videos to." ) rr.script_add_args(parser) diff --git a/examples/python/raw_mesh/main.py b/examples/python/raw_mesh/main.py index c7d6a9c2785b..cb18d38f8dfa 100755 --- a/examples/python/raw_mesh/main.py +++ b/examples/python/raw_mesh/main.py @@ -93,7 +93,7 @@ def main() -> None: help="The name of the scene to load", ) parser.add_argument( - "--scene_path", + "--scene-path", type=Path, help="Path to a scene to analyze. If set, overrides the `--scene` argument.", ) diff --git a/examples/python/signed_distance_fields/main.py b/examples/python/signed_distance_fields/main.py index 8d2417c269e9..9a78cbabfc80 100755 --- a/examples/python/signed_distance_fields/main.py +++ b/examples/python/signed_distance_fields/main.py @@ -187,7 +187,7 @@ def main() -> None: help="The name of the mesh to analyze", ) parser.add_argument( - "--mesh_path", + "--mesh-path", type=Path, help="Path to a mesh to analyze. If set, overrides the `--mesh` argument.", ) diff --git a/examples/python/structure_from_motion/read_write_model.py b/examples/python/structure_from_motion/read_write_model.py index 9598cdaeb188..683ecd544a5a 100644 --- a/examples/python/structure_from_motion/read_write_model.py +++ b/examples/python/structure_from_motion/read_write_model.py @@ -494,10 +494,10 @@ def rotmat2qvec(R): def main(): parser = argparse.ArgumentParser(description="Read and write COLMAP binary and text models") - parser.add_argument("--input_model", help="path to input model folder") - parser.add_argument("--input_format", choices=[".bin", ".txt"], help="input model format", default="") - parser.add_argument("--output_model", help="path to output model folder") - parser.add_argument("--output_format", choices=[".bin", ".txt"], help="output model format", default=".txt") + parser.add_argument("--input-model", help="path to input model folder") + parser.add_argument("--input-format", choices=[".bin", ".txt"], help="input model format", default="") + parser.add_argument("--output-model", help="path to output model folder") + parser.add_argument("--output-format", choices=[".bin", ".txt"], help="output model format", default=".txt") args = parser.parse_args() cameras, images, points3D = read_model(path=args.input_model, ext=args.input_format)