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

add dice evaluation metric #225

Merged
merged 10 commits into from
Nov 24, 2020
Merged

add dice evaluation metric #225

merged 10 commits into from
Nov 24, 2020

Conversation

Junjun2016
Copy link
Collaborator

add dice evaluation metric

@codecov
Copy link

codecov bot commented Nov 3, 2020

Codecov Report

Merging #225 (d15adc3) into master (7c68bca) will increase coverage by 0.22%.
The diff coverage is 92.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #225      +/-   ##
==========================================
+ Coverage   84.35%   84.58%   +0.22%     
==========================================
  Files          90       90              
  Lines        4340     4385      +45     
  Branches      687      701      +14     
==========================================
+ Hits         3661     3709      +48     
+ Misses        537      536       -1     
+ Partials      142      140       -2     
Flag Coverage Δ
unittests 84.58% <92.72%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmseg/datasets/pipelines/__init__.py 100.00% <ø> (ø)
mmseg/models/decode_heads/decode_head.py 91.66% <ø> (ø)
mmseg/models/losses/cross_entropy_loss.py 78.12% <73.33%> (+2.68%) ⬆️
mmseg/core/evaluation/metrics.py 94.11% <94.11%> (ø)
mmseg/datasets/custom.py 87.42% <95.23%> (+1.53%) ⬆️
mmseg/core/evaluation/__init__.py 100.00% <100.00%> (ø)
mmseg/datasets/pipelines/transforms.py 97.78% <100.00%> (+1.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7c68bca...4e35472. Read the comment docs.

mmseg/datasets/custom.py Outdated Show resolved Hide resolved
mmseg/datasets/custom.py Outdated Show resolved Hide resolved

class_table_data.append(
[class_names[i]] +
[round(m[i] * 100, 2) for m in ret_metrics[2:]] +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest using np.round once for all.

class_table_data.append(
[class_names[i]] +
[round(m[i] * 100, 2) for m in ret_metrics[2:]] +
[round(ret_metrics[1][i] * 100, 2)])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this order? Will [1:] work?

@@ -315,57 +315,58 @@ def evaluate(self, results, metric='mIoU', logger=None, **kwargs):

Args:
results (list): Testing results of the dataset.
metric (str | list[str]): Metrics to be evaluated.
metric (str | list[str]): Metrics to be evaluated. 'mIoU' and
'mDice' are support ONLY.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'mDice' are support ONLY.
'mDice' are supported.

Comment on lines 353 to 362
[np.round(m[i] * 100, 2) for m in ret_metrics[2:]] +
[np.round(ret_metrics[1][i] * 100, 2)])
summary_table_data = [['Scope'] +
['m' + head
for head in class_table_data[0][1:]] + ['aAcc']]
summary_table_data.append(
['global'] +
[np.round(np.nanmean(m) * 100, 2) for m in ret_metrics[2:]] +
[np.round(np.nanmean(ret_metrics[1]) * 100, 2)] +
[np.round(np.nanmean(ret_metrics[0]) * 100, 2)])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may use np.round once for all.

@xvjiarui xvjiarui merged commit 993be25 into open-mmlab:master Nov 24, 2020
bowenroom pushed a commit to bowenroom/mmsegmentation that referenced this pull request Feb 25, 2022
* add dice evaluation metric

* add dice evaluation metric

* add dice evaluation metric

* support 2 metrics

* support 2 metrics

* support 2 metrics

* support 2 metrics

* fix docstring

* use np.round once for all
aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this pull request Mar 27, 2023
* Update README for 0.2.3 release:

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
sibozhang pushed a commit to sibozhang/mmsegmentation that referenced this pull request Mar 22, 2024
* linting

* polish

* polish

* polish

* polish

* polish

* polish

* update changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants