Image-to-Image
Diffusers
English
histopathology
diffusion
image-generation
medical-imaging
latent-diffusion
semantic-synthesis
tissue-synthesis
computational-pathology
stable-diffusion
Instructions to use Saghir/HeteroTissueDiffuse with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Saghir/HeteroTissueDiffuse with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Saghir/HeteroTissueDiffuse", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
saghiralfasly Claude Sonnet 4.6 commited on
Commit ·
c6c114d
1
Parent(s): e59e2b1
Add model checkpoints for all three datasets
Browse files- camelyon16/epoch=000064.ckpt (64 epochs, Jan 2024)
- panda/last.ckpt (Jan 2024)
- tcga/last.ckpt (232 epochs, May 2025, 100 pseudo-phenotype clusters)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- README.md +22 -9
- camelyon16/epoch=000064.ckpt +3 -0
- panda/last.ckpt +3 -0
- tcga/last.ckpt +3 -0
README.md
CHANGED
|
@@ -74,9 +74,9 @@ The tissue crops are small patches (typically 30–60px) extracted from a refere
|
|
| 74 |
|
| 75 |
| File | Dataset | Description |
|
| 76 |
|------|---------|-------------|
|
| 77 |
-
| `camelyon16/epoch=000064.ckpt` | Camelyon16 | Binary tumor/normal masks, 256×256 |
|
| 78 |
-
| `panda/
|
| 79 |
-
| `tcga/
|
| 80 |
|
| 81 |
---
|
| 82 |
|
|
@@ -100,18 +100,31 @@ pip install huggingface_hub
|
|
| 100 |
|
| 101 |
python - <<'EOF'
|
| 102 |
from huggingface_hub import hf_hub_download
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
EOF
|
| 109 |
```
|
| 110 |
|
| 111 |
-
Or via CLI:
|
| 112 |
```bash
|
|
|
|
| 113 |
huggingface-cli download KimiaLabMayo/HeteroTissueDiffuse \
|
| 114 |
camelyon16/epoch=000064.ckpt --local-dir inference/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
```
|
| 116 |
|
| 117 |
### 3. Run inference
|
|
|
|
| 74 |
|
| 75 |
| File | Dataset | Description |
|
| 76 |
|------|---------|-------------|
|
| 77 |
+
| `camelyon16/epoch=000064.ckpt` | Camelyon16 | Binary tumor/normal masks, 256×256, 64 epochs |
|
| 78 |
+
| `panda/last.ckpt` | PANDA | Gleason tissue regions, 256×256 |
|
| 79 |
+
| `tcga/last.ckpt` | TCGA (self-supervised) | 100 pseudo-phenotype clusters, 256×256, 232 epochs |
|
| 80 |
|
| 81 |
---
|
| 82 |
|
|
|
|
| 100 |
|
| 101 |
python - <<'EOF'
|
| 102 |
from huggingface_hub import hf_hub_download
|
| 103 |
+
# Camelyon16
|
| 104 |
+
hf_hub_download(repo_id="KimiaLabMayo/HeteroTissueDiffuse",
|
| 105 |
+
filename="camelyon16/epoch=000064.ckpt", local_dir="inference/")
|
| 106 |
+
# PANDA
|
| 107 |
+
hf_hub_download(repo_id="KimiaLabMayo/HeteroTissueDiffuse",
|
| 108 |
+
filename="panda/last.ckpt", local_dir="inference/")
|
| 109 |
+
# TCGA
|
| 110 |
+
hf_hub_download(repo_id="KimiaLabMayo/HeteroTissueDiffuse",
|
| 111 |
+
filename="tcga/last.ckpt", local_dir="inference/")
|
| 112 |
EOF
|
| 113 |
```
|
| 114 |
|
| 115 |
+
Or via CLI (download one dataset at a time):
|
| 116 |
```bash
|
| 117 |
+
# Camelyon16
|
| 118 |
huggingface-cli download KimiaLabMayo/HeteroTissueDiffuse \
|
| 119 |
camelyon16/epoch=000064.ckpt --local-dir inference/
|
| 120 |
+
|
| 121 |
+
# PANDA
|
| 122 |
+
huggingface-cli download KimiaLabMayo/HeteroTissueDiffuse \
|
| 123 |
+
panda/last.ckpt --local-dir inference/
|
| 124 |
+
|
| 125 |
+
# TCGA
|
| 126 |
+
huggingface-cli download KimiaLabMayo/HeteroTissueDiffuse \
|
| 127 |
+
tcga/last.ckpt --local-dir inference/
|
| 128 |
```
|
| 129 |
|
| 130 |
### 3. Run inference
|
camelyon16/epoch=000064.ckpt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f07d5c113416253bc019853f65a69295952ebcc47f8c967ed64da35c0e13f31d
|
| 3 |
+
size 3665396955
|
panda/last.ckpt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5c69404f6afab882312a00c6256bd6b47cb6bdd46cf7854943969365e3086627
|
| 3 |
+
size 3665396955
|
tcga/last.ckpt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:340b5b646608edadbcb4c3bb40d631a56229b1da4f3490e1292dca66163f5f52
|
| 3 |
+
size 3665470078
|