Skip to content

Conversation

@anujonthemove
Copy link

@anujonthemove anujonthemove commented May 13, 2025

This PR introduces an argparse-based Command-Line Interface (CLI) for grounded_sam2_local_demo.py to improve usability, flexibility, and compatibility especially for containerized environments.


Key Changes:

  • Replaces hardcoded file paths with CLI arguments using Python’s argparse.

  • Adds support for dynamically specifying:

    • Input image path
    • Text prompts
    • SAM2 checkpoint path and config
    • Grounding DINO config and checkpoint
    • Output directory
    • Thresholds and optional flags
  • Includes inline comments to clarify argument purpose and usage.


📌 How can this help:

  • Improved Usability:
    Users no longer need to modify the script manually for different datasets or experiments.

  • Container Compatibility:
    The original script's hardcoded paths made it difficult to run in Docker/Apptainer containers. The CLI allows dynamic path passing via mounted volumes or runtime parameters.

IMPORTANT NOTE:

This PR is depends on: #101

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant