Граф коммитов

468 Коммитов

Автор SHA1 Сообщение Дата
Isaac Corley 4cc0cbb327
Add ChaBuD Dataset (#1259)
* add chabud dataset and datamodule

* add clarifying comment for min/max

* fix wrong channel plotting

* cast image as float

* sort uuids

* add chabud dataset and datamodule

* add clarifying comment for min/max

* fix wrong channel plotting

* cast image as float

* sort uuids

* add chabud dataset and datamodule

* add clarifying comment for min/max

* fix wrong channel plotting

* cast image as float

* sort uuids

* update docs

* update test data

* fix order of operations

* update chabud config

* update per suggestions

* fix mypy error

* update to new test config format

* update version added

* use DatasetNotFoundError

* fix tests

* updates per suggestions

* Matching bands/mean/std

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-11-25 15:19:20 -06:00
Isaac Corley 8c24c80bb3
Satlas pretrained Swin Transformer v2 models (#1358)
* add satlas pretrained models

* update swin_b -> swin_v2_b

* update docs

* swin_b -> swin_v2_b again

* add the tests

* tests

* fix isort error

* update weights csv files

* swin_v2_b added in torchvision 0.14 so update min reqs

* fix swin_v2_b weights api

* torchvision 0.14.0 depends on torch 1.13.0

* fix docs

* fix docs

* fix swin docs

* update comment and import from root module

* update torch/torchvision min versions

* Move to satellite-specific tables

* Move to satellite-specific tables

---------

Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-11-25 20:39:43 +00:00
Isaac Corley cd1be7a2c4
ObjectDetectionTask: increase test coverage for torchvision 0.14+ (#1739)
* fix test coverage in trainers validation step

* add tests for multilabelclassificationtask

* Minimal bug fix for now

* Simpler random code

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-11-25 16:55:50 +00:00
shreyakannan1205 bc5cb4c83f
Adding Northeastern China Crop Map Dataset (#1666)
* Add files via upload

Initial commit for adding Northeastern China Crop Map dataset

* Added northeastern_china_cropmap (NCCM) definition to _init_.py

* Update northeastern_china_cropmap.py

* Added tests/data

* added test_nccm.py

* Updated datasets.rst and geo_datasets.csv

* Latest changes to nccm.py

* changes to data.py, nccm.py, test_nccm.py

* Update test_nccm.py

* Debug 1

* new changes

* Latest update

* Update torchgeo/datasets/nccm.py

Co-authored-by: Yi-Chia Chang <61452667+yichiac@users.noreply.github.com>

* Fixed style errors

* Fixed style errors

* Fixed style errors

* Update docs/api/datasets.rst

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update torchgeo/datasets/nccm.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update torchgeo/datasets/nccm.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Delete tests/data/nccm/.DS_Store

* Update data.py

* Update nccm.py

* Update torchgeo/datasets/nccm.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update torchgeo/datasets/nccm.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update torchgeo/datasets/nccm.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update torchgeo/datasets/nccm.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update nccm.py

* Update nccm.py

* Resolved few comments

* Fixed plotting functions, resolved comments

* Fixed test cases

* Fixed doc issue

* Latest

* Fixed doc

* Latest

* Latest

* Latest

* Update torchgeo/datasets/nccm.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Latest changes: removed years

* Update torchgeo/datasets/nccm.py

Co-authored-by: Yi-Chia Chang <61452667+yichiac@users.noreply.github.com>

* Update torchgeo/datasets/nccm.py

Co-authored-by: Yi-Chia Chang <61452667+yichiac@users.noreply.github.com>

* Update torchgeo/datasets/nccm.py

Co-authored-by: Yi-Chia Chang <61452667+yichiac@users.noreply.github.com>

* Update torchgeo/datasets/nccm.py

Co-authored-by: Yi-Chia Chang <61452667+yichiac@users.noreply.github.com>

* Update torchgeo/datasets/nccm.py

Co-authored-by: Yi-Chia Chang <61452667+yichiac@users.noreply.github.com>

* Update torchgeo/datasets/nccm.py

Co-authored-by: Yi-Chia Chang <61452667+yichiac@users.noreply.github.com>

* Removed unnecessary variables and fixed download path

* Latest changes

* Latest changes

* Latest changes

* Fixed spacing

* Latest changes

* Update torchgeo/datasets/nccm.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update docs/api/geo_datasets.csv

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update nccm.py

* Update data.py

* Update nccm.py

* Update torchgeo/datasets/nccm.py

Co-authored-by: Yi-Chia Chang <61452667+yichiac@users.noreply.github.com>

* latest changes

* Latest

* Latest changes

* Fixed torch.full()

* removed print linke

---------

Co-authored-by: shreya28 <“shreya28@illinois.edu”>
Co-authored-by: Yi-Chia Chang <61452667+yichiac@users.noreply.github.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-11-17 21:25:07 +00:00
Dylan Stewart bec09c245d
Trainers: skip weights and augmentations when saving hparams (#1670)
* Update base.py to fix for custom augmentations

* Allow subclasses to ignore specific arguments

* Fix typing

* Save to self.weights

* pyupgrade

* Add test

* Save weights

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-11-10 08:33:39 -06:00
Adam J. Stewart 2c65e1d592
Datasets: consistent error messages for missing data (#1714)
* Datasets: consistent error messages for missing data

* Fix issues

* Increase test coverage

* mypy fixes

* isort fixes
2023-11-07 05:53:10 -08:00
Nils Lehmann fa1862ab2b
Fix Download Link AGB Live Woody Biomass dataset (#1713)
* fix link

* one line link
2023-11-05 14:59:07 -06:00
Robin Cole 1fb03013c8
Add data module for LEVIR-CD+ dataset (#1707)
* add file

* Add to init

* refactor

* format

* isort

* match to oscd

* Add test

* remove mean and std

* update docstring with versionadded

* address test issues

* fix init

* fix init dataset

* fix type hint

* import

* add fixture

* import pytest

* make image float

* fix plotting

* isort

* mock download

* fix import

* satisfy mypy

* Fix fixture for TestLEVIRCDPlusDataModule

* fix imports

* Fix test values

* fix test values

* add val_split_pct=0.5

* Prevent divide by zero

* Update torchgeo/datamodules/levircd.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update torchgeo/datasets/levircd.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* remove cast import

* remove unused parameterization

* Return cast

* address mypy

* try again mypy

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-11-01 11:16:51 -05:00
Adrian Tofting 32a7307329
Add check if path is vsi (#1612)
* Add check if path is vsi

* Add url to reference for apache vsi syntax

* Add missing check to if

* Copy rasterio SCHEMES definition into torchgeo

* Check all schemes, not only last

* Simplify method path_is_vsi

* Add tests

* Remove print

* Update test names

* Add missing comma in list

* Update torchgeo/datasets/utils.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update torchgeo/datasets/utils.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Use pytest tmp_path for test

* Warn if some of input paths are invalid

* Update docstring for mocked class

* Handle tests failing due to UserWarning

* Remove unnecessary filterwarning

* Test CustomGeoDataset instead of MockRasterDataset

* Merge two similar tests

* str instead of as_posix

Wait with pathlib syntax

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

---------

Co-authored-by: Adrian Tofting <adrian@vake.ai>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-10-31 14:07:41 +00:00
Robin Cole 9e78960b58
Update levircd (#1696)
* Update levircd

* fix test_getitem
2023-10-28 08:23:59 -05:00
Robin Cole 7ca0593728
OSCD: fine-grained band selection, separate images (#1684)
* Access bands as list

* Update plotting

* Clarify RGB indexing

* Update OSCDDataModule approach to mean and std

* Update AugmentationSequential

* Remove unused import

* satisfy mypy

* update test

* Define rgb_indices attribute

* Fix test

* fix typo in test

* Fix dataset test

* black format

* Address most changes in dataset

* Update transform

* update dataset tests

* update datamodule tests

* Update datamodule

* black format dataset

* flake8 fixes

* Fix bands

* fix dataset tests

* Doc Raises and add test

* Shorter strings

* Update Raises docstring info
2023-10-23 15:38:34 +00:00
Adam J. Stewart ff27e2c296
Headless PyVista plots (#1667) 2023-10-20 15:23:13 +00:00
Adam J. Stewart 27a8c12768
MapInWild: prevent download during testing (#1657) 2023-10-13 13:32:46 -07:00
Adam J. Stewart 68f37da155
0.5.0 release (#1604)
* 0.5.0 release

* Fix caching hash

* Warnings not raised because not final layer

* Skip tests that require optional deps

* Isort fixes

* Fix? ChesapeakeCVPR tests

* Hack to avoid GeoDataset bug
2023-09-30 16:43:39 -05:00
Nils Lehmann 18139b440b
SSL4EO-L Weights (#1482)
* ssl4eo landsat 18 weights

* add resnet and vit moco weights under new hf repo

* add simclr ssl checkpoint

* add docs

* order models and new csv tablesf for docs

* adjust spacing of table

* lots of numbers and formatting

* missing resnet etm-sr weights

* fix failing tests

* check slow tests

* Fix URL checksum

* fix weight names

* Use 2 digits for all metrics

* hyphen -> en dash

* Use 2 digits for all metrics

* Landsat first

* EOL char before EOF char

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-09-30 13:50:43 -05:00
Adrian Tofting 3532f78383
Feature/refactor vector root to paths (#1597)
* Make RasterDataset accept list of files

* Fix check if str

* Use isdir and isfile

* Rename root to paths and update type hint

* Update children of RasterDataset methods using root

* Fix check to cast str to list

* Update conf files for RasterDatasets

* Add initial suggested test

* Add workaround for lists LandCoverAIBase

* Add method handle_nonlocal_path for users to override

* Raise RuntimeError to support existing tests

* Remove reduntand cast to set

* Remove required os.exists for paths

* Revert "Remove required os.exists for paths"

This reverts commit 84bf62b944326c33d5ba8efdcab615c65b124792.

* Use arg  as potitional argument not kwarg

* Improve comments and logs about arg paths

* Remove misleading comment

* Change type hint of 'paths' to Iterable

* Change type hint of 'paths' to Iterable

* Remove premature handling of non-local paths

* Replace root with paths in docstrings

* Add versionadded to list_files docstring

* Add versionchanged to docstrings

* Update type of paths in childred of Raster

* Replace docstring for paths in all raster

* Swap root with paths for conf files for raster

* Add newline before versionchanged

* Revert name to root in conf for ChesapeakeCVPR

* Simplify EUDEM tests

* paths must be a string if you want autodownload support

* Convert list_files to a property

* Fix type hints

* Test with a real empty directory

* Move property `files` up to GeoDataset

* Rename root to paths for VectorDataset

* Fix mypy

* Fix tests

* Delete duplicate code

* Delete duplicate code

* Fix test coverage

* Document name change

---------

Co-authored-by: Adrian Tofting <adriantofting@mobmob14994.hq.k.grp>
Co-authored-by: Adrian Tofting <adrian@vake.ai>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-09-29 17:39:04 +00:00
Tarandeep Singh 6ae0d78448
Added functionality for validation split (#1540)
* added functionality for validation split

* Changed "valid" to "val"

* updated docstring & removed redundant lists

* Fixed format with Linters

* Add more testing files

* Simplify regex

* Update datamodule to use new val split

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-09-29 11:02:19 -05:00
Nils Lehmann 76f92f86df
Add BioMassters Dataset (#1560)
* outline of dataset class

* outline of dataset class

* test data outline

* setup dataset structure

* load bands

* create test data

* test file outline

* fix data reading

* add unit tests

* try to fix failing windows test

* Fix type hints

* Fix Windows tests

* Fix flake8

* adress comments

* remove left over download stuff and comments

* Minor style changes

* Remove unused import

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-09-29 09:48:16 -05:00
Adrian Tofting 3cef4fb21d
Allow RasterDataset to accept list of files (#1442)
* Make RasterDataset accept list of files

* Fix check if str

* Use isdir and isfile

* Rename root to paths and update type hint

* Update children of RasterDataset methods using root

* Fix check to cast str to list

* Update conf files for RasterDatasets

* Add initial suggested test

* Add workaround for lists LandCoverAIBase

* Add method handle_nonlocal_path for users to override

* Raise RuntimeError to support existing tests

* Remove reduntand cast to set

* Remove required os.exists for paths

* Revert "Remove required os.exists for paths"

This reverts commit 84bf62b944326c33d5ba8efdcab615c65b124792.

* Use arg  as potitional argument not kwarg

* Improve comments and logs about arg paths

* Remove misleading comment

* Change type hint of 'paths' to Iterable

* Change type hint of 'paths' to Iterable

* Remove premature handling of non-local paths

* Replace root with paths in docstrings

* Add versionadded to list_files docstring

* Add versionchanged to docstrings

* Update type of paths in childred of Raster

* Replace docstring for paths in all raster

* Swap root with paths for conf files for raster

* Add newline before versionchanged

* Revert name to root in conf for ChesapeakeCVPR

* Simplify EUDEM tests

* paths must be a string if you want autodownload support

* Convert list_files to a property

* Fix type hints

* Test with a real empty directory

* More diverse tests

* LandCoverAI: don't yet support list of paths

* Black

* isort

---------

Co-authored-by: Adrian Tofting <adriantofting@mobmob14994.hq.k.grp>
Co-authored-by: Adrian Tofting <adrian@vake.ai>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-09-29 09:28:07 -05:00
Caleb Robinson 51ffb698ee
Add empirical sampling mode to the RCF model (#1339)
* Initial commit

* Fix practically all the problems

* Add docs

* Bruh

* np.typing in quotes because that makes more sense

* make really sure that mosaiks does stuff

* Consolidating RCFs

* Work

* formatting

* coverage

* Update torchgeo/models/rcf.py

* Minor style changes

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-09-29 08:55:11 -05:00
Burak c51014c656
Add MapInWild dataset (#1131)
* add mapinwild dataset

* add copyright and move the header

* Apply suggestions from code review

accept suggestions

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* add spaces between sections

* test_black

* test_isort

* test_flake8

* dataset instance and test data

Improves the dataset instance and test data script.

* improvements in test script and dataset class

* update test data

* Update mapinwild.py

* Update mapinwild.py

fix typo

* Update mapinwild.py

* improved test coverage and bug fixes

* improved test coverage

* lazy import pandas

* test coverage for pandas

* test coverage for pandas

* Changes after the review

The changes made after the review.

* delete data

* fix mypy

* fix mypy

* delete residual files

* fix type hinting

* Apply suggestions from code review

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Apply suggestions from code review

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Apply suggestions from code review

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* fix RtD

* fix RtD

* fix syntax

* fix RtD

* fix file namings

* modality naming fix

* fix hidden method naming

* Update torchgeo/datasets/mapinwild.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* address reviews

* refactoring and testing

- passing test_download with monkeypatch
- refactoring
- addressing most of the comments

* fix mypy

* syntax and type conversion

* Update torchgeo/datasets/mapinwild.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* addressing the comments

* fix mypy plt.Figure not defined

* make the _merge_parts slimmer

* pandas and reviews

* monkeypatch tvt sets

* Simplify MonkeyPatch import

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-09-29 10:52:08 +00:00
Caleb Robinson b6d78b74c3
Adding the RwandaFieldBoundary dataset (#1574)
* Initial commit

* Add to docs

* Pyupgrade

* Pyupgrade

* Added tests

* who actually cares about lines that are 91 characters long

* Using Figure from matplotlib.figure instead of matplotlib.pyplot to make mypy happy even though they are the same thing

* Documentation updates

* Update docs link

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-09-29 10:34:51 +00:00
Adam J. Stewart 984e222790
Add command line script (#1559)
* Add command line script

* Label PRs correctly

* Flake8 fix

* Add callbacks

* Update all conf files

* Enforce class of model/data

* Update BYOL tests

* Update all tests

* Use default num workers: 0

* Variable interpolation only supported by omegaconf backend

* Fix regression tests

* Ensure that jsonargparse is installed during testing

* Bump minimimum lightning version

* Workaround for lightning/jsonargparse bugs

* Ignore Python 3.9 warning message

* Add test coverage for __main__.py

* Increase coverage of PixelwiseRegressionTask

* jsonargparse bug fixed in latest release

* Revert "jsonargparse bug fixed in latest release"

This reverts commit 4f38cdfca3.

* Use default logging frequency

* Ensure that metrics are actually logged

* Fix ObjectDetectionTask logging

* Ignore type errors

* Not all need to be ignored
2023-09-27 10:11:52 -07:00
Adam J. Stewart 1b0ca5a5a8
Ensure that none of our minimum version tests are skipped (#1587)
* Ensure that none of our minimum version tests are skipped

* Try pyvista instead

* Try no version

* What is going on

* Try pyvista 0.32.0

* Try pyvista 0.35.0

* Try pyvista 0.35.1

* Try pyvista 0.34.0

* Try pyvista 0.34.2

* Try pyvista 0.34.1

* 0.34.2 is the new min version
2023-09-25 10:51:36 -05:00
Adam J. Stewart dbf7a5287f
Promote pandas to a required dependency (#1586)
* Promote pandas to a required dependency

* Update dep files too

* Remove unused imports
2023-09-25 08:09:12 -07:00
Nils Lehmann 242fa909c3
Move SKIPPD to HF and add forecast task (#1548)
* move to hf and adapt tests

* comments

* requested changes

* dim typo

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-09-24 12:56:54 -05:00
Dominik K b796bbd1d3
adding seasonet dataset + tests + doc (#1466)
* adding seasonet dataset + tests + doc changes

* Fixed docs

* Added tests for missing imports

* Use collections.abc

* Changed some docstrings and comments

* Check parameters using sets

* Changed cmap and interpolation for masks

* Removed requests dependency

* Shortened some lines

* Fixed pandas warning

* Improve documentation of raised error types

---------

Co-authored-by: Viktor Brack <viktor.brack@tu-dortmund.de>
Co-authored-by: Viktor B <39567028+briktor@users.noreply.github.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-09-24 14:17:50 +00:00
dependabot[bot] 2fbdc85efd
Bump matplotlib from 3.7.3 to 3.8.0 in /requirements (#1566)
* Bump matplotlib from 3.7.3 to 3.8.0 in /requirements

Bumps [matplotlib](https://github.com/matplotlib/matplotlib) from 3.7.3 to 3.8.0.
- [Release notes](https://github.com/matplotlib/matplotlib/releases)
- [Commits](https://github.com/matplotlib/matplotlib/compare/v3.7.3...v3.8.0)

---
updated-dependencies:
- dependency-name: matplotlib
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Use canonical import location

* Use canonical import location

* Use canonical import location

* More type fixes

* More type fixes

* More type fixes

* More type fixes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-09-21 11:35:57 +00:00
Adam J. Stewart 578adedc31
Refactor trainers (#1541)
* Refactor trainers

* Update conf files

* Fix pydocstyle

* Add scheduler monitor

* Update conf files

* Fix BYOL backbone

* Remove broken configure_optimizers out type

* Fix type hints

* No casts

* Increase test coverage

* Better documentation of supported models

* Remove unimportant configuration

* Remove unimportant configuration

* Drop model_kwargs

* Docstring improvements

* Add base class for all torchgeo trainers

* Add configure_* methods for losses/metrics/models

* init must come first

* More type hints
2023-09-11 17:05:28 -05:00
Adam J. Stewart ef5c8de28b
Use pytest parametrize cross product (#1504)
* Use pytest parametrize cross product

* Bug fixes
2023-08-06 18:51:11 -05:00
Isaac Corley 711a576e38
PASTIS dataset (#315)
* draft

* add dataset to __init__

* reorganize datasets and datamodules

* fix mypy errors

* draft

* add dataset to __init__

* reorganize datasets and datamodules

* fix mypy errors

* refactor

* Adding docs

* Adding plotting, cleaning up some stuff

* Black and isort

* Fix the datamodule import

* Pyupgrade

* Fixing some docstrings

* Flake8

* Isort

* Fix docstrings in datamodules

* Fixing fns and docstring

* Trying to fix the docs

* Trying to fix docs

* Adding tests

* Black

* newline

* Made the test dataset larger

* Remove the datamodules

* Update docs/api/non_geo_datasets.csv

Co-authored-by: Isaac Corley <22203655+isaaccorley@users.noreply.github.com>

* Update torchgeo/datasets/pastis.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update torchgeo/datasets/pastis.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Update torchgeo/datasets/pastis.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Updating cmap

* Describe the different band combinations

* Merging datasets

* Handle the instance segmentation case in plotting

* Update torchgeo/datasets/pastis.py

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* Made some code prettier

* Adding instance plotting

---------

Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-08-03 11:46:49 -07:00
Adam J. Stewart 9d6d6837dc
DataModules: improve error messages (#1441)
* DataModules: better error messages

* Fix batch size bug

* Fix type hints

* Use in one additional place

* Fix BatchGeoSampler batch size

* Increase test coverage
2023-07-07 17:31:13 -05:00
ntw-au b0ae5be35d
fix: Support tensors and arrays for class_weight (#1413)
Avoids ambiguous truth value ValueError when the class_weight input
parameter is either a PyTorch tensor or a NumPy array.

Includes new tests for SemanticSegmentationTask's class_weight
parameter.
2023-07-07 17:30:16 -05:00
Adam J. Stewart 38be536b86
SSL4EO-L: add download support (#1424)
* SSL4EO-L: add download support

* Placate pydocstyle

* Meaning of root changed

* Missing one

* Incremental tarball concatenation

* Placate black

* Add download times
2023-06-20 11:54:10 -05:00
dependabot[bot] 0eb86c7731
Bump pytest from 7.3.1 to 7.3.2 in /requirements (#1411)
* Bump pytest from 7.3.1 to 7.3.2 in /requirements

Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.1 to 7.3.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.3.1...7.3.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* pytest fixed some type hints

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-06-13 03:22:21 +00:00
dependabot[bot] 2f0458db44
Bump lightning from 2.0.2 to 2.0.3 in /requirements (#1406)
* Bump lightning from 2.0.2 to 2.0.3 in /requirements

Bumps [lightning](https://github.com/Lightning-AI/lightning) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/Lightning-AI/lightning/releases)
- [Commits](https://github.com/Lightning-AI/lightning/compare/2.0.2...2.0.3)

---
updated-dependencies:
- dependency-name: lightning
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update datamodule base class

* Check attributes first

* Fix remaining type hints

* More fixes

* Try again

* Try casting

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-06-08 04:11:19 +00:00
Adam J. Stewart 9e57f27818
CDL/NLCD/SSL4EO: allow selection of classes (#1392)
* CDL/NLCD/SSL4EO: allow selection of classes

* 0 is already 0

* Get NLCD tests to pass

* Search recursively for NLCD files

* Update CDL

* Update SSL4EO-L Benchmark

* Passing tests

* Test SSL4EO-L Benchmark

* Test CDL

* Test NLCD

* Mypy fix

* Remove debugging code
2023-06-04 08:21:05 -07:00
Caleb Robinson 108c94bb9b
Test fewer models in trainers to avoid exceeding RAM (#1377)
* Stop the madness

* isort

* flake8

* Repeat for other trainers

* Parentheses not needed

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-05-29 11:28:36 -05:00
Nils Lehmann 22ee95226f
SSL4EO Landsat Downstream Dataset/module CDL, NLCD (#1338)
* outline downstream dataset

* revert commit

* outline of downstream dataset

* some work

* add test data

* run black

* add plot method

* new naming scheme

* fix unit tests

* add datamodule

* requested changes

* remove comments

* EOF

* battle against red circle

* fix failing tests

* add train val test split

* huggingface support

* fix failing trainer test

* running version of datamodule with trainer

* requested changes

* rename datamodules

* add colormap

* outline downstream dataset

* revert commit

* requested changes

* pass tests

* requested changes
2023-05-25 10:12:48 +02:00
Nils Lehmann 2d576d915f
Add year filter functionality CDL (#1337)
* add year functionality CDL

* requested changes and test coverage

* removesuffix clearer than strip

* recursive file verify

* Fix versionadded syntax

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2023-05-25 08:25:46 +02:00
Adam J. Stewart d37af7362d
L8 Biome: update for new dataset format (#1356)
* L8 Biome: update for new dataset format

* Fix bug in fake data generation
2023-05-24 21:24:01 -05:00
Adam J. Stewart f39416b15c
L7 Irish: update for new dataset format (#1355)
* L7 Irish: update for new dataset format

* Fix bug in fake data generation
2023-05-24 21:23:10 -05:00
Nils Lehmann 0f500cb69e
Adjust naming scheme for SSL4EO dataset (#1362)
* outline downstream dataset

* revert commit

* fix naming scheme
2023-05-24 13:38:59 -05:00
Adam J. Stewart bbf6108516
Fix reprojection issues (#1344)
* Add tests to catch reprojection issues

* More specific tests

* Fix boundless reprojection

* black/flake8

* Add getters and setters for all crs/res attributes

* Actually fix reprojection bug

* Fix tests

* Get all tests passing

* More specific tests

* Remove aux files

* Ignore *.aux.xml files

* Fix mypy

* Increase coverage

* Use dtype properly

* Increase coverage

* Add newline
2023-05-18 21:33:47 -07:00
Adam J. Stewart d7773a604b
SSL4EO-L: add new dataset (#1332)
* SSL4EO-L: add new dataset

* Fix style tests

* Add data module

* Doc improvements

* Thematic Mapper introduced in Landsat 4
2023-05-14 11:01:58 -05:00
Adam J. Stewart dddd723d8d
MonkeyPatch exposed in public API in newer pytest (#1333)
* MonkeyPatch exposed in public API in newer pytest

* Fix import order
2023-05-14 11:00:19 -05:00
Adam J. Stewart 4b9a6d7178
GridGeoSampler: don't change stride of last patch (#1329)
* GridGeoSampler: don't change stride of last patch

* Sample outside bounds of file
2023-05-14 10:59:58 -05:00
Adam J. Stewart 0847a462d1
Add MoCo trainer (#1285)
* Add MoCo trainer

* pyupgrade

* isort

* Fix type hints

* Lightly now supports MoCo v3

* Add RandomGrayscale

* Fix bug

* Remove duplicated dep

* Add check for mode collapse in feature representation

* Fix undefined variable
2023-05-11 23:05:39 -05:00
Isaac Corley ef7a9ad793
Add SimCLR trainer (#1252)
* add simclr and tests

* add lightly to reqs

* pyupgrade

* Copy things from prior implementation

* Add SimCLR v2 projection head

* Remove kwargs

* Call __init__ explicitly

* Fix mypy and docs

* Can't test newer setuptools

* Default to output dim of model

* Add memory bank

* Ignore erroneous warning

* Fix configs, test SSL4EO

* Fix a few layer bugs

* mypy fixes

* kernel_size must be an integer

* Fix SeCo in_channels

* Get more coverage

* Bump min lightly

* Default logging

* Test weights

* mypy fix

* Grab max_epochs from the trainer

* max_epochs param removed

* Use num_features

* Remove classification head

* SimCLR uses LARS, with Adam as a backup

* Add warnings

* Grab num features directly from model

* Check if identity

* Match timm model design

* Capture warnings

* Fix tests

* Increase coverage

* Fix method name

* More typos

* Escape regex

* Newer setuptools now supported

* New batch norm for every layer

* Rename forward arg

* Clarify usage of weights parameter

Co-authored-by: Caleb Robinson <calebrob6@gmail.com>

* Fix flake8

* Check it

* Use hydra

* Track average L2 normed stdev over features

* SimCLR decays lr to 0

* Add lr warmup

* Fix version access

* Fix LinearLR

* isinstance supports tuples

* Comment capitalization

* Require lightly 1.4.3+

* Require lightly 1.4.3+

* Bump lightly version

* Add RandomGrayscale

* Flake8 fixes

* Placate pydocstyle

* Clarify docs

* Pass correct weights

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
2023-05-11 09:40:53 -07:00
Adam J. Stewart d195c1d2c0
Better example for writing fake test data (#1315) 2023-05-07 22:37:53 -05:00