This is a fine-tuned version of Meta's Segment Anything Model 2 (SAM2) optimized for medical image segmentation tasks.
This model is designed for medical image segmentation, particularly for segmenting lesions and anatomical structures in endoscopic images.
1import torch
2from sam2.build_sam import build_sam2
3
4# Load the fine-tuned model
5device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
6model = build_sam2(checkpoint="sam2_medical_finetuned.pth")
7model = model.to(device)
8
9# Use for inference
10with torch.no_grad():
11 # Your inference code here
12 pass
If you use this model, please cite the original SAM2 paper and acknowledge the medical imaging dataset used for fine-tuning.
This model is licensed under the Apache 2.0 License - same as the original SAM2 model.