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

Pytorch CNN Segmentation #354

Open
wants to merge 34 commits into
base: develop
Choose a base branch
from
Open

Pytorch CNN Segmentation #354

wants to merge 34 commits into from

Conversation

shreyasingh1
Copy link
Contributor

Pytorch 3D CNN model architecture for training on 3D voxels. Easily editable example notebook (found in experiments -> pytorch_model) illustrates the model's application on the 50 image Mouselight benchmarking data. Helper files are found in brainlit.utils.cnn_segmentation

@shreyasingh1
Copy link
Contributor Author

*Still need to write tests, black files, and confirm that docs build

@codecov
Copy link

codecov bot commented May 3, 2022

Codecov Report

Merging #354 (ae4830d) into develop (c4dfa8b) will decrease coverage by 2.01%.
The diff coverage is 39.43%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #354      +/-   ##
===========================================
- Coverage    71.52%   69.52%   -2.01%     
===========================================
  Files           38       41       +3     
  Lines         4759     5076     +317     
===========================================
+ Hits          3404     3529     +125     
- Misses        1355     1547     +192     
Impacted Files Coverage Δ
brainlit/utils/make_masks.py 15.06% <15.06%> (ø)
brainlit/utils/cnn_segmentation/performance_cnn.py 29.60% <29.60%> (ø)
brainlit/utils/cnn_segmentation/preprocess_cnn.py 75.00% <75.00%> (ø)

@shreyasingh1
Copy link
Contributor Author

@tathey1 The PR now builds with CircleCI and Netlify. Code cov goes slightly down, only because I didn't write tests for functions that required "data_dir" as input. In the Netlify build, you can see the new refs in Utils->CNN Segmentation, and "make_masks" which is in Utils generally.

Brief description of PR: in brainlit -> utils -> cnn_segmentation, I added two helper files called preprocess_cnn.py and performance_cnn.py that format data into torch objects and provide code to train, test, and optimize a 3D CNN. Example notebook of how to use these is in experiments -> pytorch_model. Also added a file in brainlit -> utils called make_masks.py that formalizes how to make 3D image masks from a series of SWC files. Didn't write tests for this file because Bresenham3D is tested elsewhere in brainlit (but can add here too if necessary).

Only standing question is that the "Return" arguments are formatted strangely in some of the functions in Netlify. Function docstrings seem to be formatted correctly and I tried a few different alternatives with no luck. Input parameters are formatted right, it's only the Return arguments that aren't for some. Any guidance on how to fix?

@shreyasingh1 shreyasingh1 requested a review from tathey1 May 10, 2022 22:24
Copy link
Member

@tathey1 tathey1 left a comment

Choose a reason for hiding this comment

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

Two things:

  • If the code coverage is not passing, can you please add in the description the rationale behind which methods you tested and which you did not (per our conversation).
  • Please add type hints like here

After that, I will look at the code more closely. Thanks!


Arguments:
data_dir: direction to base data folder that download_benchmarking points to.
Should contain sample-tif-location and sample-swc-location
Copy link
Member

Choose a reason for hiding this comment

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

this newline is causing some issues in the docs page

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

Stale pull request message

@github-actions
Copy link

github-actions bot commented Apr 9, 2023

Stale pull request message

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

Successfully merging this pull request may close these issues.

None yet

2 participants