VPShuntDetector is a Python project designed to detect various VPShunt valves from X-ray images. The tool supports several valve types including:
- Codman Certas
- Codman Hakim
- Codman Uni-Shunt
- paediGAV
- proGAV Gravitationseinheit
- proGAV
- proSA
- Valve Detection: Identify multiple VPShunt valve types from X-ray images.
- Detailed Results: For each input image, the tool
outputs:
- A
results.csvfile containing the confidence and predicted label for each of the 5 folds, along with the aggregated final confidence and prediction. - An output image with a bounding box overlay showing the predicted valve model.
- A
- Instruction Display: Optionally, if an instruction directory is provided, corresponding instruction images for each valve model will be displayed alongside the output image.
Clone the repository and install the package in editable mode:
git clone git@github.com:JannisStraus/VPShuntDetector.git
cd VPShuntDetector
pip install -e .After installation, you can run the tool directly from the command line:
vpshuntdetector -i <input> -o <output>If you have a directory with instruction images, include it using the
--instructions flag (see Instruction Images for more
details):
vpshuntdetector -i <input> -o <output> --instructions <instructions_directory>-i,--input: (Required) Path to the input image or directory.-o,--output: (Required) Path where the output results will be saved.--instructions: (Optional) Directory with instruction images for valve models.-d,--device: (Optional) Device to perform inference on (e.g.cudaorcpu).
When using the --instructions option, the provided folder should contain one
PNG image for each supported valve type. The image files must be named exactly
as the valve type with a .png or .jpg extension. For example, the folder
should include the following files:
example_instructions/
├── Codman Certas.png
├── Codman Hakim.png
├── Codman Uni-Shunt.png
├── paediGAV.png
├── proGAV Gravitationseinheit.png
├── proGAV.png
└── proSA.pngIn the output directory specified by the -o or --output option,
VPShuntDetector generates:
- results.csv: A CSV file containing, for every input image, the predicted label and its confidence score for each of the 5 folds. This file also includes the final aggregated confidence and prediction.
- Output Images: For every input image, an output image is saved with a bounding box overlay that highlights the predicted valve model.
- Instruction Display: If an instruction directory is provided via
--instructions, the corresponding instruction image for the predicted valve model will be displayed alongside the output image.