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

Get Dice for each class in DiceMetric #7162

Closed
KumoLiu opened this issue Oct 25, 2023 · 0 comments · Fixed by #7163
Closed

Get Dice for each class in DiceMetric #7162

KumoLiu opened this issue Oct 25, 2023 · 0 comments · Fixed by #7163

Comments

@KumoLiu
Copy link
Contributor

KumoLiu commented Oct 25, 2023

Now when reduction="mean_batch", will return the dice metrics as a tensor without label names.

f, not_nans = do_metric_reduction(data, reduction or self.reduction)

KumoLiu added a commit to KumoLiu/MONAI that referenced this issue Oct 25, 2023
Signed-off-by: KumoLiu <yunl@nvidia.com>
wyli pushed a commit that referenced this issue Oct 25, 2023
Fixes #7162
Fixes #7164

### Description
Add `return_with_label`, if True or a list, will return the metrics with
the corresponding label name, only works when reduction="mean_batch".

https://github.com/pytorch/ignite/blob/47b95d087a0f8713a9d24bcfe3a539b08101ba7a/ignite/metrics/metric.py#L424

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [x] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [x] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: KumoLiu <yunl@nvidia.com>
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 a pull request may close this issue.

1 participant