Add files using upload-large-folder tool
Browse files- .gitattributes +2 -0
- MODEL_LICENSE.md +24 -0
- README.md +110 -0
- zebrafish_fibroblast_cpsam +3 -0
- zebrafish_macrophage_cpsam +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
zebrafish_fibroblast_cpsam filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
zebrafish_macrophage_cpsam filter=lfs diff=lfs merge=lfs -text
|
MODEL_LICENSE.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Model Weight License
|
| 2 |
+
|
| 3 |
+
The released fine-tuned model weights are licensed under Creative Commons
|
| 4 |
+
Attribution-NonCommercial 4.0 International (`CC BY-NC 4.0`).
|
| 5 |
+
|
| 6 |
+
In practical terms, this allows sharing and adaptation with attribution for
|
| 7 |
+
non-commercial use. It does not grant commercial use rights for the model
|
| 8 |
+
weights.
|
| 9 |
+
|
| 10 |
+
## Rationale
|
| 11 |
+
|
| 12 |
+
This project fine-tunes Cellpose-SAM (`cpsam`). The Cellpose software and the
|
| 13 |
+
upstream `mouseland/cellpose-sam` Hugging Face repository are distributed under
|
| 14 |
+
BSD 3-Clause, while the Cellpose README notes that Cellpose-SAM was trained on
|
| 15 |
+
CC-BY-NC data and that the Cellpose annotated dataset is CC-BY-NC.
|
| 16 |
+
|
| 17 |
+
Because this release is an experimental fine-tune intended for research use,
|
| 18 |
+
the model weights are published under `CC BY-NC 4.0` to preserve a
|
| 19 |
+
non-commercial use boundary. This is a license choice for these released
|
| 20 |
+
fine-tuned weights; it is not a statement that the GitHub code has the same
|
| 21 |
+
license.
|
| 22 |
+
|
| 23 |
+
The GitHub code, notebooks, and documentation are separate from the model
|
| 24 |
+
weights and are licensed under the BSD 3-Clause License.
|
README.md
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
+
library_name: cellpose
|
| 4 |
+
base_model: mouseland/cellpose-sam
|
| 5 |
+
pipeline_tag: image-segmentation
|
| 6 |
+
tags:
|
| 7 |
+
- biology
|
| 8 |
+
- microscopy
|
| 9 |
+
- image-segmentation
|
| 10 |
+
- cell-segmentation
|
| 11 |
+
- cellpose
|
| 12 |
+
- zebrafish
|
| 13 |
+
- experimental
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Zebrafish Cellpose-SAM Fine-Tunes
|
| 17 |
+
|
| 18 |
+
Experimental Cellpose-SAM fine-tunes for zebrafish microscopy cell
|
| 19 |
+
segmentation.
|
| 20 |
+
|
| 21 |
+
## What Is Included
|
| 22 |
+
|
| 23 |
+
This model repository contains two Cellpose model files:
|
| 24 |
+
|
| 25 |
+
| File | Target cells | Training pairs | Validation pairs | Size | SHA-256 |
|
| 26 |
+
| --- | --- | ---: | ---: | ---: | --- |
|
| 27 |
+
| `zebrafish_macrophage_cpsam` | Macrophages | 28 | 7 | 1,218,639,667 bytes | `2c71c9ba9b6a41d39b02027721bd3edbb0e5a9fff969f58fa774aedd09760fcc` |
|
| 28 |
+
| `zebrafish_fibroblast_cpsam` | Fibroblasts | 46 | 12 | 1,218,639,667 bytes | `321056e7687254189529e8a424b59c8a84cd42560c03b3b677c9ee601bc368e3` |
|
| 29 |
+
|
| 30 |
+
The source microscopy data were 3D zebrafish stacks. The fine-tunes were
|
| 31 |
+
trained from extracted 2D z-slices with Cellpose-style instance masks.
|
| 32 |
+
|
| 33 |
+
## Intended Use
|
| 34 |
+
|
| 35 |
+
Use these weights for exploratory segmentation of similar zebrafish microscopy
|
| 36 |
+
data. Performance should be checked on representative images from your own
|
| 37 |
+
acquisition conditions before using the masks for quantitative biological
|
| 38 |
+
analysis.
|
| 39 |
+
|
| 40 |
+
## Training Data
|
| 41 |
+
|
| 42 |
+
- Base model: Cellpose-SAM `cpsam`.
|
| 43 |
+
- Training software: Cellpose `4.1.1`.
|
| 44 |
+
- Training hardware: CPU-only cluster nodes.
|
| 45 |
+
- Labels: initial Cellpose output followed by manual correction/segmentation.
|
| 46 |
+
|
| 47 |
+
## Data Scope
|
| 48 |
+
|
| 49 |
+
- Trained on extracted 2D z-slices from one 3D zebrafish time point/source
|
| 50 |
+
context.
|
| 51 |
+
- Validation examples are held-out z-slices from the same imaging context.
|
| 52 |
+
- Labels were initialized with Cellpose and manually corrected/segmented.
|
| 53 |
+
- Best suited to similar zebrafish microscopy acquisitions; check a few
|
| 54 |
+
representative images before quantitative use.
|
| 55 |
+
|
| 56 |
+
## Example Usage
|
| 57 |
+
|
| 58 |
+
Download a model file and pass its local path to Cellpose:
|
| 59 |
+
|
| 60 |
+
```bash
|
| 61 |
+
hf download SDu90/zebrafish-cellpose-finetunes \
|
| 62 |
+
zebrafish_fibroblast_cpsam \
|
| 63 |
+
--local-dir models
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
```python
|
| 67 |
+
from cellpose import models
|
| 68 |
+
import tifffile as tiff
|
| 69 |
+
|
| 70 |
+
image = tiff.imread("input_stack.tif")
|
| 71 |
+
model = models.CellposeModel(
|
| 72 |
+
gpu=False,
|
| 73 |
+
pretrained_model="models/zebrafish_fibroblast_cpsam",
|
| 74 |
+
)
|
| 75 |
+
|
| 76 |
+
masks, flows, styles = model.eval(
|
| 77 |
+
image,
|
| 78 |
+
do_3D=False,
|
| 79 |
+
z_axis=0,
|
| 80 |
+
stitch_threshold=0.4,
|
| 81 |
+
diameter=15,
|
| 82 |
+
cellprob_threshold=0.0,
|
| 83 |
+
min_size=100,
|
| 84 |
+
)
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
For GPU inference, initialize Cellpose with `gpu=True` and an appropriate torch
|
| 88 |
+
device.
|
| 89 |
+
|
| 90 |
+
## License
|
| 91 |
+
|
| 92 |
+
The model weights are released under Creative Commons
|
| 93 |
+
Attribution-NonCommercial 4.0 International (`CC BY-NC 4.0`). The companion
|
| 94 |
+
GitHub code, notebooks, and documentation are licensed separately under BSD
|
| 95 |
+
3-Clause.
|
| 96 |
+
|
| 97 |
+
## Citation
|
| 98 |
+
|
| 99 |
+
If you use these weights, please cite this Hugging Face repository and the
|
| 100 |
+
relevant Cellpose papers:
|
| 101 |
+
|
| 102 |
+
> Pachitariu, M., Rariden, M., & Stringer, C. (2025). Cellpose-SAM:
|
| 103 |
+
> superhuman generalization for cellular segmentation. bioRxiv.
|
| 104 |
+
|
| 105 |
+
> Stringer, C., Wang, T., Michaelos, M., & Pachitariu, M. (2021). Cellpose: a
|
| 106 |
+
> generalist algorithm for cellular segmentation. Nature Methods, 18(1),
|
| 107 |
+
> 100-106.
|
| 108 |
+
|
| 109 |
+
> Pachitariu, M. & Stringer, C. (2022). Cellpose 2.0: how to train your own
|
| 110 |
+
> model. Nature Methods, 1-8.
|
zebrafish_fibroblast_cpsam
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:321056e7687254189529e8a424b59c8a84cd42560c03b3b677c9ee601bc368e3
|
| 3 |
+
size 1218639667
|
zebrafish_macrophage_cpsam
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2c71c9ba9b6a41d39b02027721bd3edbb0e5a9fff969f58fa774aedd09760fcc
|
| 3 |
+
size 1218639667
|