SAM3 v0#3
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a new SAM3 Segmentation plugin: a pip-installable Lightly Studio operator that runs HuggingFace SAM3 prompt-driven instance segmentation, registers the plugin, includes packaging, docs, license, and implements image inference and annotation creation. ChangesSAM3 Segmentation plugin
Sequence Diagram(s)sequenceDiagram
participant Ctx as ExecutionContext
participant Op as SAM3SegmentationOperator
participant Sam as Sam3Model/Processor
participant IS as Image Store
participant AR as AnnotationResolver
Ctx->>Op: execute(session, context, parameters)
Op->>Op: resolve collection, params, device
Op->>Sam: load model & processor on device
Op->>IS: iterate samples
loop per sample
IS->>Op: provide image bytes
Op->>Op: load RGB image, compute target size
Op->>Sam: run processor & model -> boxes, masks, scores
Sam->>Op: return detections
Op->>Op: prepare_segmentation_entries (clamp boxes, masks->RLE)
Op->>Op: accumulate AnnotationCreate objects
end
Op->>AR: create_many(annotations)
AR->>Op: return created count
Op->>Ctx: return OperatorResult(success, count)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
|
Does not work for me: Will check for access and the hub |
MalteEbner
left a comment
There was a problem hiding this comment.
Also asked codex for a review, 4 out of its 5 points are valid, posted them here.
MalteEbner
left a comment
There was a problem hiding this comment.
My previous comments have all been addressed, thanks :) Found some new points and mypy is failing.
What has changed and why?
This PR add SAM3 support as plugin.
To test it, run
uv pip install "git+https://github.com/lightly-ai/lightly-studio-plugins.git@jonas-add-sam3-plugins#subdirectory=plugins/sam3_segmentation"in the env that you are running lightlyStudio in. This will automatically register the plugin.
You may also require access to sam3. for this follow the steps in the README
How has it been tested?
MacBook Pro M4. Successfully able to segment with SAM
Did you update Readme.md and plugins.toml?
Summary by CodeRabbit
New Features
Documentation
Chores