File size: 2,163 Bytes
40b0954
dc80c6b
 
 
 
40b0954
 
 
dc80c6b
 
 
40b0954
 
dc80c6b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
title: P2Echo · Text-Prompted Echo Segmentation
emoji: 🫀
colorFrom: purple
colorTo: green
sdk: gradio
sdk_version: 6.32.0
app_file: app.py
short_description: Text-prompted multi-view echocardiography segmentation
python_version: "3.12"
startup_duration_timeout: 30m
---

# P2Echo · Text-Prompted Echocardiography Segmentation

**P2Echo** segments cardiac structures (LV, MYO, LA, RV, RA) across four echocardiography
views (2CH, 3CH, 4CH, PSAX) with a single 37.5M-parameter model controlled by structured
text prompts. Pick the view, select the structures to segment, and the demo builds the
paper's view-aware prompt (e.g. *"Apical 4-Chamber (4CH): … Segment the LV: The LV appears
as a bullet-shaped chamber forming the apex."*) and runs one forward pass.

- **Paper**: [Prompt2Echo (P2Echo): Text-Prompted Multi-View Echocardiography Segmentation with One Model](https://arxiv.org/abs/2611.13425)
- **Code**: [github.com/moeinheidari7829/P2Echo](https://github.com/moeinheidari7829/P2Echo)
- **Weights**: [moein99/P2Echo](https://huggingface.co/moein99/P2Echo)

## How it works

1. The requested structures are turned into the paper's view-aware text prompts.
2. A frozen **Qwen3-Embedding-0.6B** text encoder embeds each prompt.
3. The **P2Echo** segmentation network (PVTv2-B2 encoder + DyITA prompt decoder)
   processes the frame with all structure prompts in one forward pass.
4. Each structure's logit map is thresholded and colour-blended over the input.

## Example images

The bundled example frames are from the Yale University echocardiography atlas
([four chamber](https://commons.wikimedia.org/wiki/File:Apical_4_chamber_view.png),
[two chamber](https://commons.wikimedia.org/wiki/File:Apical2Chamber.png),
[short axis](https://commons.wikimedia.org/wiki/File:LeftVentricleShortAxis.gif)),
via Wikimedia Commons, © Patrick J. Lynch and C. Carl Jaffe, Yale Center for Advanced
Instructional Media, licensed under [CC BY 2.5](https://creativecommons.org/licenses/by/2.5/).

## Disclaimer

P2Echo is a research prototype. It has **not** been validated for clinical use and must
not be used for diagnosis or any clinical decision-making.