Skip to content

Create iou_metric.py #4497

Closed
yashika-git wants to merge 20 commits into
Project-MONAI:devfrom
yashika-git:patch-2
Closed

Create iou_metric.py #4497
yashika-git wants to merge 20 commits into
Project-MONAI:devfrom
yashika-git:patch-2

Conversation

@yashika-git

@yashika-git yashika-git commented Jun 14, 2022

Copy link
Copy Markdown
Contributor

Signed-off-by: Yashika Jain yashikajain201@gmail.com
Fixes #4394

Description

Implementation of IoU metric (Jaccard score).
Based upon the implementation of DiceMetric.

Status

**Ready

Types of changes

  • 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).
  • 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.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@yashika-git yashika-git changed the title Create iou_metric.py Create iou_metric.py Signed-off-by: Yashika Jain <yashikajain201@gmail.com> Jun 14, 2022
@Nic-Ma

Nic-Ma commented Jun 14, 2022

Copy link
Copy Markdown
Contributor

Hi @yashika-git ,

Thanks for your contribution.
Please sign your commit with git command, refer to:
https://github.com/Project-MONAI/MONAI/blob/dev/CONTRIBUTING.md#signing-your-work

Thanks.

@yashika-git yashika-git changed the title Create iou_metric.py Signed-off-by: Yashika Jain <yashikajain201@gmail.com> Create iou_metric.py Jun 14, 2022
@Nic-Ma Nic-Ma requested a review from wyli June 15, 2022 15:47
@Nic-Ma

Nic-Ma commented Jun 16, 2022

Copy link
Copy Markdown
Contributor

Hi @yashika-git ,

I think the PR overall looks good to me, could you please help:

  1. Sign your commits.
  2. Add the class to __init__.py: https://github.com/Project-MONAI/MONAI/blob/dev/monai/metrics/__init__.py
  3. Add to the doc: https://github.com/Project-MONAI/MONAI/blob/dev/docs/source/metrics.rst
  4. Add unit tests, refer to: https://github.com/Project-MONAI/MONAI/blob/dev/tests/test_compute_meandice.py

Thanks in advance.

@yashika-git

Copy link
Copy Markdown
Contributor Author

@Nic-Ma, sure!

@Nic-Ma Nic-Ma mentioned this pull request Jun 16, 2022
7 tasks
@yashika-git

Copy link
Copy Markdown
Contributor Author

@Nic-Ma, I'm new to git and am figuring out how to sign commits. Will update the commits soon.

@yashika-git

Copy link
Copy Markdown
Contributor Author

Hi @Nic-Ma,
I've signed the commits, added the class to init.py and have added to the doc.
I will add unit tests soon.

@yashika-git

Copy link
Copy Markdown
Contributor Author

Hi @Nic-Ma,
I have added the unit tests, but have messed up with my other commits. Will rectify all of it soon.
Sorry for this, it's my first time using git because of which I am not used to it.

@Nic-Ma

Nic-Ma commented Jul 5, 2022

Copy link
Copy Markdown
Contributor

Hi @yashika-git ,

Glad to see your contribution here.
You can refer to the contribution guideline for any PR process issue:
https://github.com/Project-MONAI/MONAI/blob/dev/CONTRIBUTING.md

Thanks.

yashika-git and others added 16 commits July 9, 2022 14:19
Signed-off-by: Yashika Jain <yashikajain201@gmail.com>
Signed-off-by: Yashika Jain <yashikajain201@gmail.com>
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.1.0 → v4.3.0](pre-commit/pre-commit-hooks@v4.1.0...v4.3.0)
- [github.com/asottile/pyupgrade: v2.31.1 → v2.34.0](asottile/pyupgrade@v2.31.1...v2.34.0)
- [github.com/hadialqattan/pycln: v1.3.3 → v1.3.5](hadialqattan/pycln@v1.3.3...v1.3.5)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: Yashika Jain <yashikajain201@gmail.com>
* [DLMED] adapt Pad transform for MetaTensor

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] format code

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update inverse and spatial_pad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update border pad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update divisible pad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update spatial crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] make thread safe

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update CenterSpatialCrop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update scale crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] fix flake8

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update random spatial crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update random scale crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update random spatial crop samples

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] adjust Pad design

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update CropForeground

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update random weighted crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update RandCropPosNeg

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update rand crop by label classes

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update ResizeCropOrPad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] restore numpy pad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update dict spatial pad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update border pad and divisible pad

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update spatial crop dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update center spatial crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update rand scale crop dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update rand spatial crop samples dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update crop foreground dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update rand weighted crop dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update pos neg crop dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [DLMED] update crop by labels dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update resize with pad or crop dict

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update format

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] fix all the mypy errors

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] add crop / pad base tests

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update border pad test

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update spatial crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update pad transforms

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update samples crop

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update crop tests

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update according to comments

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] add test for deepcopy

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] fix typo

Signed-off-by: Nic Ma <nma@nvidia.com>

* [DLMED] update docs

Signed-off-by: Nic Ma <nma@nvidia.com>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: Yashika Jain <yashikajain201@gmail.com>
Signed-off-by: Yashika Jain <yashikajain201@gmail.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Yashika Jain <yashikajain201@gmail.com>
fixes #4641 inverse padlist

Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Yashika Jain <yashikajain201@gmail.com>
Signed-off-by: vale-salvatelli <vsalvatelli@microsoft.com>
Signed-off-by: Yashika Jain <yashikajain201@gmail.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Yashika Jain <yashikajain201@gmail.com>
Signed-off-by: mersad95zd <m.zalbagi@gmail.com>
Signed-off-by: Yashika Jain <yashikajain201@gmail.com>
Signed-off-by: Yashika Jain <yashikajain201@gmail.com>
Signed-off-by: Yashika Jain <yashikajain201@gmail.com>
@yashika-git yashika-git marked this pull request as draft July 9, 2022 13:22
@yashika-git yashika-git closed this Jul 9, 2022
@yashika-git yashika-git deleted the patch-2 branch July 9, 2022 18:10
@yashika-git

Copy link
Copy Markdown
Contributor Author

Hi @Nic-Ma,
I've closed this PR because the branch got very messy and have created a new pull request through another branch.
Here's the link to the same:
#4663
I apologize for the inconvenience caused.

@Nic-Ma

Nic-Ma commented Jul 10, 2022

Copy link
Copy Markdown
Contributor

no problem, let's use the new PR for discussion.

Thanks for your contribution.

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.

Implementation of IoU

5 participants