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

✨♻️ refactor preprocessing #64

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

dyollb
Copy link
Owner

@dyollb dyollb commented Apr 2, 2024

What do these changes do?

The PR adds

  • SelectChannel transform
  • an option to crop the foreground using an otsu mask (thresholding the first channel)
  • various small fixes
  • improve predict command, to write metrics in csv file, plot summary confusion matrix

Related issue/s

How to test

  • run pytest

Checklist

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Unit tests for the changes and run locally with the command pytest tests
  • Runs on minimum Python version

Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 60.75949% with 62 lines in your changes are missing coverage. Please review.

Project coverage is 56.77%. Comparing base (288663f) to head (dfd3452).

Files Patch % Lines
src/segmantic/seg/monai_unet.py 16.07% 45 Missing and 2 partials ⚠️
src/segmantic/seg/losses.py 73.17% 5 Missing and 6 partials ⚠️
src/segmantic/seg/transforms.py 92.00% 1 Missing and 1 partial ⚠️
src/segmantic/seg/visualization.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #64      +/-   ##
==========================================
+ Coverage   55.47%   56.77%   +1.30%     
==========================================
  Files          21       23       +2     
  Lines        1325     1409      +84     
  Branches      237      251      +14     
==========================================
+ Hits          735      800      +65     
- Misses        550      562      +12     
- Partials       40       47       +7     
Flag Coverage Δ
unittests 56.77% <60.75%> (+1.30%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

self,
to_onehot_y: bool = False,
num_classes: int = 2,
gamma: float = 0.75,
Copy link
Owner Author

Choose a reason for hiding this comment

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

gamma=2.0

from torch.nn.modules.loss import _Loss


class AsymmetricUnifiedFocalLoss(_Loss):
Copy link
Owner Author

@dyollb dyollb Apr 3, 2024

Choose a reason for hiding this comment

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

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.

1 participant