microsoft / torchgeo

TorchGeo: datasets, samplers, transforms, and pre-trained models for geospatial data
https://www.osgeo.org/projects/torchgeo/
MIT License
2.8k stars 353 forks source link

SpaceNet datasets #159

Closed ashnair1 closed 2 years ago

ashnair1 commented 3 years ago

The SpaceNet Dataset contains ~67,000 square km of very high-resolution imagery, >11M building footprints, and ~20,000 km of road labels spread over 7 datasets:

spacenet

This issue is to track the addition of these datasets.

adamjstewart commented 2 years ago

Our conda-forge repo just caught the fact that the SpaceNet datasets import the affine library but we're missing a dependency on affine in setup.cfg. Is affine actually needed? If so, can you determine the minimum supported version and add it to setup.cfg?

ashnair1 commented 2 years ago

I believe I only explicitly imported affine for type annotations (in load_image and load_mask). The image transform of a rasterio image object is an Affine object.

Even if it was required, affine is a direct dependency of rasterio (for the above reason). I thought setup.cfg only includes direct dependencies of torchgeo and not its transitive dependencies.

Alternatively I could just replace Affine with Any from the typing module.

isaaccorley commented 2 years ago

This is a bit of a hack but could we just use 'from rasterio.transform import Affine' instead of 'from affine import Affine'?

adamjstewart commented 2 years ago

I thought setup.cfg only includes direct dependencies of torchgeo and not its transitive dependencies.

Correct, but if you directly import affine, that makes it a direct dependency.

I actually like @isaaccorley's suggestion, let's do that as long as it passes mypy.

adamjstewart commented 2 years ago

@ashnair1 where are we at with SpaceNet 6? Would love to be able to close this issue.

ashnair1 commented 2 years ago

SpaceNet 6 is currently unavailable on Radiant MLHub. I had raised radiantearth/radiant-mlhub#93 to track this among other issues with the SpaceNet datasets. Will give them a ping.