"""Hero / landing page — NV-Generate masthead + three equal-height datasheet cards.""" from __future__ import annotations import gradio as gr # SVG modality glyphs — each is a recognizable anatomical silhouette of the modality. # CT: axial body cross-section with spine and ribs. # MR: a k-space spiral trajectory. # MR-Brain: an axial brain outline with hemispheres. SVG_CT = """ """ SVG_MR = """ """ SVG_MRB = """ """ # Each card has exactly 5 spec rows, each value short enough to render on one line. CARDS = [ { "key": "ct", "index": "01", "title": "NV-Generate · CT", "subtitle": "Whole-body synthetic CT with paired anatomy masks.", "icon": SVG_CT, "icon_caption": "Body region · paired anatomy", # Consistent category: USE CASES across all three cards. "uses": ["Segmentation data", "Pathology augmentation", "Privacy-preserving sharing"], "license": "NVIDIA Open Model", "license_tone": "ok", "spec": [ ("MODALITY", "Computed Tomography"), ("ARCHITECTURE", "MAISI-v2 · Rectified Flow"), ("MAX VOLUME", "512 × 512 × 768 vox"), ("SEGMENTATION", "132 classes · paired"), ("LICENSE", "NVIDIA Open Model"), ], "accent_class": "ct", }, { "key": "mr", "index": "02", "title": "NV-Generate · MR", "subtitle": "Multi-contrast, multi-anatomy synthetic MRI.", "icon": SVG_MR, "icon_caption": "Multi-contrast · multi-region", "uses": ["Modality augmentation", "Cross-region training", "Fine-tune base"], "license": "NVIDIA Non-Commercial", "license_tone": "warn", "spec": [ ("MODALITY", "Magnetic Resonance"), ("ARCHITECTURE", "MAISI-v2 · Rectified Flow"), ("MAX VOLUME", "512 × 512 × 128 vox"), ("CONTRASTS", "T1 · T2 · FLAIR · multi-region"), ("LICENSE", "NVIDIA Non-Commercial"), ], "accent_class": "mr", }, { "key": "mr_brain", "index": "03", "title": "NV-Generate · MR Brain", "subtitle": "High-resolution multi-contrast brain MRI.", "icon": SVG_MRB, "icon_caption": "Brain · multi-sequence", "uses": ["Brain segmentation data", "Lesion augmentation", "Sequence translation"], "license": "NVIDIA Open Model", "license_tone": "ok", "spec": [ ("MODALITY", "MR · Brain"), ("ARCHITECTURE", "MAISI-v2 · Rectified Flow"), ("MAX VOLUME", "512 × 512 × 256 vox"), ("SEQUENCES", "T1 · T2 · FLAIR · SWI"), ("LICENSE", "NVIDIA Open Model"), ], "accent_class": "mrb", }, ] def _spec_rows(spec: list[tuple[str, str]]) -> str: rows = [] for k, v in spec: rows.append( f'
{k}' f'' f'{v}
' ) return "".join(rows) def render_hero() -> tuple[gr.Group, dict[str, gr.Button]]: """Build the hero. Returns the wrapping Group and a dict of {key: button}.""" buttons: dict[str, gr.Button] = {} with gr.Group(elem_classes=["hero"]) as group: # Masthead: brand on the left, real links on the right. No decorative pills. gr.HTML( """
NV NV-Generate
""" ) # Hero headline — eyebrow + bold title, no marketing paragraph below. gr.HTML( """
Latent diffusion · MAISI-v2 · open weights

Synthetic 3D medical imaging.

""" ) # Datasheet cards — three equal-height subsystems with gr.Row(elem_classes=["hero-row"], equal_height=True): for card in CARDS: with gr.Column(scale=1, min_width=300, elem_classes=["hero-card-col"]): uses_html = "".join( f'{u}' for u in card.get("uses", []) ) license_tone_cls = "ds-license-warn" if card.get("license_tone") == "warn" else "ds-license-ok" gr.HTML( f"""
{card['icon']}
{card['icon_caption']}
{card['index']}
Available
{card['title']}
{card['subtitle']}
Use cases
{uses_html}
{_spec_rows(card['spec'])}
License {card['license']}
""" ) btn = gr.Button( f"Launch {card['title'].replace(' · ', ' ')} →", elem_classes=["ds-cta", f"ds-cta-{card['accent_class']}"], ) buttons[card["key"]] = btn return group, buttons