-
-
Notifications
You must be signed in to change notification settings - Fork 360
Add support for SAM3 #430
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 support for SAM3 #430
Conversation
|
🚀 Deployed on https://692b69c543afa5089b5cdda8--opengeos.netlify.app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for Segment Anything Model 3 (SAM3) to the segment-geospatial package by introducing a new SamGeo3 class and related utilities. The implementation follows a similar pattern to the existing SAM2 support but adapts it for SAM3's architecture and API.
Key Changes:
- Introduces
SamGeo3class with text-based prompt segmentation capabilities - Adds device selection utility (
get_device()) to support CUDA, MPS, and CPU - Includes visualization utilities with perceptually uniform color generation
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 17 comments.
| File | Description |
|---|---|
| samgeo/samgeo3.py | New module implementing SAM3 integration with methods for image segmentation, mask generation, and visualization |
| samgeo/common.py | Adds get_device() helper function for automatic device selection across different hardware |
| samgeo/init.py | Exports the new samgeo3 module to make SamGeo3 class available |
| pyproject.toml | Adds samgeo3 optional dependency group with sam3 package requirement |
Comments suppressed due to low confidence (1)
samgeo/samgeo3.py:6
- Import of 'sys' is not used.
import sys
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci



Fix #426