Repository navigation
Tiled rendering for large COG (geotiff) files, with an optional second image for before/after comparison #2763
Replies: 2 comments 1 reply
|
Thanks for bringing this up and for referencing PR #2750! I agree that tiled/pyramid rendering would be a valuable next step for handling large GeoTIFF files in Labelme. PR #2750 focuses on avoiding unnecessary decoding when an image exceeds Qt's size limits. Supporting tiled rendering would be a natural follow-up, although it would require a broader change to the image-loading and rendering pipeline. I think starting with local tiled GeoTIFF/COG support, while keeping annotations in full-resolution image coordinates, would be a reasonable first step. I'd be interested in exploring this further, depending on the maintainers' thoughts on the overall approach. |
|
My general rule (for myself) is that labelme core stays a general 2D image annotator. Features specific to one domain should live in plugins (which don't exist yet #2155 ). Otherwise there is no clear line, and the next requests are point clouds and 3D. Under that rule, this request splits in two. Tiled rendering of large images goes in core. Pathology slides, microscopy, and large scans hit the same limit as GeoTIFF, so it isn't geo-specific. I think it should be kept up to:
The geo-specific parts go in a plugin. That covers reading georeferencing (geotransforms, .jgw sidecars), aligning two images by their geo coordinates, opening remote COGs, and tagging shapes with before/after imagery IDs and dates. labelme has no plugin system yet. I'm designing one in #2155, starting with exporters, importers, and AI backends, followed by an image source hook. A geo plugin would build on that hook and on core tiled rendering. Once the API exists, a geo plugin would be a good real-world test of it. |
Uh oh!
There was an error while loading. Please reload this page.
What to build
Note I created historical-satellite, an oss app based on maplibre which does offer the below suggested feature-set of split-mode, see docs for screens:
Off, Overlay or Side-by-Side(2x1 default, but can go up to 4x2). Adding such geospatial raster time-series annotation capabilities to labelme would be tremendously helpful to change detection/classification by experts and annotators.This request can probably be split 3-fold:
#2418 describes the cost of failing on a large GeoTIFF and PR #2750 by @tongwentao fixes that by rejecting oversized images from the header before decoding. You noted in 2418 that tiled or pyramid rendering is a separate, larger feature request. This is that request: after 2750, a 37296 x 49319 GeoTIFF fails in milliseconds instead of minutes, but it still cannot be opened.
Additional context
Use case: land-use change monitoring or damage assessment on dated satellite imagery.
Below is an inspection of that request by an agent in case it's useful
Agent inspection
QImage.tifffilealready reads tiles and overview pages lazily, so this stays within current dependencies. TheImageTooLargeErrorpath introduced in 2750 is the natural branch point: when the image is too large for a single QImage but has internal tiles or overviews, open it through the tiled reader instead of raising. Shapes remain in full-resolution pixel coordinates so the JSON format does not change.https://ands3://COG URLs with HTTP range requests, same code path as above. Useful for teams whose imagery already lives in object storage.compare_image_pathfield in the JSON records which image was used. Reading the geotransform is the same step GeoJSON export for annotations #2209 needs for GeoJSON export.Drafted with AI assistance from Claude Fable 5.1
All reactions