UNIStainNet / README.md
faceless-void's picture
Update README with better feature descriptions and GPU info
9e7b0a0 verified
---
title: UNIStainNet - Virtual IHC Staining
emoji: πŸ”¬
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: "6.10.0"
app_file: app.py
pinned: false
license: mit
hardware: cpu-basic
---
# UNIStainNet: Foundation-Model-Guided Virtual Staining
Virtual staining of H&E histopathology images to IHC (HER2, Ki67, ER, PR) using a single unified 42M-parameter SPADE-UNet conditioned on dense spatial tokens from a frozen UNI pathology foundation model.
## Features
- **Gallery** β€” Browse 16 pre-computed examples from BCI and MIST datasets (no GPU needed)
- **Virtual Staining** β€” Upload an H&E image and generate any IHC stain (GPU required)
- **Cross-Stain Comparison** β€” Generate all 4 stains from a single H&E input (GPU required)
## Architecture
| Component | Details |
|-----------|---------|
| Generator | SPADE-UNet with UNI spatial conditioning + FiLM stain embeddings |
| UNI Features | 4x4 sub-crop tiling β†’ UNI ViT-L/16 β†’ 32x32 spatial tokens (1024-dim) |
| Parameters | 42M (generator), UNI frozen (303M) |
## GPU Support
- **Gallery tab** works on CPU (default hardware)
- **Live inference** requires GPU β€” set Space hardware to ZeroGPU (HF Pro) or run locally with `python app.py`