This project uses a pre-trained DenseNet-121 model to detect common thoracic pathologies in chest X-ray images and visualizes the results using Grad-CAM heatmaps.
-
Clone the repository or download the files.
-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required libraries:
pip install -r requirements.txt
-
Edit
main.py: Open themain.pyfile and change theIMAGE_PATHvariable on line 13 to the path of your X-ray image.# line 13 IMAGE_PATH = "C:/Users/YourUser/Desktop/chest_xray.png"
-
Run the script from your terminal:
python main.py
The script will then print the analysis results to the console and display plots for the probabilities and Grad-CAM heatmaps.