SAM2T——A Lightweight yet Effective Scale-Aware Micro to Macro Transition Network for Retinal Vessel Segmentation
The official implementation of SAM2T
SAM2T is a project for vessel segmentation using deep learning techniques. This repository contains scripts for training, testing, and evaluating models on the retinal datasets.
This script is used for training the model on the DRIVE dataset.
Usage:
- Prepare your dataset in the appropriate format.
- Configure the training parameters in the script or via command-line arguments.
- Run the script using the following command:
python /home/s1/ZX/job/Vessel/train.py -dp "/home/s1/ZX/job/Vessel/datasets/DRIVE" --val
This script is used for evaluating the trained model on test images.
Usage:
- Ensure that you have a trained model available.
- Configure the testing parameters in the script or via command-line arguments.
- Run the script using the following command:
python /home/s1/ZX/job/Vessel/test.py -dp "/home/s1/ZX/job/Vessel/datasets/DRIVE" -wp "/home/s1/ZX/job/Vessel/pretrained_weights/DRIVE/SAM2T/checkpoint-epoch20.pth" --show
This script calculates various evaluation metrics for the segmentation results.
Usage:
- Ensure that the segmentation results and ground truth maps are available.
- Run the script to calculate metrics using the following command:
python /home/s1/ZX/job/Vessel/c_metrics.py -dp "/home/s1/ZX/job/Vessel/datasets/DRIVE"
- Training: Prepare your dataset, then run training:
python /home/s1/ZX/job/Vessel/train.py -dp "/home/s1/ZX/job/Vessel/datasets/DRIVE" --val
- Testing: Evaluate your trained model:
python /home/s1/ZX/job/Vessel/test.py -dp "/home/s1/ZX/job/Vessel/datasets/DRIVE" -wp "/home/s1/ZX/job/Vessel/pretrained_weights/DRIVE/SAM2T/checkpoint-epoch20.pth" --show
- Metrics: Calculate performance metrics:
python /home/s1/ZX/job/Vessel/c_metrics.py -dp "/home/s1/ZX/job/Vessel/datasets/DRIVE"
- Python 3.7.4
- PyTorch 1.8.0
- torchvision 0.9.0
This project is licensed under the MIT License. See the LICENSE file for details.