Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add granularity parameter to control segmented object size #785

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HendricksJudy
Copy link

Fixes #770

Add granularity parameter to control segmented object granularity.

  • segment_anything/automatic_mask_generator.py

    • Add granularity parameter to SamAutomaticMaskGenerator class constructor.
    • Update generate method to blend smaller segments into larger ones based on the granularity parameter.
    • Add blend_segments method to handle the blending logic based on the granularity parameter.
  • scripts/amg.py

    • Add --granularity command-line argument to set the granularity of segmented objects.
    • Pass the granularity argument to the SamAutomaticMaskGenerator class.
  • README.md

    • Update documentation to include information about the new granularity parameter.
    • Add examples of how to use the granularity parameter in the Getting Started section.

Fixes facebookresearch#770

Add granularity parameter to control segmented object granularity.

* **segment_anything/automatic_mask_generator.py**
  - Add `granularity` parameter to `SamAutomaticMaskGenerator` class constructor.
  - Update `generate` method to blend smaller segments into larger ones based on the `granularity` parameter.
  - Add `blend_segments` method to handle the blending logic based on the `granularity` parameter.

* **scripts/amg.py**
  - Add `--granularity` command-line argument to set the granularity of segmented objects.
  - Pass the `granularity` argument to the `SamAutomaticMaskGenerator` class.

* **README.md**
  - Update documentation to include information about the new `granularity` parameter.
  - Add examples of how to use the `granularity` parameter in the `Getting Started` section.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define granularity of segmented areas
2 participants