Skip to content

Commit

Permalink
Merge branch 'main' into feature/thresholding
Browse files Browse the repository at this point in the history
  • Loading branch information
yrkim98 authored Dec 6, 2024
2 parents a0cb9f6 + 8ae5ff6 commit 18218f1
Show file tree
Hide file tree
Showing 33 changed files with 278 additions and 99 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @hughes036 @yrkim98 @saeliddp
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Describe your data (image format, 2D /3D etc.)**

**Environment (please complete the following information):**
- OS: [e.g. iOS8.1]
- Plugin Version [e.g. 0.16.1]
- PyTorch version [e.g. 2..4.0]
- GPU? [e.g. yes / no]
- CUDA version [e.g. 10.0]

**Additional context**
Add any other context about the problem here.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: needs prioritization, Requests
assignees: ''

---

**Please describe the problem that needs to be solved by this feature**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**How important is this feature to you? (Software team will re-prioritize all tickets based on current workload)**
Critical, high priority, medium priority, or low priority.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Purpose
<!-- What issue does the PR address? -->

## Changes
<!-- What is the effect of the PR? -->

## Testing
<!-- How were these changes tested? Any manual tests? -->

## How to review
<!-- Where should reviewers look? -->
17 changes: 17 additions & 0 deletions .github/workflows/auto_add_bug_tickets_to_project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Auto add bug tickets to project board

on:
issues:
types: [opened]

jobs:
add_to_project:
runs-on: ubuntu-latest
if: contains(github.event.issue.labels.*.name, 'Bug Reports')
steps:
- name: Add bug issue to project
uses: actions/add-to-project@v1
with:
project-url: https://github.com/orgs/AllenCell/projects/10
content-id: ${{ github.event.issue.node_id }}
column-name: Todo
19 changes: 19 additions & 0 deletions .github/workflows/auto_add_dev_tickets_to_project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Auto add dev tickets to project board

on:
issues:
types: [opened]

jobs:
add_to_project:
runs-on: ubuntu-latest
steps:
- name: Check labels and add to project
if: |
!contains(github.event.issue.labels.*.name, 'Requests') &&
!contains(github.event.issue.labels.*.name, 'Bug Reports')
uses: actions/add-to-project@v1
with:
project-url: https://github.com/orgs/AllenCell/projects/7
content-id: ${{ github.event.issue.node_id }}
column-name: Backlog
17 changes: 17 additions & 0 deletions .github/workflows/auto_add_feature_request_to_project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Auto-add feature requests and bug reports to project board

on:
issues:
types: [opened]

jobs:
add_to_project:
runs-on: ubuntu-latest
if: contains(github.event.issue.labels.*.name, 'Requests')
steps:
- name: Add issue to project
uses: actions/add-to-project@v1
with:
project-url: https://github.com/orgs/AllenCell/projects/9
content-id: ${{ github.event.issue.node_id }}
column-name: Scoping
2 changes: 1 addition & 1 deletion .github/workflows/bump_version_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- major
- minor
- patch
- dev
- rc

jobs:
publish:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_lint_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: ["3.10"]
python-version: ["3.9", "3.10"]
2 changes: 1 addition & 1 deletion .github/workflows/test_lint_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10"]
python-version: ["3.9", "3.10"]
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A deep learning-based segmentation Napari plugin to curate datasets, train your



## :hammer_and_wrench: Installation
## 🛠️ Installation

### System Requirements

Expand All @@ -33,7 +33,7 @@ We currently support `Windows`, `MacOS`, and `Linux` operating systems. The mini

Before installing the plugin, please make sure you have the following installed:

- Python 3.10 or later
- `Python >=3.9,<3.11`

__New to `Python`?__ We recommend installing `Python 3.10` through the official [`Python` website](https://www.python.org/downloads/). This will include the `pip` package manager, which is required to install the plugin.

Expand Down Expand Up @@ -62,7 +62,10 @@ Navigate to where you want to create a new environment (_Example._ `Documents`),
# Create a new environment
python3.10 -m venv venv-allen-segmenter-ml

# Activate the environment
# (Windows) Activate the environment
.\venv-allen-segmenter-ml\Scripts\activate

# (Mac/Linux) Activate the environment
source venv-allen-segmenter-ml/bin/activate
```
#### Confirm Virtual Environment is Activated
Expand All @@ -89,19 +92,19 @@ To confirm that the virtual environment has been successfully activated, you can






## Install the Plugin

To install the latest version of the plugin:
To install the latest version of the plugin, along with napari:
```bash
pip install allencell-segmenter-ml
pip install allencell-segmenter-ml[napari]
```

### :rotating_light: Post-Installation :rotating_light:
You do not need to install `napari` separately as it is included in the plugin.

### 🚨 Post-Installation 🚨

> :memo: __NOTE:__ This section is specifically for users with at least one NVIDIA GPU installed on their machine. Not sure if you have an NVIDIA GPU? You can check by running `nvidia-smi` as shown [below](#step-1-checking-cuda-version). If you __do not__ have an NVIDIA GPU system, you can skip this section.
>[!IMPORTANT]
⚠️ __NOTE:__ This section is specifically for users with at least one NVIDIA GPU installed on their machine. Not sure if you have an NVIDIA GPU? You can check by running `nvidia-smi` as shown [below](#step-1-checking-cuda-version). If you __do not__ have an NVIDIA GPU system, you can skip this section.

Required Package

Expand Down
22 changes: 22 additions & 0 deletions docs/models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
### Pre-Trained Models

| Category | Name | MegaSeg_v1 | MegaSeg_light |
|--------------------|-------------------|---------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| **Model Properties** | Description | CNN-based segmentation model trained on 2600 open 3D fluorescent microscopy images of cellular structures in human hiPSCs | Lighter version of MegaSeg which compromises accuracy for speed |
| | Architecture | nnUNet | small nnUNet with fewer kernels |
| | Loss Function | Generalized dice focal loss | Generalized dice focal loss |
| | Optimization | Adam | Adam |
| | # of Epochs | 1000 | 1000 |
| | Stopping Criteria | Validation loss not improving for 100 epochs | Validation loss not improving for 100 epochs |
| | System Trained On | Nvidia A100 | Nvidia A100 |
| | Validation Step | - | - |
| **Dependencies** | CytoDL Version | 1.7.1 | 1.7.1 |
| | PyTorch Version | 2.4.0+cu118 | 2.4.0+cu118 |
| **Training Data** | Image Resolution | 55x624x924; 60x624x924; 65x600x900; 65x624x924; 70x624x924; 75x624x924; 75x600x900 | 55x624x924; 60x624x924; 65x600x900; 65x624x924; 70x624x924; 75x624x924; 75x600x900 |
| | Minimum Image Size | - | - |
| | Microscope Objective | 100x | 100x |
| | Microscopy Technique | Spinning disk confocal | Spinning disk confocal |
| | Public Data Link | [Dataset Link](https://open.quiltdata.com/b/allencell/tree/aics/hipsc_single_cell_image_dataset/) | [Dataset Link](https://open.quiltdata.com/b/allencell/tree/aics/hipsc_single_cell_image_dataset/) |
| | Expected Performance | On NVIDIA-A100, 80GB, Inference @ 6.01 Secs for an Input image of size 924x624x65 | On NVIDIA-A100, 80GB, Inference @ 2.32 Secs for an Input image of size 924x624x65 |
| | Structures Trained On | Actin bundles, ER(SERCA2), Adherens junctions, Desmosomes, Gap junctions, Myosin, Nuclear pores, Endosomes, ER (SEC61 Beta), Nuclear speckles, Golgi, Tight junctions, Mitochondria | Actin bundles, ER(SERCA2), Adherens junctions, Desmosomes, Gap junctions, Myosin, Nuclear pores, Endosomes, ER (SEC61 Beta), Nuclear speckles, Golgi, Tight junctions, Mitochondria |
| **Inference Data** | Minimum Image Dimension | 16x16x16 | 16x16x16 |
22 changes: 12 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ build-backend = "setuptools.build_meta"
# https://peps.python.org/pep-0621/
[project]
name = "allencell-segmenter-ml"
version = "0.1.16"
version = "1.0.0rc0"
description = "A plugin to leverage ML segmentation in napari"
readme = "README.md"
requires-python = "<3.11,>=3.10"
requires-python = ">=3.9,<3.11"
license = { file = "LICENSE" }
authors = [
{ email = "[email protected]", name = "Brian Kim" },
{ email = "[email protected]", name = "Chris Hughes" },
{ email = "[email protected]", name = "Daniel Saelid" },
]

classifiers = [
"Development Status :: 2 - Pre-Alpha",
Expand All @@ -29,12 +24,12 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: Image Processing",
]

dependencies = [
"napari>=0.4.18",
"npe2>=0.6.2",
"numpy",
"hydra-core==1.3.2",
Expand All @@ -54,6 +49,11 @@ Documentation = "https://github.com/AllenCell/allencell-ml-segmenter#README.md"
# extra dependencies
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
[project.optional-dependencies]
napari = [
"napari>=0.4.18",
"pyqt5",
]

test_lint = [
"pytest<8.0.0", # https://docs.pytest.org/en/latest/contents.html
"pytest-cov", # https://pytest-cov.readthedocs.io/en/latest/
Expand All @@ -66,6 +66,8 @@ test_lint = [
"mypy",
"toml",
"bumpver",
"napari>=0.4.18",
"magicgui"
]

dev = [
Expand Down Expand Up @@ -103,8 +105,8 @@ where = ["src"]

# https://pypi.org/project/bumpver
[tool.bumpver]
current_version = "0.1.16"
version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
current_version = "1.0.0rc0"
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
commit_message = "Bump version {old_version} -> {new_version}"
commit = true
tag = false # no longer useful to tag here, must happen in create_publish_pr.yaml
Expand Down
2 changes: 1 addition & 1 deletion src/allencell_ml_segmenter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.16"
__version__ = "1.0.0rc0"

from allencell_ml_segmenter.napari.napari_reader import napari_get_reader
from allencell_ml_segmenter.napari.sample_data import make_sample_data
Expand Down
2 changes: 1 addition & 1 deletion src/allencell_ml_segmenter/_tests/scripts/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = "0.0.1"
# https://pypi.org/project/bumpver
[tool.bumpver]
current_version = "0.0.1"
version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
commit = false
tag = false # no longer useful to tag here, must happen in create_publish_pr.yaml
push = false
Expand Down
Loading

0 comments on commit 18218f1

Please sign in to comment.