-
Notifications
You must be signed in to change notification settings - Fork 448
Delineate Anything YOLO Model #2876
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
base: main
Are you sure you want to change the base?
Conversation
@robmarkcole wanted to check with you and see how you feel about this. Ultralytics would not be a required dependency, so this change shouldn't impact you. |
@adamjstewart I think using optional imports is a good way to go |
@isaaccorley might need to find a way to update this error message:
|
Yeah I saw this. I might save this for another PR because I'm going to add a group arg so that it prints out the correct extras to install like torchgeo[models] vs torchgeo[datasets] then I'll have to go back and fix everywhere that it's used. edit: @adamjstewart I went ahead and just changed the error message. PTAL |
caf91c1
to
5f914d3
Compare
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
Adds the Delineate Anything YOLO segmentation models to TorchGeo by introducing a new yolo
builder, registering its pretrained weights, and wiring up dependencies, tests, documentation, and CI.
- Introduce
torchgeo/models/yolo.py
withyolo
function andYOLO_Weights
- Add a
models
extra for installingultralytics
and update CI/configs - Expand tests, docs, torch hub integration, and project metadata to support YOLO
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
torchgeo/models/yolo.py | New YOLO wrapper and pretrained weight definitions |
torchgeo/models/api.py | Register yolo builder and YOLO_Weights in API |
torchgeo/models/init.py | Export yolo and YOLO_Weights in public API |
torchgeo/datasets/utils.py | Extend lazy_import instructions for models extra |
tests/models/test_yolo.py | Add unit tests for yolo builder and weights |
tests/models/test_api.py | Include YOLO in API tests with conditional skip |
requirements/models.txt | Pin ultralytics for the models extra |
pyproject.toml | Declare models extra and update all group |
hubconf.py | Expose yolo in Torch Hub and add ultralytics |
docs/api/models.rst | Document yolo function and YOLO_Weights |
docs/api/weights/agnostic.csv | List YOLO weights metadata |
.github/workflows/tests.yaml | Install models requirements in CI |
.github/workflows/style.yaml | Install models requirements in style CI job |
Comments suppressed due to low confidence (2)
tests/models/test_yolo.py:37
- Add an assertion to verify the returned object is an instance of nn.Module, e.g.,
model = yolo(...); assert isinstance(model, nn.Module)
.
yolo(weights=None, model='yolo11n.yaml', task='segment')
tests/models/test_yolo.py:40
- Include an assertion to confirm that
yolo(weights=mocked_weights)
returns an nn.Module, for example:model = yolo(weights=mocked_weights); assert isinstance(model, nn.Module)
.
yolo(weights=mocked_weights)
This PR adds the Delineate Anything YOLO11x and YOLO11n pretrained models. This adds a
models
extras group to the dependencies to add theultralytics
package. The models are available as AGPL-3.0 licensed.Note: the model is trained on a variety of satellite imagery with different resolutions so it's "spatial agnostic"
Sample predictions on FTW imagery:



