Skip to content
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

DataModules: run all data augmentation on the GPU #992

Merged
merged 108 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
b6b48cf
DataModules: run all data augmentation on the GPU
adamjstewart Dec 30, 2022
d5d3f58
Passing tests
adamjstewart Dec 30, 2022
0d557b9
Update BigEarthNet
adamjstewart Dec 30, 2022
73f567e
Break ChesapeakeCVPR
adamjstewart Dec 30, 2022
1d3c4b3
Update COWC
adamjstewart Dec 30, 2022
22f11b9
Update Cyclone
adamjstewart Dec 30, 2022
3263b71
Update ETCI2021
adamjstewart Dec 30, 2022
5d32674
mypy fixes
adamjstewart Dec 30, 2022
353ba01
Update FAIR1M
adamjstewart Dec 30, 2022
7e1d500
Update Inria
adamjstewart Dec 30, 2022
b1b90b4
Update LandCoverAI
adamjstewart Dec 30, 2022
d0dc274
Update LoveDA
adamjstewart Dec 30, 2022
f5513b7
Update NAIP
adamjstewart Dec 30, 2022
9525363
Update NASA
adamjstewart Dec 31, 2022
b087b74
Update OSCD
adamjstewart Dec 31, 2022
128d279
Update RESISC45
adamjstewart Dec 31, 2022
6b41c2d
Update SEN12MS
adamjstewart Dec 31, 2022
3790528
Update So2Sat
adamjstewart Dec 31, 2022
176974f
Update SpaceNet
adamjstewart Dec 31, 2022
5c08e95
Update UCMerced
adamjstewart Dec 31, 2022
37ff0dd
Update USAVars
adamjstewart Dec 31, 2022
d47a72e
Update xview
adamjstewart Dec 31, 2022
d99dfb7
Remove seed
adamjstewart Dec 31, 2022
c579eba
mypy fixes
adamjstewart Dec 31, 2022
722f6ad
OSCD hacks
adamjstewart Dec 31, 2022
e237e26
Add NonGeoDataModule base class
adamjstewart Dec 31, 2022
34c8d7e
Fixes
adamjstewart Dec 31, 2022
d66672a
Add base class to docs
adamjstewart Dec 31, 2022
3a47cd8
mypy fixes
adamjstewart Dec 31, 2022
afc8246
Fix several tests
adamjstewart Dec 31, 2022
22f695d
Fix Normalize
adamjstewart Dec 31, 2022
97ce260
Syntax error
adamjstewart Dec 31, 2022
5cdc234
Fix bigearthnet
adamjstewart Dec 31, 2022
ed059ec
Fix dtype
adamjstewart Dec 31, 2022
e5752fc
Consistent kornia import
adamjstewart Jan 1, 2023
3988500
Get regression datasets working
adamjstewart Jan 1, 2023
3d5ac47
Fix detection tests
adamjstewart Jan 1, 2023
6056e9b
Fix some chesapeake bugs
adamjstewart Jan 1, 2023
96252bb
Fix several segmentation issues
adamjstewart Jan 1, 2023
e3348c7
isort fixes
adamjstewart Jan 1, 2023
2409d8d
Undo breaking change
adamjstewart Jan 2, 2023
8b0a6bf
Remove more code duplication, standardize docstrings
adamjstewart Jan 2, 2023
2e1356f
mypy fixes
adamjstewart Jan 2, 2023
b9cd885
Add default augmentation
adamjstewart Jan 2, 2023
98f75b8
Augmentations can be any callable
adamjstewart Jan 2, 2023
8e1b18d
Fix datasets tests
adamjstewart Jan 2, 2023
a0c835a
Fix datamodule tests
adamjstewart Jan 2, 2023
5fa6e0b
Fix more datamodules
adamjstewart Jan 2, 2023
509c8db
Typo fix
adamjstewart Jan 2, 2023
fac17b8
Set up val_dataset even when fit
adamjstewart Jan 2, 2023
c94fa3e
Fix classification tests
adamjstewart Jan 2, 2023
1c99f28
Fix ETCI2021
adamjstewart Jan 2, 2023
ee80cc4
Fix SEN12MS
adamjstewart Jan 2, 2023
96658be
Add GeoDataModule base class
adamjstewart Jan 2, 2023
aa8108e
Fix several chesapeake bugs
adamjstewart Jan 3, 2023
2e5b2a8
Fix dtype and shape
adamjstewart Jan 3, 2023
989bbaa
Fix crs/bbox issue
adamjstewart Jan 3, 2023
a0aae63
Fix test dtype
adamjstewart Jan 3, 2023
ad67c88
Fix unequal size stacking error
adamjstewart Jan 3, 2023
f62700e
flake8 fix
adamjstewart Jan 3, 2023
4de4eff
Better checks on sampler
adamjstewart Jan 3, 2023
dd66a62
Fix bug introduced in NAIP dm
adamjstewart Jan 3, 2023
a1970ea
Fix chesapeake dimensions
adamjstewart Jan 3, 2023
61621b0
Add one to mask
adamjstewart Jan 4, 2023
3b7a9f4
Fix missing imports
adamjstewart Jan 4, 2023
c63996e
Fix batch size
adamjstewart Jan 5, 2023
716055f
Simplify augmentations
adamjstewart Jan 5, 2023
521c09c
Don't run test or predict without datasets
adamjstewart Jan 5, 2023
3201664
Fix tests
adamjstewart Jan 5, 2023
db87b42
Allow shared dataset
adamjstewart Jan 5, 2023
752e830
One more try
adamjstewart Jan 5, 2023
11242f3
Fix typo
adamjstewart Jan 5, 2023
1ff4aa0
Fix another typo
adamjstewart Jan 5, 2023
05fb13a
Fix Chesapeake dimensions
adamjstewart Jan 5, 2023
8f41fe5
Apply augmentations during sanity check too
adamjstewart Jan 5, 2023
96befe3
Don't reuse fixtures
adamjstewart Jan 5, 2023
227a84e
Increase coverage
adamjstewart Jan 5, 2023
2f8b5b4
Fix ETCI tests
adamjstewart Jan 5, 2023
fb2e73b
Test predict_step
adamjstewart Jan 5, 2023
6bcc41e
Test all loss methods
adamjstewart Jan 5, 2023
b3aaacf
Simplify validation plotting
adamjstewart Jan 6, 2023
a56e5f3
Document new classes
adamjstewart Jan 6, 2023
03f4ce9
Fix plotting
adamjstewart Jan 6, 2023
142bfc4
Plotting should be robust in case dataset does not contain RGB bands
adamjstewart Jan 6, 2023
be594a1
Fix flake8
adamjstewart Jan 6, 2023
d0d593b
100% coverage of trainers
adamjstewart Jan 6, 2023
04bae75
Add lightning-lite dependency
adamjstewart Jan 6, 2023
77aae28
Revert "Add lightning-lite dependency"
adamjstewart Jan 6, 2023
5f5782d
Define our own MisconfigurationException
adamjstewart Jan 6, 2023
49cc388
Properly test new data module base classes
adamjstewart Jan 6, 2023
0935cb9
Fix mistake in setup call
adamjstewart Jan 15, 2023
4b52032
ExtractTensorPatches runs into OOM errors
adamjstewart Jan 21, 2023
7ad9e5b
Test both fast_dev_run True and False
adamjstewart Jan 21, 2023
d06d9e9
Fix plot methods
adamjstewart Jan 21, 2023
647e601
Fix OSCD tests
adamjstewart Jan 21, 2023
deca721
Fix bug with inconsistent train/val/test splits between stages
adamjstewart Jan 22, 2023
5ae2f4c
Fix issues with images of different sizes
adamjstewart Jan 22, 2023
6a1571a
Fix OSCD tests
adamjstewart Jan 22, 2023
cc6176e
Fix OSCD tests
adamjstewart Jan 22, 2023
40d31bb
Bad rebase
adamjstewart Jan 23, 2023
f6a3061
No trainer for OSCD so no need for config
adamjstewart Jan 23, 2023
ed37429
Bad rebase
adamjstewart Jan 23, 2023
66093a6
plot: only works during validation
adamjstewart Jan 23, 2023
1776fd6
Fix collation of NASA Marine Debris dataset
adamjstewart Jan 23, 2023
38797f1
flake8 fix
adamjstewart Jan 23, 2023
f465efc
Quick test
adamjstewart Jan 23, 2023
514ad2f
Revert "Quick test"
adamjstewart Jan 23, 2023
6c4dafa
56 workers is a bit excessive
calebrob6 Jan 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions conf/chesapeake_cvpr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ experiment:
- "de-val"
test_splits:
- "de-test"
patches_per_tile: 200
batch_size: 200
patch_size: 256
batch_size: 64
num_workers: 4
class_set: ${experiment.module.num_classes}
use_prior_labels: False
1 change: 0 additions & 1 deletion conf/cowc_counting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ experiment:
learning_rate_schedule_patience: 2
datamodule:
root: "data/cowc_counting"
seed: 0
batch_size: 64
num_workers: 4
1 change: 0 additions & 1 deletion conf/cyclone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ experiment:
learning_rate_schedule_patience: 2
datamodule:
root: "data/cyclone"
seed: 0
batch_size: 32
num_workers: 4
3 changes: 1 addition & 2 deletions conf/deepglobelandcover.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ experiment:
ignore_index: null
datamodule:
root: "data/deepglobelandcover"
num_tiles_per_batch: 16
num_patches_per_tile: 16
batch_size: 1
patch_size: 64
val_split_pct: 0.5
num_workers: 0
3 changes: 1 addition & 2 deletions conf/gid15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ experiment:
ignore_index: null
datamodule:
root: "data/gid15"
num_tiles_per_batch: 16
num_patches_per_tile: 16
batch_size: 1
patch_size: 64
val_split_pct: 0.5
num_workers: 0
11 changes: 5 additions & 6 deletions conf/inria.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
program:
overwrite: True


trainer:
gpus: 1
min_epochs: 5
Expand All @@ -23,8 +23,7 @@ experiment:
num_classes: 2
ignore_index: null
datamodule:
root: "data/inria"
batch_size: 2
num_workers: 32
patch_size: 512
num_patches_per_tile: 4
root: "data/inria"
batch_size: 1
patch_size: 512
num_workers: 32
3 changes: 1 addition & 2 deletions conf/nasa_marine_debris.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
program:
seed: 0
overwrite: True

trainer:
Expand All @@ -22,5 +21,5 @@ experiment:
datamodule:
root: "data/nasamr/nasa_marine_debris"
batch_size: 4
num_workers: 56
num_workers: 6
val_split_pct: 0.2
29 changes: 0 additions & 29 deletions conf/oscd.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions conf/potsdam2d.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ experiment:
ignore_index: null
datamodule:
root: "data/potsdam"
num_tiles_per_batch: 16
num_patches_per_tile: 16
batch_size: 1
patch_size: 64
val_split_pct: 0.5
num_workers: 0
1 change: 0 additions & 1 deletion conf/sen12ms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ experiment:
band_set: "all"
batch_size: 32
num_workers: 4
seed: 0
5 changes: 2 additions & 3 deletions conf/so2sat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ experiment:
learning_rate: 1e-3
learning_rate_schedule_patience: 6
weights: null
in_channels: 3
in_channels: 18
num_classes: 17
datamodule:
root: "data/so2sat"
batch_size: 128
num_workers: 4
band_set: "rgb"
unsupervised_mode: False
band_set: "all"
3 changes: 1 addition & 2 deletions conf/spacenet1.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
program:
overwrite: False
seed: 0
trainer:
gpus: [3]
min_epochs: 50
Expand All @@ -22,4 +21,4 @@ experiment:
datamodule:
root: "data/spacenet"
batch_size: 32
num_workers: 4
num_workers: 4
3 changes: 1 addition & 2 deletions conf/vaihingen2d.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ experiment:
ignore_index: null
datamodule:
root: "data/vaihingen"
num_tiles_per_batch: 16
num_patches_per_tile: 16
batch_size: 1
patch_size: 64
val_split_pct: 0.5
num_workers: 0
18 changes: 18 additions & 0 deletions docs/api/datamodules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,21 @@ xView2
^^^^^^

.. autoclass:: XView2DataModule

Base Classes
------------

GeoDataModule
^^^^^^^^^^^^^

.. autoclass:: GeoDataModule

NonGeoDataModule
^^^^^^^^^^^^^^^^

.. autoclass:: NonGeoDataModule

Utilities
---------

.. autoclass:: MisconfigurationException
3 changes: 1 addition & 2 deletions tests/conf/chesapeake_cvpr_5.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ experiment:
- "de-test"
test_splits:
- "de-test"
patches_per_tile: 2
patch_size: 64
batch_size: 2
patch_size: 64
num_workers: 0
class_set: ${experiment.module.num_classes}
use_prior_labels: False
3 changes: 1 addition & 2 deletions tests/conf/chesapeake_cvpr_7.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ experiment:
- "de-test"
test_splits:
- "de-test"
patches_per_tile: 2
patch_size: 64
batch_size: 2
patch_size: 64
num_workers: 0
class_set: ${experiment.module.num_classes}
use_prior_labels: False
3 changes: 1 addition & 2 deletions tests/conf/chesapeake_cvpr_prior.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ experiment:
- "de-test"
test_splits:
- "de-test"
patches_per_tile: 2
patch_size: 64
batch_size: 2
patch_size: 64
num_workers: 0
class_set: ${experiment.module.num_classes}
use_prior_labels: True
1 change: 0 additions & 1 deletion tests/conf/cowc_counting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ experiment:
datamodule:
root: "tests/data/cowc_counting"
download: true
seed: 0
batch_size: 1
num_workers: 0
1 change: 0 additions & 1 deletion tests/conf/cyclone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ experiment:
datamodule:
root: "tests/data/cyclone"
download: true
seed: 0
batch_size: 1
num_workers: 0
3 changes: 1 addition & 2 deletions tests/conf/deepglobelandcover.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ experiment:
ignore_index: null
datamodule:
root: "tests/data/deepglobelandcover"
num_tiles_per_batch: 1
num_patches_per_tile: 1
batch_size: 1
patch_size: 2
val_split_pct: 0.5
num_workers: 0
3 changes: 1 addition & 2 deletions tests/conf/gid15.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ experiment:
datamodule:
root: "tests/data/gid15"
download: true
num_tiles_per_batch: 1
num_patches_per_tile: 1
batch_size: 1
patch_size: 2
val_split_pct: 0.5
num_workers: 0
13 changes: 6 additions & 7 deletions tests/conf/inria_test.yaml → tests/conf/inria.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ experiment:
num_classes: 2
ignore_index: null
datamodule:
root: "tests/data/inria"
batch_size: 1
num_workers: 0
val_split_pct: 0.2
test_split_pct: 0.2
patch_size: 2
num_patches_per_tile: 2
root: "tests/data/inria"
batch_size: 1
patch_size: 2
num_workers: 0
val_split_pct: 0.2
test_split_pct: 0.2
20 changes: 0 additions & 20 deletions tests/conf/inria_train.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions tests/conf/inria_val.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions tests/conf/potsdam2d.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ experiment:
ignore_index: null
datamodule:
root: "tests/data/potsdam"
num_tiles_per_batch: 1
num_patches_per_tile: 1
batch_size: 1
patch_size: 2
val_split_pct: 0.5
num_workers: 0
1 change: 0 additions & 1 deletion tests/conf/sen12ms_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ experiment:
band_set: "all"
batch_size: 1
num_workers: 0
seed: 0
1 change: 0 additions & 1 deletion tests/conf/sen12ms_s1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ experiment:
band_set: "s1"
batch_size: 1
num_workers: 0
seed: 0
1 change: 0 additions & 1 deletion tests/conf/sen12ms_s2_all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ experiment:
band_set: "s2-all"
batch_size: 1
num_workers: 0
seed: 0
1 change: 0 additions & 1 deletion tests/conf/sen12ms_s2_reduced.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ experiment:
band_set: "s2-reduced"
batch_size: 1
num_workers: 0
seed: 0
15 changes: 15 additions & 0 deletions tests/conf/so2sat_all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
experiment:
task: "so2sat"
module:
loss: "ce"
model: "resnet18"
learning_rate: 1e-3
learning_rate_schedule_patience: 6
weights: null
in_channels: 18
num_classes: 17
datamodule:
root: "tests/data/so2sat"
batch_size: 1
num_workers: 0
band_set: "all"
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ experiment:
learning_rate: 1e-3
learning_rate_schedule_patience: 6
weights: null
in_channels: 3
in_channels: 8
num_classes: 17
datamodule:
root: "tests/data/so2sat"
batch_size: 1
num_workers: 0
band_set: "rgb"
unsupervised_mode: False
band_set: "s1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ experiment:
learning_rate: 1e-3
learning_rate_schedule_patience: 6
weights: null
in_channels: 3
in_channels: 10
num_classes: 17
datamodule:
root: "tests/data/so2sat"
batch_size: 1
num_workers: 0
band_set: "rgb"
unsupervised_mode: True
band_set: "s2"
3 changes: 1 addition & 2 deletions tests/conf/vaihingen2d.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ experiment:
ignore_index: null
datamodule:
root: "tests/data/vaihingen"
num_tiles_per_batch: 1
num_patches_per_tile: 1
batch_size: 1
patch_size: 2
val_split_pct: 0.5
num_workers: 0
Loading