-
Notifications
You must be signed in to change notification settings - Fork 405
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
SemanticSegmentationTask: add class-wise metrics #2130
Closed
Closed
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
23fa1fb
Add average metrics
robmarkcole b7d8305
Add average metrics
robmarkcole b1526fa
refactor: Rename metrics in SemanticSegmentationTask
robmarkcole 341e272
Ruff format
robmarkcole 024feda
Use ignore_index
robmarkcole 04cac59
pass on_epoch
robmarkcole 56f20fc
on_epoch to train too
robmarkcole 3d2b309
Disable on_step for train metrics
robmarkcole 9af1493
Merge branch 'main' into update-metrics
robmarkcole 192c496
ruff format
robmarkcole 73b710f
Merge branch 'main' into update-metrics
robmarkcole 8ce8c30
Merge branch 'main' into update-metrics
robmarkcole e4ed9fd
Merge branch 'main' into update-metrics
robmarkcole d9c2688
Merge branch 'main' into update-metrics
robmarkcole 400fae3
Merge branch 'main' into update-metrics
robmarkcole f4c793e
Merge branch 'main' into update-metrics
robmarkcole 3b629ea
Merge branch 'main' into update-metrics
robmarkcole e6abadd
Merge branch 'main' into update-metrics
robmarkcole da887fe
Bump min torchmetrics
robmarkcole 5138ccb
Merge branch 'update-metrics' of https://github.com/robmarkcole/torch…
robmarkcole 479c7e3
Raise torchmetrics min
robmarkcole 50b7d29
remo on_epoch etc
robmarkcole 1cd436f
Remove on_epoch
robmarkcole 9e985e2
try torchmetrics==1.1.0
robmarkcole c773322
try torchmetrics==1.1.1
robmarkcole 9d8c8e4
Merge branch 'main' into update-metrics
robmarkcole e2640f5
Use loop to generate metrics
robmarkcole 19187a9
Update
robmarkcole a3f7ffe
Fix jaccard
robmarkcole 9a66442
fix dependencies delta
robmarkcole 8381cb7
fix pyproject
robmarkcole b5050ad
Merge branch 'main' into update-metrics
robmarkcole 07e7c4d
Merge branch 'main' into update-metrics
robmarkcole ff761f2
Address merge conflicts
robmarkcole 59ba3c8
Specify on_epoch
robmarkcole 1184647
Ruff format
robmarkcole 82eecdc
Merge branch 'main' into update-metrics
robmarkcole bcada43
merge main
robmarkcole bc3bb3c
Merge branch 'microsoft:main' into main
robmarkcole ae7f061
merge main
robmarkcole File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
import os | ||
|
||
import pytest | ||
|
||
from torchgeo.datamodules import XView2DataModule | ||
|
||
|
||
class TestXView2DataModule: | ||
@pytest.fixture | ||
def datamodule(self) -> XView2DataModule: | ||
root = os.path.join('tests', 'data', 'xview2') | ||
batch_size = 1 | ||
num_workers = 0 | ||
dm = XView2DataModule( | ||
root=root, batch_size=batch_size, num_workers=num_workers, val_split_pct=0.5 | ||
) | ||
dm.prepare_data() | ||
return dm | ||
|
||
def test_train_dataloader(self, datamodule: XView2DataModule) -> None: | ||
datamodule.setup('fit') | ||
next(iter(datamodule.train_dataloader())) | ||
|
||
def test_val_dataloader(self, datamodule: XView2DataModule) -> None: | ||
datamodule.setup('validate') | ||
next(iter(datamodule.val_dataloader())) | ||
|
||
def test_test_dataloader(self, datamodule: XView2DataModule) -> None: | ||
datamodule.setup('test') | ||
next(iter(datamodule.test_dataloader())) | ||
|
||
def test_predict_dataloader(self, datamodule: XView2DataModule) -> None: | ||
datamodule.setup('predict') | ||
next(iter(datamodule.predict_dataloader())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to Lightning-AI/torchmetrics@63c7bbe the argument didn't exist until 1.2