Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -87,7 +87,7 @@ This model performs **Contextualized Structured Radiology Report Generation (CSR
|
|
| 87 |
- Precision: bfloat16
|
| 88 |
- Attention implementation: Flash Attention 2
|
| 89 |
- Max sequence length: 6144 (extended for longitudinal context)
|
| 90 |
-
- Max images per sample:
|
| 91 |
|
| 92 |
**Hardware:**
|
| 93 |
- GPU: NVIDIA A100 (or equivalent)
|
|
@@ -112,7 +112,8 @@ model = AutoModelForVision2Seq.from_pretrained(
|
|
| 112 |
)
|
| 113 |
processor = AutoProcessor.from_pretrained("StanfordAIMI/CheXagent-2-3b", trust_remote_code=True)
|
| 114 |
|
| 115 |
-
# Load chest X-ray images (current and prior)
|
|
|
|
| 116 |
current_image = Image.open("current_xray.jpg")
|
| 117 |
prior_image = Image.open("prior_xray.jpg")
|
| 118 |
|
|
@@ -127,21 +128,18 @@ messages = [
|
|
| 127 |
"content": [
|
| 128 |
{
|
| 129 |
"type": "text",
|
| 130 |
-
"text": """Analyze the chest X-ray images and write the FINDINGS section of a radiology report.
|
| 131 |
|
| 132 |
-
|
| 133 |
-
|
| 134 |
|
| 135 |
-
|
| 136 |
-
|
| 137 |
|
| 138 |
-
|
| 139 |
-
Prior chest radiograph from 6 months ago available for comparison.
|
| 140 |
-
|
| 141 |
-
==== CURRENT IMAGES ===="""
|
| 142 |
},
|
| 143 |
{"type": "image"}, # Current image
|
| 144 |
-
{"type": "image"} # Prior image (
|
| 145 |
]
|
| 146 |
}
|
| 147 |
]
|
|
|
|
| 87 |
- Precision: bfloat16
|
| 88 |
- Attention implementation: Flash Attention 2
|
| 89 |
- Max sequence length: 6144 (extended for longitudinal context)
|
| 90 |
+
- Max images per sample: 1
|
| 91 |
|
| 92 |
**Hardware:**
|
| 93 |
- GPU: NVIDIA A100 (or equivalent)
|
|
|
|
| 112 |
)
|
| 113 |
processor = AutoProcessor.from_pretrained("StanfordAIMI/CheXagent-2-3b", trust_remote_code=True)
|
| 114 |
|
| 115 |
+
# Load chest X-ray images (current and prior studies)
|
| 116 |
+
# CSRRG models support multiple images for temporal comparison (max_images_per_sample: 1)
|
| 117 |
current_image = Image.open("current_xray.jpg")
|
| 118 |
prior_image = Image.open("prior_xray.jpg")
|
| 119 |
|
|
|
|
| 128 |
"content": [
|
| 129 |
{
|
| 130 |
"type": "text",
|
| 131 |
+
"text": """Analyze the chest X-ray images and write the FINDINGS section of a radiology report. Use standard medical terminology and organize findings by anatomical regions. Consider the available clinical contexts when formulating your findings.
|
| 132 |
|
| 133 |
+
=== CLINICAL HISTORY/INDICATION ===
|
| 134 |
+
Male patient status post acetabular surgery with concern for pleural effusion.
|
| 135 |
|
| 136 |
+
=== TECHNIQUE ===
|
| 137 |
+
Portable semi-erect single frontal chest radiograph.
|
| 138 |
|
| 139 |
+
=== CURRENT IMAGES ==="""
|
|
|
|
|
|
|
|
|
|
| 140 |
},
|
| 141 |
{"type": "image"}, # Current image
|
| 142 |
+
{"type": "image"} # Prior image (supports multiple images for temporal comparison)
|
| 143 |
]
|
| 144 |
}
|
| 145 |
]
|