Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- README.md +4 -31
- app.py +3 -13
- model.int8.onnx +3 -0
- model.sim.onnx +3 -0
- requirements.txt +2 -3
README.md
CHANGED
|
@@ -1,32 +1,5 @@
|
|
| 1 |
-
|
| 2 |
-
title: csPWS Nuclei Segmentation
|
| 3 |
-
emoji: 🧬
|
| 4 |
-
colorFrom: indigo
|
| 5 |
-
colorTo: green
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version: 5.43.1
|
| 8 |
-
app_file: app.py
|
| 9 |
-
pinned: true
|
| 10 |
-
---
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
## How to Use
|
| 17 |
-
1. Upload a fused csPWS composite (Σ, BF, SW → RGB).
|
| 18 |
-
2. The model returns a **binary mask** (white = nuclei).
|
| 19 |
-
3. Download/save the mask for downstream chromatin analysis.
|
| 20 |
-
|
| 21 |
-
## Behind the Scenes
|
| 22 |
-
- **Model:** U-Net + Attention (exported to ONNX, INT8 quant supported)
|
| 23 |
-
- **Runtime:** ONNX Runtime (CPU by default; CoreML if available)
|
| 24 |
-
- **UI:** Gradio
|
| 25 |
-
|
| 26 |
-
## Notes
|
| 27 |
-
- This demo is trained on **synthetic** data; real csPWS generalization will be added later.
|
| 28 |
-
- For PyTorch checkpoint mode, add `torch` to requirements and launch with `--ckpt` in `scripts/gradio_app.py`.
|
| 29 |
-
|
| 30 |
-
## Links
|
| 31 |
-
- **Model repo:** https://huggingface.co/jahidularafat/cspws-unet-attn
|
| 32 |
-
- **Space repo:** https://huggingface.co/spaces/jahidularafat/cspws-space
|
|
|
|
| 1 |
+
# csPWS Nuclei Segmentation — Space
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
This Space runs an ONNX model for nuclei segmentation from csPWS composites.
|
| 4 |
+
- Upload fused Σ/BF/SW image → segmentation mask + overlay
|
| 5 |
+
- Auto-picks `model.int8.onnx` > `model.sim.onnx` > `model.onnx` at runtime
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -1,13 +1,3 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
sys.path.append(str(Path("scripts").absolute()))
|
| 5 |
-
from gradio_app import main
|
| 6 |
-
if __name__ == "__main__":
|
| 7 |
-
os.system("python scripts/gradio_app.py --onnx model.onnx --channels 3 --img-size 256 --port 7860")
|
| 8 |
-
else:
|
| 9 |
-
import gradio as gr
|
| 10 |
-
def hello(x): return x
|
| 11 |
-
demo = gr.Interface(fn=hello, inputs="image", outputs="image", title="csPWS Fallback App")
|
| 12 |
-
if __name__ == "__main__":
|
| 13 |
-
demo.launch(server_port=7860)
|
|
|
|
| 1 |
+
from scripts.gradio_app import main
|
| 2 |
+
if __name__ == "__main__":
|
| 3 |
+
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
model.int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:abe3d43a2d19a4b8eb46d7cbf591c63541b8085c00437cff30cde8797bcbc1d5
|
| 3 |
+
size 39925272
|
model.sim.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e4c2aae2d08ca1802202c43fcdfb50119c632816f190d05a66efd045f65eec09
|
| 3 |
+
size 125544999
|
requirements.txt
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
|
|
| 1 |
gradio>=4.0.0
|
| 2 |
-
|
| 3 |
-
onnx>=1.15.0
|
| 4 |
numpy
|
| 5 |
-
pillow
|
|
|
|
| 1 |
+
onnxruntime>=1.17.0
|
| 2 |
gradio>=4.0.0
|
| 3 |
+
Pillow
|
|
|
|
| 4 |
numpy
|
|
|