added references

master
laynholt 2 months ago
parent d2d4596fc6
commit ca6465296a

@ -1,5 +1,7 @@
# Cell Segmentator
---
## Overview
This repository provides two main scripts to configure and run a cell segmentation workflow:
@ -7,6 +9,8 @@ This repository provides two main scripts to configure and run a cell segmentati
* **generate\_config.py**: Interactive script to create JSON configuration files for training or prediction.
* **main.py**: Entry point to train, test, or predict using the generated configuration.
---
## Installation
0. **Install uv**:
@ -40,6 +44,8 @@ Follow the official guide at [https://docs.astral.sh/uv/](https://docs.astral.sh
uv sync
```
---
## Dataset Structure
Your data directory must follow this hierarchy:
@ -75,6 +81,8 @@ In this case, set the `masks_subdir` field in your dataset configuration to the
**Mask format**: Instance masks should be provided for multi-label segmentation with channel-last ordering, i.e., each mask array must have shape `(H, W, C)`.
---
## generate\_config.py
This script guides you through creating a JSON configuration for either training or prediction.
@ -101,6 +109,8 @@ Generated config includes sections:
* `wandb_config`: Weights & Biases integration settings
* *(If training)* `criterion`, `optimizer`, `scheduler`
---
## main.py
Entrypoint to run training, testing, or prediction using a config file.
@ -125,6 +135,8 @@ python main.py [-c CONFIG] [-m {train,test,predict}] [--no-save-masks] [--only-m
5. **Run** training or inference (`.run()`).
6. **Save** model checkpoint and upload to W\&B if in training mode.
---
## Configurable Parameters
A brief overview of the key parameters you can adjust in your JSON config:
@ -155,6 +167,8 @@ A brief overview of the key parameters you can adjust in your JSON config:
> **Batch size note:** Validation, testing, and prediction runs always use a batch size of `1`, regardless of the `batch_size` setting in the training configuration.
---
## Examples
### Generate a training config
@ -177,4 +191,11 @@ python main.py -c config/templates/train/YourConfig.json -m train
python main.py -c config/templates/predict/YourConfig.json -m predict
```
---
---
## Acknowledgments
This project was developed building upon the following open-source repositories:
* [Cellpose](https://github.com/MouseLand/cellpose) by the MouseLand Lab.
* [MEDIAR](https://github.com/Lee-Gihun/MEDIAR) by Lee Gihun.

@ -1,3 +1,12 @@
"""
This code is adapted from the following codes:
[1] https://github.com/MouseLand/cellpose/blob/main/cellpose/utils.py
[2] https://github.com/MouseLand/cellpose/blob/main/cellpose/dynamics.py
[3] https://github.com/MouseLand/cellpose/blob/main/cellpose/metrics.py
[4] https://github.com/Lee-Gihun/MEDIAR/tree/main/core
[5] https://github.com/Lee-Gihun/MEDIAR/tree/main/core/MEDIAR
"""
import random
import numpy as np
from numba import njit, prange

@ -1,7 +1,6 @@
"""
Adapted from:
[1] https://github.com/JunMa11/NeurIPS-CellSeg/blob/main/baseline/compute_metric.py
[2] https://github.com/stardist/stardist/blob/master/stardist/matching.py
This code is adapted from the following codes:
[1] https://github.com/Lee-Gihun/MEDIAR/blob/main/train_tools/measures.py
"""
import numpy as np

Loading…
Cancel
Save