Skip to content

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

isaaccorley
Copy link
Collaborator

@isaaccorley isaaccorley commented Jul 8, 2025

This PR adds the Delineate Anything YOLO11x and YOLO11n pretrained models. This adds a models extras group to the dependencies to add the ultralytics 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"

image

Sample predictions on FTW imagery:
image
image
image
image

@isaaccorley isaaccorley added this to the 0.8.0 milestone Jul 8, 2025
@isaaccorley isaaccorley self-assigned this Jul 8, 2025
@isaaccorley isaaccorley requested a review from Copilot July 8, 2025 02:48
@github-actions github-actions bot added documentation Improvements or additions to documentation models Models and pretrained weights testing Continuous integration testing dependencies Packaging and dependencies labels Jul 8, 2025
Copilot

This comment was marked as outdated.

@adamjstewart
Copy link
Collaborator

@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.

@robmarkcole
Copy link
Contributor

@adamjstewart I think using optional imports is a good way to go

@adamjstewart
Copy link
Collaborator

@isaaccorley might need to find a way to update this error message:

ultralytics is not installed and is required to use this dataset. Either run:

$ pip install ultralytics

to install just this dependency, or:

$ pip install torchgeo[datasets]

to install all optional dataset dependencies.

@isaaccorley
Copy link
Collaborator Author

isaaccorley commented Jul 8, 2025

@isaaccorley might need to find a way to update this error message:


ultralytics is not installed and is required to use this dataset. Either run:



$ pip install ultralytics



to install just this dependency, or:



$ pip install torchgeo[datasets]



to install all optional dataset dependencies.

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

@isaaccorley isaaccorley force-pushed the models/delineate-anything branch from caf91c1 to 5f914d3 Compare July 8, 2025 18:34
@github-actions github-actions bot added the datasets Geospatial or benchmark datasets label Jul 8, 2025
@isaaccorley isaaccorley requested a review from Copilot July 8, 2025 19:09
Copy link

@Copilot Copilot AI left a 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 with yolo function and YOLO_Weights
  • Add a models extra for installing ultralytics 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasets Geospatial or benchmark datasets dependencies Packaging and dependencies documentation Improvements or additions to documentation models Models and pretrained weights testing Continuous integration testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants