update readme.md
Browse filesupdated readme.md
README.md
CHANGED
|
@@ -1,13 +1,63 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Medical VLM with SAM-2 and CheXagent
|
| 2 |
+
|
| 3 |
+
A comprehensive medical imaging analysis tool that combines:
|
| 4 |
+
- Qwen-VLM for medical visual question answering
|
| 5 |
+
- SAM-2 (Segment Anything Model 2) for automatic medical image segmentation
|
| 6 |
+
- CheXagent for structured chest X-ray report generation
|
| 7 |
+
|
| 8 |
+
## Features
|
| 9 |
+
|
| 10 |
+
1. **Medical Q&A**: Ask questions about medical images using the Qwen-VLM model
|
| 11 |
+
2. **Automatic Masking**: Segment medical images automatically using SAM-2
|
| 12 |
+
3. **Structured Report Generation**: Generate detailed chest X-ray reports using CheXagent
|
| 13 |
+
4. **Visual Grounding**: Locate specific findings in medical images
|
| 14 |
+
|
| 15 |
+
## Setup
|
| 16 |
+
|
| 17 |
+
1. Clone the repository:
|
| 18 |
+
```bash
|
| 19 |
+
git clone https://github.com/pascal-maker/medicalvlm.git
|
| 20 |
+
cd medicalvlm
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
2. Create and activate a virtual environment:
|
| 24 |
+
```bash
|
| 25 |
+
python -m venv chexagent_env
|
| 26 |
+
source chexagent_env/bin/activate # On Windows: chexagent_env\Scripts\activate
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
3. Install dependencies:
|
| 30 |
+
```bash
|
| 31 |
+
pip install -r requirements.txt
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
4. Download required model checkpoints:
|
| 35 |
+
- SAM-2 checkpoint: Place in `checkpoints/sam2.1_hiera_large.pt`
|
| 36 |
+
- Other model weights will be downloaded automatically on first run
|
| 37 |
+
|
| 38 |
+
## Usage
|
| 39 |
+
|
| 40 |
+
Run the Gradio interface:
|
| 41 |
+
```bash
|
| 42 |
+
python app.py
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
The web interface will be available at `http://localhost:7860`
|
| 46 |
+
|
| 47 |
+
## Requirements
|
| 48 |
+
|
| 49 |
+
- Python 3.8+
|
| 50 |
+
- PyTorch
|
| 51 |
+
- CUDA-compatible GPU (recommended)
|
| 52 |
+
- See `requirements.txt` for full list of dependencies
|
| 53 |
+
|
| 54 |
+
## License
|
| 55 |
+
|
| 56 |
+
[Your chosen license]
|
| 57 |
+
|
| 58 |
+
## Acknowledgments
|
| 59 |
+
|
| 60 |
+
- [Qwen-VLM](https://github.com/QwenLM/Qwen-VL)
|
| 61 |
+
- [SAM-2](https://github.com/facebookresearch/segment-anything)
|
| 62 |
+
- [CheXagent](https://github.com/stanfordmlgroup/CheXagent)
|
| 63 |
+
|