Spaces:
Running on Zero
Running on Zero
| """Shared constants for SynthCXR: disease labels, condition maps, severity modifiers.""" | |
| from __future__ import annotations | |
| # CheXpert label column names -> natural-language descriptions used in prompts. | |
| # Used by both dataset preparation and inference scripts. | |
| LABEL_TEXT: dict[str, str] = { | |
| "Enlarged Cardiomediastinum": "enlarged cardiomediastinum", | |
| "Cardiomegaly": "cardiomegaly", | |
| "Lung Opacity": "diffuse lung opacity", | |
| "Lung Lesion": "discrete lung lesion", | |
| "Edema": "pulmonary edema", | |
| "Consolidation": "parenchymal consolidation", | |
| "Pneumonia": "findings compatible with pneumonia", | |
| "Atelectasis": "atelectasis", | |
| "Pneumothorax": "pneumothorax", | |
| "Pleural Effusion": "pleural effusion", | |
| "Pleural Other": "other pleural abnormality", | |
| "Fracture": "possible fracture", | |
| "Support Devices": "support devices in place", | |
| } | |
| # Snake_case keys for config files -> natural-language descriptions. | |
| KNOWN_CONDITIONS: dict[str, str] = { | |
| "enlarged_cardiomediastinum": "enlarged cardiomediastinum", | |
| "cardiomegaly": "cardiomegaly", | |
| "lung_opacity": "diffuse lung opacity", | |
| "lung_lesion": "discrete lung lesion", | |
| "edema": "pulmonary edema", | |
| "consolidation": "parenchymal consolidation", | |
| "pneumonia": "findings compatible with pneumonia", | |
| "atelectasis": "atelectasis", | |
| "pneumothorax": "pneumothorax", | |
| "pleural_effusion": "pleural effusion", | |
| "pleural_other": "other pleural abnormality", | |
| "fracture": "possible fracture", | |
| "support_devices": "support devices in place", | |
| } | |
| SEVERITY_MODIFIERS: dict[str, str] = { | |
| "mild": "mild", | |
| "moderate": "moderate", | |
| "severe": "severe", | |
| "small": "small", | |
| "large": "large", | |
| "very_small": "very small", | |
| "very_large": "very large", | |
| "minimal": "minimal", | |
| "significant": "significant", | |
| } | |
| DEFAULT_MODEL_ID = "gradientguild/SynthCXR-Qwen-Weights" | |
| TEXT_ENCODER_MODEL_ID = "gradientguild/SynthCXR-Qwen-Weights" | |
| PROCESSOR_MODEL_ID = "gradientguild/SynthCXR-Qwen-Weights" | |