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

226 Коммитов

Автор SHA1 Сообщение Дата
Adam J. Stewart 744078fcff
Refactor datamodule/model testing (#329)
* Refactor RegressionTask testing

* Programmatically determine max value

* Refactor ClassificationTask testing

* Silence warnings

* Refactor SegmentationTask testing

* Fix training mappings

* Fix GeoDataset trainers

* Fix ETCI trainer fake data

* Update OSCD training data

* Get LandCoverAI tests to pass

* Fix OSCD checksum handling

* Fix NAIP-Chesapeake tests

* Fix OSCD tests

* Keep BoundingBox icy

* Fix other datamodules

* Fix chesapeake testing

* Refactor BYOLTask tests

* Style fixes

* Silence pytorch-lightning warnings

* Get coverage for Chesapeake CVPR prior

* Fix trainer tests
2021-12-30 13:54:47 -06:00
Nils Lehmann 61e10f7b5c
Add plot method to Levir, and change directory path (#335)
* add plotting method

* implement test

* axis off

* prediction flag

* requested changes

* indexing fix
2021-12-30 12:05:42 -06:00
Nils Lehmann a9f004e2d3
Add plotting method for CV4A Kenya Crop Type Dataset (#312)
* Add plotting method for CV4A Kenya Crop Type Dataset

* remove print statements, still fix test_plot

* fix rgb plot test

* fix rgb plot test

* requested changes
2021-12-29 11:01:16 -06:00
Caleb Robinson 7ad31942d5
Add plot method to ADVANCE, BeninSmallHolderCashews, and BigEarthNet datasets (#264)
* Adding plot to ADVANCE dataset

* Adding plot to BeninSmallHolderCashews

* Adding plot to BigEarthNet

* Doctstring adjustment for BigEarthNet plot

* Cleaning up ugly test

* Cleaning up bigearthnet classes

* Added time step plot to benin_cashews

* Formatting

* Update benin cashew tests

* Add S1 plotting and type to np.ndarray

* Trying numpy with quotes
2021-12-28 15:01:57 -06:00
estherrolf 0d4811b752
functionality for learning on the prior with QR loss and ChesapeakeCVPR data (#202)
* adding QR loss functions for learning on the prior

* chesapake learn on prior trainer with self-contained code for visualization

* adding prior dataset to the chesapeake datasets; doesn't handle downloading or anything like that yet

* updating init files to include chesapeake CVPR prior

* adding FCNModified for learning on the prior

* changing input to samplers to pass dataset instead of dataset.index

* fixing style issues

* Removing FCN_modified

* Fixing super call and mypy in FCN model

* Added learning on the prior extension

* Update tests

* Formatting

* Adding QR loss

* Added losses to docs

* Removing trainer, moving datamodule

* Combining chesapeake and chesapeake prior datamodules

* Formatting

* Test coverage

* Formatting

* Adding losses

* Re-moving the datamodules around

* Make loss function a torch Module

* Version added

* Fixed some stuff that got messed up in the rebase

* Formatting

* How'd this get there?

* Change qr losses to expect probabilities instead of log-probabilities

* Clean up test

* Rename qr loss file

* Renamed test file

Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
2021-12-28 14:56:14 -06:00
Nils Lehmann 45df0f8b98
Add plotting method for COWC dataset (#300)
* plotting method cowc dataset

* boolean label for detection

* restructure plotting method

* typo

* label title not as variable

* single plot method in super class

Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
2021-12-28 11:25:50 -06:00
Adam J. Stewart cbebc1e0db
Move DataModules to torchgeo.datamodules (#321)
* Move DataModules to torchgeo.datamodules

* Clean up local imports
2021-12-23 20:10:50 -06:00
Ritwik Gupta a3f559376c
Add custom RasterDataset notebook (#283)
* Add custom RasterDataset notebook

* Update docs index.rst

* Update copyright, fix URL typo, and add verbose description

* Add xview3 sample data

* Update notebook

* Show simple example first, complicated example second

* Remove the second half of the notebook, can expand later
2021-12-21 15:29:15 -08:00
Ashwin Nair fe590b1d78
Update SpaceNet plot fns (#311) 2021-12-20 22:56:57 -06:00
Maciej Kilian 95a4d89d57
OSCD: adding configuration file (#262)
* OSCD: adding configuration file

* add OSCDDataModule

* some changes

* Works, it's training

* some edits

* not required

* Get rid of swap

* Padding in val and test

* don't ignore zeros

* 0.56 IoU

* 0.59 Iou

* 0.6 IoU

* make this the same

* oscd change

* fix tests

* black fix

* change defaults

* Null weights

* null

* use Kornia PadTo

* remove name from config + fix val dataloader

* padto class attribute

Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
2021-12-20 16:53:20 -06:00
Adam J. Stewart 52a94a6ddc So2Sat: prevent test warnings (#307) 2021-12-19 16:27:46 -06:00
Adam J. Stewart 46cf24453a
Transform tests: min Kornia version, filter warnings (#306) 2021-12-19 15:04:23 -06:00
Adam J. Stewart aaee30437d
Fix GeoDataset pickling (#304)
* Fix GeoDataset pickling

* mypy fixes
2021-12-19 09:23:18 -06:00
Nils Lehmann 9a33a99553
plotting method Cyclone dataset (#298)
* plotting method Cyclone dataset

* adding label and prediction
2021-12-17 17:18:29 -08:00
Adam J. Stewart be36c1eb22
Rework list of required dependencies (#287)
* Rework list of required dependencies

* Update open3d import error msg

* Style fixes

* Remove extra empty line

* Increase test coverage

* Fix idtrees tests
2021-12-17 16:28:57 -08:00
Nils Lehmann 29dc789828
plotting method for GID15 dataset (#288)
* plotting method for GID15 dataset

* version added

* plot predictions

* prediction in sample
2021-12-17 01:13:30 -08:00
Ritwik Gupta ea03fe42a4
Add normalized burn ratio and tests (#284) 2021-12-17 00:21:43 -08:00
Adam J. Stewart 3bffe4972c
Chesapeake: support already downloaded zip files (#281)
* Chesapeake: support already downloaded zip files

* Remove comments, save for a later PR

* Style fix
2021-12-16 16:49:11 -06:00
isaac 14c19e35c2
Add FAIR1M Dataset (#232) 2021-12-10 18:09:08 -06:00
isaac 1f249b81c6
NASA Marine Debris dataset (#269) 2021-12-10 17:57:38 -06:00
Caleb Robinson db600b4f7c
Fixing network calls in unit tests (#265)
* Fixing network call in test of pretrained resnet

* Enable loading a pretrained model from a local path

* Fix filename

* monkeypatch the load_state_dict_from_url method instead of going around it

* Make default configs use random weights instead of imagenet pre-trained weights

* Removing internet access requirement from tests

* Deleted So2Sat trainer
2021-12-09 19:38:30 -06:00
Nils Lehmann 6785683da1
Add LoveDA dataset (#270)
* initial commit, adding LoveDA dataset

* recommended changes by ashnair1

* corrections from pydocstyle linter

* List[str]

* plotting method added

* linting test changes

* passing test for plotting

* linting adjustments

* smaller fake data of 2x2 and mypy linter changes

* plot only single image and mypy changes

* plot method without expecting batch dimension

* style changes and adding doc

* added lightning data module

* sphinx changes

* doc string changes

* data module in init and fake data for module test
2021-12-09 14:47:11 -06:00
isaac 0434f3c1ce
Add IDTReeS dataset (#201)
* add IDTReeS dataset

* dataset loads data now

* add optional laspy and pandas dependencies

* fixed docs failing

* format

* refactor verify and resample chm/hsi to 200x200

* add open3d optional dep

* overhaul

* temporarily remove open3d install bc their pypi is broken

* mypy fixes

* fixes per suggestions

* general cleanup

* test passing

* add min version for laspy and pandas

* add open3d dependency

* add open3d to mypy tests

* add hard install for python 3.9 open3d to actions

* attempt #2

* I think I got it now

* updated tests.yaml

* make open3d dep require python<3.9

* open3d has issues with macos python 3.6

* same for 3.7

* skip open3d plot test for macos

* formatting

* skip open3d plot test for windows

* update per suggestions

* update test data readme for las files

* updated per suggestions

* more changes per suggestions

* last change per suggestion

* Grammar fix in pandas dep requirement comment

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-12-05 22:38:50 +00:00
isaac 5276d7907f
update for kornia v0.6.2 release bbox fix in K.AugmentationSequential (#268) 2021-12-05 15:08:50 -06:00
Caleb Robinson 5d407b76b5
Overhaul BoundingBox and ZipDataset classes (#144)
* Adding a UnionDataset

* Adding contains method to BoundingBox

* Finishing UnionDataset

* Add __contains__ method

* Overhaul BoundingBox, add set arithmetic

* mypy fixes

* pydocstyle fixes

* Ignore erroneous pydocstyle warnings

* rtree only supports tuples, not BoundingBoxes

* mypy fixes

* Use custom collate function to handle BoundingBoxes

* Add back support for Python 3.6

* Add tests for all new BoundingBox features

* Rename ZipDataset to IntersectionDataset

* Merge indices of IntersectionDataset, auto-convert CRS/res

* Get tests to pass

* Fix more tests

* Test more of RasterDataset/VectorDataset directly

* Increase UnionDataset test coverage

* IntersectionDataset stacks tensors, UnionDataset merges tensors

* Support collating dicts with differing keys, add tests

* Style fixes

* Samplers: compute intersection between index and ROI

* Update README with example usage

* GeoDataset addition is deprecated

* Add note about CRS/res

* More documentation for Intersection/UnionDatasets

* Use collate function in tutorial

* Don't use multiple workers

* Fix typo

* Drop support for adding GeoDatasets

* Remove unused import

* Add comment explaining coverage config settings

* Collation function needed for benchmark script

* Add more explanation to README

* Correct Landsat 8 bands

* Print warning when changing CRS/res

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-12-03 16:40:50 -06:00
Maciej Kilian 6f23fa42c5
OSCDDataModule: add random crop augmentation (#257)
* OSCDDataModule: add random crop augmentation

* typing: use sequence instead of tuple

* use RandomCrop

* Use kornia instead

* add description of crop_size

* Only RandomCrop train and val set, not test set

* black fix

* working random_crops

* Resizing dummy test data to 3x3 so we can test RandomCrop Augmentations

* assert crops are proper size

* not working yet but some progress

* issue with amount of slices

* forgot to set val and test batch_size to 1

* some style fixes

* setting the dataset.transforms attribute doesn't work unless you do it in __init__ for now val_dataset must have random crop

* nevermind we don't need this

* style fixes + do we need mask to be torch.long?

* einops

* unsure why this doesn't work

* dataset.transforms

* mypy fix

* hacky flake8 fix

* non-hacky flake8 fix

* mypy fix

* adjust val test size

* passing tests

* mypy fix

* adding n_random_crops

* adjust param in testing

* working collate_fn but breaks mypy

* flattening (2, 13) into 26

* fix mypy

* style fixes

* add testing for new shapes

* Adjusting DataModule docstring

* remove clamp since we are standardizing

* name change to train_batch_size

* splitting crop-size into patch_size and num_patches_per_tile
2021-12-01 23:34:33 -08:00
Ashwin Nair 28e5f2406e
Add SpaceNet5 (#263)
* Add SpaceNet5

* Add speed_mask option and test data

* Fix docs

* Combine fixtures

* Use python copy

* Remove list

* Predictions -> Labels

* Better error message
2021-11-29 11:39:54 -08:00
Ashwin Nair 3c228ba268
Add plot function for SpaceNet datasets (#252)
* Add plot function for SpaceNet datasets

* Add version string

* Set interpolation='none' while displaying mask

* Switch to percentile normalization

* Add axis param to percentile_normalization

* Tuple[int, int] -> Sequence[int]

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

* Update docstring

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

* Forgot to import Sequence

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-11-22 09:13:25 -08:00
Maciej Kilian 0171c72519
Implementing OSCDDataModule (#255)
* Implementing OSCDDataModule

* some progress + style fixes

* Adding temporary min/max values for B10 band which isn't in BigEarthNet for some reason

* adding validation split

* fixing pydocstyle fails

* fixing style issues

* OSCDDataModule testing + added to torchgeo.datasets.__init__

* more concise + robust to small val_pct

* nevermind, mypy doesn't like that because of types

* adding to docs

* adding actual means and stds calculated on entire dataset

* use clamp instead of clip

* fix

* initialize norm after last band_mean edit
2021-11-22 09:11:07 -08:00
Maciej Kilian bfe3125c25
OSCD tests: fixing test_len (#254)
* OSCD tests: fixing test_len

* I forgot to update the .zip files, should work now
2021-11-20 08:38:47 -08:00
Caleb Robinson 248cd4a323
Add plot functions to datasets (#251)
* Adding plot function for EuroSAT

* Added LandCover.ai plot

* Cleaning up

* Added method for percentile normalization

* Adding RESISC45 plot

* Adding versionadded tags and fixing docs

* So2Sat should return tensor labels

* Added So2Sat plot

* Added UCMerced plot

* Changed percentile normalization to calculate values overall and not by band

* Added SeCo plot

* Fixed So2Sat doc

* Adding version to xview2

* Testing percentile_normalization

* Style in test_utils

* version de-added
2021-11-19 16:28:09 -06:00
Maciej Kilian 0b8a8461bc
Adding OSCD dataset (#233)
* OSCD: initial template

* updating download pattern

* package: including OSCD in torchgeo.datasets

* download: adapting download method to OSCD dataset + adding simple test for debugging

* _load_files method: temporary implementation

* OCSD: minimum working example, needs plenty improvement

* adding OSCD to docs

* Moving test to appropriate location

* OSCD: remove sort_bands and use utils.sort_sentinel2_bands

* Using rasterio instead of tifffile

* remove useless import

* style changes

* fix: style

* Developing tests for OSCD dataset

* Updating dataset description

* change name

* style fixes

* fixing mypy errors

* style fixes

* cast to string to fix typing errors

* style change

* isort fix

* remove TODO

* adding dataset for testing

* change len

* check if sum is concatdataset

* isort fix

* fixing some issues + correct md5 in dataset

* closing rasterio file handles

* removing some TODO's

* transitioning to fake data

* mypy fix attempt

* set fake data md5

* flake8 fix

* starting plot method

* updating plot method

* no predictions for now

* fixing style errors

* add testing for plot

* making some changes to fake testing data

* full coverage

* Use RGB channels in the plot function

* adding shape tests in test_getitem

* remove features and add to description

* fixing some things

* transitioning to authors dataset link

* No need to change file names + adapt test dataset

* adapting tests to new data format

* Update docs/api/datasets.rst

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

* closing plot at end of terst

* add versionadded

* style fixes + indentation fixes

* style fixes

* forgot the .zip

* fix zipfile name

* temporary fix for flake8

* Add link to docs

* forgot to adjust this

* changing flake8 solve

* slimming down the test dataset

* removing imgs_x files which aren't needed for current testing but might be in the future

* Revert "removing imgs_x files which aren't needed for current testing but might be in the future"

This reverts commit cfbf26c1d3.

* nevermind, this was the issue

* trying to remove these once again

* adding band choosing functionality

* removing double code

* removing more double code

* flake8 fix

* adding one more training sample to dummy dataset and testing split

* typing numpy array

* back to this

* Fixing tests and mypy

Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-11-19 12:21:51 -08:00
Caleb Robinson 68112c749c Removing staticmethod from ETCI2021 plot 2021-11-19 04:55:02 +00:00
Caleb Robinson cf9cc98da6
Adding seed to RCF model (#250) 2021-11-18 18:32:56 -06:00
Adam J. Stewart 7fea911fa6
Fix resisc45 testing 2021-11-18 16:01:43 -06:00
Adam J. Stewart b190c40e52
Close figures after opening to silence warnings 2021-11-18 15:56:50 -06:00
isaac dfad08ef3a
Add Potsdam Segmentation (#247)
* add potsdam dataset and tests

* add dummy potsdam data

* update potsdam docstring

* mypy fix

* style fixes

* Update datasets.rst

* update per suggestions

* updated docs

* refactor _load_target to use pillow

* format

* Update tests/datasets/test_potsdam.py

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

* Update tests/datasets/test_potsdam.py

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

* Update torchgeo/datasets/potsdam.py

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

* Update torchgeo/datasets/potsdam.py

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

* Update torchgeo/datasets/potsdam.py

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

Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-11-16 09:13:41 -08:00
isaac c818827dfd
Add Vaihingen Segmentation (#248)
* tmp

* add vaihingen dataset

* add tests and dummy data

* style fixes

* remove tmp notebook

* update per suggestions

* updated docs and docstrings

* Update tests/datasets/test_vaihingen.py

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

* Update tests/datasets/test_vaihingen.py

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

* Update torchgeo/datasets/vaihingen.py

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

* Update torchgeo/datasets/vaihingen.py

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

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-11-16 02:02:51 -06:00
isaac 922ec05054
Add xView2 Dataset (#236) 2021-11-15 08:45:57 -06:00
Caleb Robinson bb2771fcc8
Add EuroSAT datamodule (#246) 2021-11-14 22:19:41 -06:00
Caleb Robinson fca579a112
Adding ETCI2021 datamodule and trainer (#234)
* Adding ETCI2021 datamodule and trainer

* Fixing confs

* Update torchgeo/datasets/etci2021.py

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

* Update torchgeo/trainers/etci2021.py

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

* Update conf.py

* Reverting trainer init

* plot method

* Update ETCI2021 test data

* Test trainer

* Fix train.py

* Fix test

* Adding matplotlib intersphinx

* Remove ignore

* Revert "Update ETCI2021 test data"

This reverts commit 502a3785e4.

* Remove stuff

* Reset

* Add plot tests

* Unzipping test data

* Test datamodule

* Add datamodule to docs

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-11-14 14:31:42 -06:00
Ashwin Nair 5a071cef9f
Add SpaceNet 7 (#241) 2021-11-13 12:39:40 -06:00
Ashwin Nair 53f7c1d839
Run black --skip-magic-trailing-comma (#242) 2021-11-13 18:12:25 +00:00
Adam J. Stewart 740d4f87a3
0.1.0 release (#226)
* 0.1.0 release

* Train deps needed for release testing

* Update development status

* setup.py should not be run directly

* Test more trainers

* Fix local docs build

* Update installation instructions

* Specify test data dir in config

* Fix tutorial docs

* Trainers should default to num_workers=0, download=False

* Correct location for root_dir

* Try different GDAL name

* Try again

* Various fixes to release tests

* Update pip installs in tutorials

* Fix some bugs

* Config file not being picked up

* Get back to 100% test coverage

* Added correct weight string to UCMerced

* yolo fix

* yolo fix pt 2

* yolo fix 2 pt. 1

* Simplify tests a bit

* Make the trainer notebook look stupid

* UCMerced should download by default in the trainers

* Revert

* Fix logo/author, include LICENSE in upload

Co-authored-by: Caleb Robinson <calebrob6@gmail.com>
2021-11-07 22:05:58 -06:00
Caleb Robinson e5bbc738a3
Adding RESISC45 trainer with augmentations (#225)
* Removing some keys from the defaults that were removed in Lightning 1.5

* Adding RESISC45

* Experimenting with different LR decay

* Formatting

* Updating RESISC45 test data to be the same size as the original data

* RESISC45 trainer and tests

* Fix import, add deprecation

* mypy fixes

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-11-07 05:17:57 +00:00
Caleb Robinson b87d2707ae
Adding the SeCo patch datasets (#223)
* Adding the SeCo patch datasets

* Adding tests and incorporating suggestions

* Added benchmark example code link

* Update to new way of downloading

* Formatting

* Test coverage

* Rename dataset

* Add SeCo dataset to docs
2021-11-06 23:58:36 -05:00
Adam J. Stewart 967b4b171f
Trainers: split tasks into separate files, add SemanticSegmentationTask (#224)
* Trainers: split tasks into separate files

* Add SemanticSegmentationTask

* Fix doc tests

* Keep dataset-specific tasks in separate files

* Remove duplicate So2Sat trainer
2021-11-06 23:57:40 -05:00
isaac 4257aec131
BigEarthNet Splits (#221)
* adds split files, new classes, and refactors to speed up loading

* update bigearthnetdatamodule and tests

* update configs

* merge

* force add split files

* fix docstring

* fix docstrings x2

* fix docstrings x3

* Reduce total testing time

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
2021-11-05 16:58:25 +00:00
isaac 187d910afd
Refactor Classification Tasks (#222) 2021-11-05 00:04:11 -05:00
Adam J. Stewart 4f6e2096c8
Move DataModules from torchgeo.trainers to torchgeo.datasets (#220) 2021-11-04 17:15:29 -05:00