faceless-void commited on
Commit
56fc556
Β·
verified Β·
1 Parent(s): 6511458

User-facing badges, upload guidelines, remove jargon from header

Browse files
Files changed (1) hide show
  1. app.py +27 -13
app.py CHANGED
@@ -275,27 +275,25 @@ if gallery_data:
275
 
276
  with gr.Blocks(title="UNIStainNet -- Virtual IHC Staining") as demo:
277
 
278
- # ── Header (all inline styles for Gradio 6.x compatibility) ──
279
  gr.HTML("""
280
  <div style="text-align:center; padding:1.5rem 1rem 0.5rem 1rem;">
281
  <h1 style="font-size:1.8rem; font-weight:700; margin-bottom:0.3rem;">UNIStainNet</h1>
282
  <p style="font-size:1.05rem; color:#555; margin-top:0.2rem;">
283
- Foundation-Model-Guided Virtual Staining of H&amp;E to IHC
284
  </p>
285
  </div>
286
  <p style="text-align:center; color:#555; font-size:0.95rem; margin-bottom:0.8rem;">
287
- Translate H&amp;E histopathology images into immunohistochemistry (IHC) stains
288
- for breast cancer biomarkers using a single unified deep learning model.
289
  </p>
290
  <div style="display:flex; justify-content:center; gap:0.6rem; flex-wrap:wrap; margin-bottom:1rem;">
291
  <span style="display:inline-block; padding:0.25rem 0.75rem; border-radius:999px;
292
- font-size:0.8rem; font-weight:600; background:#dce3f9; color:#1a3a8a;">42M Parameters</span>
293
  <span style="display:inline-block; padding:0.25rem 0.75rem; border-radius:999px;
294
- font-size:0.8rem; font-weight:600; background:#d4edda; color:#155724;">4 IHC Stains</span>
295
  <span style="display:inline-block; padding:0.25rem 0.75rem; border-radius:999px;
296
- font-size:0.8rem; font-weight:600; background:#e8d5f5; color:#5b1a8a;">UNI Foundation Model</span>
297
- <span style="display:inline-block; padding:0.25rem 0.75rem; border-radius:999px;
298
- font-size:0.8rem; font-weight:600; background:#f5ddc4; color:#7a3b10;">Single Forward Pass</span>
299
  </div>
300
  """)
301
 
@@ -353,8 +351,16 @@ with gr.Blocks(title="UNIStainNet -- Virtual IHC Staining") as demo:
353
  )
354
  else:
355
  gr.Markdown(
356
- "Upload an H&E image and select a target IHC stain. "
357
- "The model generates the virtual stain in a single forward pass (~1 second on GPU)."
 
 
 
 
 
 
 
 
358
  )
359
  with gr.Row():
360
  with gr.Column(scale=1):
@@ -390,8 +396,16 @@ with gr.Blocks(title="UNIStainNet -- Virtual IHC Staining") as demo:
390
  )
391
  else:
392
  gr.Markdown(
393
- "Generate **all 4 IHC stains** from a single H&E input. "
394
- "This demonstrates the unified multi-stain capability of UNIStainNet."
 
 
 
 
 
 
 
 
395
  )
396
  with gr.Row():
397
  with gr.Column(scale=1):
 
275
 
276
  with gr.Blocks(title="UNIStainNet -- Virtual IHC Staining") as demo:
277
 
278
+ # ── Header ────────────────────────────────────────────────────
279
  gr.HTML("""
280
  <div style="text-align:center; padding:1.5rem 1rem 0.5rem 1rem;">
281
  <h1 style="font-size:1.8rem; font-weight:700; margin-bottom:0.3rem;">UNIStainNet</h1>
282
  <p style="font-size:1.05rem; color:#555; margin-top:0.2rem;">
283
+ Virtual Immunohistochemistry Staining from H&amp;E
284
  </p>
285
  </div>
286
  <p style="text-align:center; color:#555; font-size:0.95rem; margin-bottom:0.8rem;">
287
+ Generate HER2, Ki67, ER, and PR stains from a single H&amp;E breast tissue image
288
+ using one unified deep learning model.
289
  </p>
290
  <div style="display:flex; justify-content:center; gap:0.6rem; flex-wrap:wrap; margin-bottom:1rem;">
291
  <span style="display:inline-block; padding:0.25rem 0.75rem; border-radius:999px;
292
+ font-size:0.8rem; font-weight:600; background:#dce3f9; color:#1a3a8a;">Breast Cancer Biomarkers</span>
293
  <span style="display:inline-block; padding:0.25rem 0.75rem; border-radius:999px;
294
+ font-size:0.8rem; font-weight:600; background:#d4edda; color:#155724;">HER2 / Ki67 / ER / PR</span>
295
  <span style="display:inline-block; padding:0.25rem 0.75rem; border-radius:999px;
296
+ font-size:0.8rem; font-weight:600; background:#e8d5f5; color:#5b1a8a;">One Model, 4 Stains</span>
 
 
297
  </div>
298
  """)
299
 
 
351
  )
352
  else:
353
  gr.Markdown(
354
+ "Upload an H&E image and select a target IHC stain to generate."
355
+ )
356
+ with gr.Accordion("Image upload guidelines", open=False):
357
+ gr.Markdown(
358
+ "- **Tissue type:** H&E-stained breast cancer tissue\n"
359
+ "- **Magnification:** 20x recommended (trained on BCI and MIST datasets)\n"
360
+ "- **Size:** Images are center-cropped and resized to 512x512 internally\n"
361
+ "- **Format:** PNG, JPEG, or TIFF\n"
362
+ "- **Best results:** Regions with invasive carcinoma; "
363
+ "adipose or stromal tissue may produce lower quality output"
364
  )
365
  with gr.Row():
366
  with gr.Column(scale=1):
 
396
  )
397
  else:
398
  gr.Markdown(
399
+ "Generate **all 4 IHC stains** from a single H&E input."
400
+ )
401
+ with gr.Accordion("Image upload guidelines", open=False):
402
+ gr.Markdown(
403
+ "- **Tissue type:** H&E-stained breast cancer tissue\n"
404
+ "- **Magnification:** 20x recommended (trained on BCI and MIST datasets)\n"
405
+ "- **Size:** Images are center-cropped and resized to 512x512 internally\n"
406
+ "- **Format:** PNG, JPEG, or TIFF\n"
407
+ "- **Best results:** Regions with invasive carcinoma; "
408
+ "adipose or stromal tissue may produce lower quality output"
409
  )
410
  with gr.Row():
411
  with gr.Column(scale=1):