Spaces:
Running
Running
U1020040
commited on
Commit
·
4cffc64
1
Parent(s):
e7a64f4
header update
Browse files
HEADER.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MIPHEI-ViT Demo: 16-channel mIF Prediction
|
| 2 |
+
|
| 3 |
+
<p align="center">
|
| 4 |
+
<a href="https://huggingface.co/Estabousi/MIPHEI-vit" target="_blank" rel="noopener noreferrer" style="display: inline-block;">
|
| 5 |
+
<img src="https://img.shields.io/badge/🤗 Model-MIPHEI--ViT-lightgrey?logo=huggingface" height="25">
|
| 6 |
+
</a>
|
| 7 |
+
<a href="https://github.com/Sanofi-Public/MIPHEI-ViT" target="_blank" rel="noopener noreferrer" style="display: inline-block;">
|
| 8 |
+
<img src="https://img.shields.io/badge/GitHub-Repository-black?logo=github" height="25">
|
| 9 |
+
</a>
|
| 10 |
+
</p>
|
| 11 |
+
|
| 12 |
+
**MIPHEI-ViT** predicts **multiplex immunofluorescence (mIF)** from standard **H&E-stained** histology tiles.
|
| 13 |
+
|
| 14 |
+
Upload a colorectal H&E tile (256×256 px at 0.5 µm/px recommended). Images will be resized if needed — this may affect resolution and output quality.
|
| 15 |
+
|
| 16 |
+
The model returns **16 grayscale images**, each representing a predicted mIF marker. Inference is slow because the Space is using CPU.
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
Try it with low-zoom screenshots from public datasets:
|
| 21 |
+
|
| 22 |
+
**ORION (in-domain test set):**
|
| 23 |
+
- [CRC2](https://labsyspharm.github.io/orion-crc/minerva/P37_S30-CRC02/index.html#s=0&w=0&g=5&m=-1&a=-100_-100&v=1.0673_0.6057_0.5&o=-100_-100_1_1&p=Q)
|
| 24 |
+
- [CRC11](https://labsyspharm.github.io/orion-crc/minerva/P37_S43-CRC11/index.html#s=0&w=0&g=5&m=-1&a=-100_-100&v=0.4823_0.6723_0.5097&o=-100_-100_1_1&p=Q)
|
| 25 |
+
|
| 26 |
+
**TCGA (external):**
|
| 27 |
+
- [GDC Slide Viewer](https://portal.gdc.cancer.gov/image-viewer/MultipleImageViewerPage?isCohortCentric=true&additionalFilters=%7B%22mode%22%3A%22and%22%2C%22root%22%3A%7B%22files.data_type%22%3A%7B%22operator%22%3A%22includes%22%2C%22field%22%3A%22files.data_type%22%2C%22operands%22%3A%5B%22Slide%20Image%22%5D%7D%2C%22cases.samples.preservation_method%22%3A%7B%22operator%22%3A%22includes%22%2C%22field%22%3A%22cases.samples.preservation_method%22%2C%22operands%22%3A%5B%22ffpe%22%5D%7D%2C%22files.access%22%3A%7B%22operator%22%3A%22includes%22%2C%22field%22%3A%22files.access%22%2C%22operands%22%3A%5B%22open%22%5D%7D%7D%7D) (Filter Cases: TCGA*)
|
app.py
CHANGED
|
@@ -38,22 +38,23 @@ def predict(image):
|
|
| 38 |
pil_ch = Image.fromarray(ch_img, mode='L')
|
| 39 |
channel_imgs.append(pil_ch)
|
| 40 |
|
| 41 |
-
# Return
|
| 42 |
return channel_imgs
|
| 43 |
|
| 44 |
-
#
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
"
|
| 54 |
-
"
|
| 55 |
-
|
| 56 |
-
|
|
|
|
| 57 |
|
| 58 |
if __name__ == "__main__":
|
| 59 |
demo.launch()
|
|
|
|
| 38 |
pil_ch = Image.fromarray(ch_img, mode='L')
|
| 39 |
channel_imgs.append(pil_ch)
|
| 40 |
|
| 41 |
+
# Return predicted 16 channels
|
| 42 |
return channel_imgs
|
| 43 |
|
| 44 |
+
# Markdown header
|
| 45 |
+
with open("HEADER.md", "r", encoding="utf-8") as f:
|
| 46 |
+
HEADER_MD = f.read()
|
| 47 |
+
|
| 48 |
+
# Build interface using Blocks
|
| 49 |
+
with gr.Blocks() as demo:
|
| 50 |
+
gr.Markdown(HEADER_MD)
|
| 51 |
+
gr.Interface(
|
| 52 |
+
fn=predict,
|
| 53 |
+
inputs=gr.Image(type="pil", label="Input H&E"),
|
| 54 |
+
outputs=[gr.Image(type="pil", label=f"mIF Channel {channel_names[i]}") for i in range(16)],
|
| 55 |
+
title=None,
|
| 56 |
+
description=None
|
| 57 |
+
)
|
| 58 |
|
| 59 |
if __name__ == "__main__":
|
| 60 |
demo.launch()
|
logo.svg
DELETED