Skip to content

Commit eef7eac

Browse files
C-AchardTimokleiaMMathisLab
authored
WandB/Colab + docs (#48)
* WANDB integration for WNet * Colab training script * Update colab_training.py * Update colab_training.py * Update colab_training.py * Update colab_training.py * Update colab_training.py * Added minimal Colab notebook * ZeroCostDL4Mic-style notebook * Added WANDB to Colab notebook * Added softmax param * Fix reset of paths in training UI * WNet visualization * Disable intensity transforms in WNet * Fixed supervised loss saving * Update view_wnet.ipynb * Update view_wnet.ipynb * Fixed filepaths * Added more checks for csv + fix eval batch size * Utils+training fixes * Colab training improvements (#49) * Update colab_wnet_training.ipynb * Update colab_wnet_training.ipynb --------- Co-authored-by: Cyril Achard <[email protected]> * Reverted include_background=True in Dice * Reintroduced best Dice channel seeking + refacto * Improve filepath messages * Fix unsup image loading when not validating * Fixed deletion of Qt imports in interface * Added auto-check for which channel has foreground Preventing background to be shown first when using WNet inference, for better UX * Fixed eval_batch_size assignment * Fix training tests * Experimental auto-discard * Improved auto-discard utility * Create experimental sliding window Voronoi-Otsu for large volumes * Disable resize error handler * Docs update & jupyter-books port (#50) * Moved docs to source folder * Updated to jupyter-books * Update GH Action to jupyter-book * Updated guides * Update reqs for jupyter-books - Fixed typo * Fix typo and file duplicate * Added auto API docs * Update welcome.rst * Update interface docstrings * Update ruff to enforce docstring style * Updated docstrings in interface/config * Add additional docstring rule exceptions * Update utils docstring * Update plugins.py * Update dev_scripts * Updated code_plugin folder docstrings * Update code_models docstrings * Update tests docstrings * Update docstring rules to enforce docs * Fix warnings when building docs * Restore docs images * Remove old API docs * Added module docstring for all public modules * Update pyproject.toml * Update folder desc * Update inference and training guides * Update inference_module_guide.rst * Guides updates * Change indexing, guides updates * Fix unindent warning * Update _toc.yml * Fixed model list inconsistencies * Update model list * Trying to fully use autosummary (see #51) * Docs update * Fix missing refactor in CRF * Update cropping_module_guide.rst * Updated docs ref for code * Figs, refs, utils guide update * Update images to figures where relevant * Updated refs to source code * Improved utils guide layout and contents * Review update + crop/utils * Review update * Small inference tweaks for pipeline * Config changes * Update worker_inference.py * Small instance seg refactor * Added properties for instance seg params * Utils cleanup * Small refactor of unclear train/val split terminology * Fix log parameters incorrectly printing def dir * Enable sliding window for all instance seg methods * Update instance_segmentation.py Refactor sliding window to not shadow builtin "function" * Fixed mistake in auto-check for WNet results * Fix for restarting train worker after force stop * Docs & images update * mv welcome image * Improved inference docs * Update inference_module_guide.rst * Attempt to fix M1 yaml * Config docstring update * Welcome page update * Docs update * Add WandB for supervised models * Added auto contrast reset in cropping * Added checks for instance labels in training * Check for custom weights before locking window inference * Improve review plots makers * Documentation update (Timokleia) (#53) * Update cropping_module_guide.rst changes in the cropping module guide * Update cropping_module_guide.rst add `` * Update inference_module_guide.rst additions to inference module * Update metrics_module_guide.rst adjusting the metrics module * Update review_module_guide.rst review module updates * Update training_module_guide.rst changes in the training module * Update training_wnet.rst additions in the wnet module * Update utils_module_guide.rst utilities updates * review parameters image * Update cropping_module_guide.rst emoji * Update metrics_module_guide.rst emoji * Update training_module_guide.rst emoji * Update utils_module_guide.rst emoji * Update cropping_module_guide.rst mild style changes * Update review_module_guide.rst adjusting image code * Update welcome.rst changes to welcome * Add files via upload * Review and training tweaks - Fixed a few links, indents, typos - Replaced some emojis and added new ones for other pages * Welcome and inference tweaks - Fixed minor formatting, tables, broken links issues, etc * RM unused model wrappers attributes * Inference edits * Update WNet and inference * Images update * Update plots_train.png * Restore walkthrough * Update detailed_walkthrough.rst * Update detailed_walkthrough.rst editions * Minor edits --------- Co-authored-by: C-Achard <[email protected]> * Added floats in small remove * Try to fix issue with float/long * Add except handling for layer removal in train * Add first version of dedicated install page - Add install page - Refacto/clean up welcome page - Add more useful plugins - Update TODO * Improve training guide * Move M1 install * Added label stats utils * Added label stats doc * Added check for dtype in stats labels * Update utils_module_guide.rst * Experimental classifier to reject bad preds on empty * Experimental classifier to reject bad preds on empty * Update classifier_test.ipynb * WIP Trying to fix some QoL issues - Better exception handling in inference - Swapaxes at mode output - Remove small in Voronoi-Otsu * Fix exception handling * Locating csv issue * Enable ruff again * Handle empty labels in csv stats * Fix call to get_dict when stats is None * Ensure consistent rotation * Fix rotation checks + auto-channel select * Fix test for review * Update installation_guide.rst (#54) refining * Minor edits to install guide * [WIP] GUI-less training example script (#52) * Add remote train scripts * mv dockerfile * Paths for remote train * Change device * Update remote_training.py * Change results path to include more info * Update colab_training.py * Delete Dockerfile.cellseg3d * Make all wandb inits point to same project * Remove deprecated call to AddChannel * Fix tests issue with MONAI 1.3.0 * Create whole_brain_utils.py Add segmentation correction scripts * Update whole_brain_utils.py * Update whole_brain_utils.py * Update whole_brain_utils.py * Update whole_brain_utils.py * Update _config.yml --------- Co-authored-by: Timokleia <[email protected]> Co-authored-by: Mackenzie Mathis <[email protected]> --------- Co-authored-by: Timokleia <[email protected]> Co-authored-by: Mackenzie Mathis <[email protected]>
1 parent 0c68c31 commit eef7eac

File tree

127 files changed

+10220
-3524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+10220
-3524
lines changed

.github/workflows/build_docs.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,38 @@
1-
name: Deploy Sphinx documentation to Pages
1+
name: deploy
22

33
on:
44
push:
55
branches: # branch to trigger deployment
66
- main
77

8+
# This job installs dependencies, build the book, and pushes it to `gh-pages`
89
jobs:
9-
pages:
10-
runs-on: ubuntu-20.04
10+
build-and-deploy-book:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
python-version: [3.8]
1116
steps:
12-
- id: deployment
13-
uses: sphinx-notes/pages@v3
17+
- uses: actions/checkout@v2
18+
19+
# Install dependencies
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v1
1422
with:
15-
publish: false
16-
- uses: peaceiris/actions-gh-pages@v3
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
pip install jupyter-book
27+
28+
# Build the book
29+
- name: Build the book
30+
run: |
31+
jupyter-book build docs/
32+
33+
# Deploy the book's HTML to gh-pages branch
34+
- name: GitHub Pages action
35+
uses: peaceiris/[email protected]
1736
with:
1837
github_token: ${{ secrets.GITHUB_TOKEN }}
19-
publish_dir: ${{ steps.deployment.outputs.artifact }}
38+
publish_dir: docs/_build/html

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,17 @@ venv/
9393
# written by setuptools_scm
9494
**/_version.py
9595

96+
# WANDB
97+
/wandb/
9698

9799

98100
########
99101
#project specific
100102
#dataset, weights, old logos, requirements
101103
/napari_cellseg3d/code_models/models/dataset/
102104
/napari_cellseg3d/code_models/models/saved_weights/
103-
/docs/res/logo/old_logo/
105+
/docs/source/logo/old_logo/
106+
/docs/source/code/_autosummary/
104107
/reqs/
105108
/loss_plots/
106109
/wandb/
@@ -120,3 +123,8 @@ notebooks/instance_test.ipynb
120123
!napari_cellseg3d/_tests/res/wnet_test/lab/*.tif
121124
!napari_cellseg3d/_tests/res/wnet_test/vol/*.tif
122125
cov.syspath.txt
126+
127+
#include docs images
128+
!docs/source/logo/*
129+
!docs/source/images/*
130+
napari_cellseg3d/dev_scripts/wandb

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ repos:
77
- id: trailing-whitespace
88
- id: check-yaml
99
- id: check-added-large-files
10+
args: [--maxkb=5000]
1011
- id: check-toml
1112
# - repo: https://github.com/pycqa/isort
1213
# rev: 5.12.0

conda/napari_cellseg3d_m1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
- tifffile>=2022.2.9
1717
- imageio-ffmpeg>=0.4.5
1818
- torch>=1.11
19-
- monai[nibabel,einops]>=0.9.0
19+
- monai>=0.9.0
2020
- tqdm
2121
- nibabel
2222
- scikit-image

docs/Makefile

Lines changed: 0 additions & 196 deletions
This file was deleted.

docs/TODO.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[//]: # (
2+
TODO:
3+
- [ ] Add a way to get the current version of the library
4+
- [x] Update all modules
5+
- [x] Better WNet tutorial
6+
- [x] Setup GH Actions
7+
- [ ] Add a bibliography
8+
)

docs/_config.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Book settings
2+
# Learn more at https://jupyterbook.org/customize/config.html
3+
4+
title: napari-cellseg3d Documentation
5+
author: Cyril Achard, Maxime Vidal, Timokleia Kousi, Mackenzie Mathis | Mathis Laboratory
6+
logo: source/logo/logo_alpha.png
7+
8+
# Force re-execution of notebooks on each build.
9+
# See https://jupyterbook.org/content/execute.html
10+
execute:
11+
execute_notebooks: force
12+
13+
# Define the name of the latex output file for PDF builds
14+
latex:
15+
latex_documents:
16+
targetname: book.tex
17+
18+
# Add a bibtex file so that we can create citations
19+
bibtex_bibfiles:
20+
- references.bib
21+
22+
# Information about where the book exists on the web
23+
repository:
24+
url: https://github.com/AdaptiveMotorControlLab/CellSeg3d # Online location of your book
25+
path_to_book: docs # Optional path to your book, relative to the repository root
26+
branch: main # Which branch of the repository should be used when creating links (optional)
27+
28+
# Add GitHub buttons to your book
29+
# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository
30+
html:
31+
use_issues_button: true
32+
use_repository_button: true
33+
34+
# Add auto-generated API docs
35+
sphinx:
36+
extra_extensions:
37+
- 'sphinx.ext.napoleon'
38+
- 'sphinx.ext.autodoc'
39+
- 'sphinx.ext.autosummary'
40+
- 'sphinx.ext.viewcode'
41+
- 'sphinx.ext.autosectionlabel'
42+
config:
43+
add_module_names: False
44+
autosectionlabel_prefix_document: True
45+
autosummary_generate: True
46+
autoclass_content: "both"
47+
# templates_path: ['_templates']
48+
exclude_patterns:
49+
- '_build'
50+
- '_templates'
51+
# - 'napari_cellseg3d/__pycache__'
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autoclass:: {{ objname }}
6+
:members:
7+
:show-inheritance:
8+
9+
{% block methods %}
10+
{% if methods %}
11+
.. rubric:: {{ _('Methods') }}
12+
13+
.. autosummary::
14+
:nosignatures:
15+
{% for item in methods %}
16+
{%- if not item.startswith('_') %}
17+
~{{ name }}.{{ item }}
18+
{%- endif -%}
19+
{%- endfor %}
20+
{% endif %}
21+
{% endblock %}
22+
23+
{% block attributes %}
24+
{% if attributes %}
25+
.. rubric:: {{ _('Attributes') }}
26+
27+
.. autosummary::
28+
{% for item in attributes %}
29+
~{{ name }}.{{ item }}
30+
{%- endfor %}
31+
{% endif %}
32+
{% endblock %}

0 commit comments

Comments
 (0)