Skip to main content

๐ŸŽž๏ธ MedSAM2

A promptable foundation model adapted from SAM 2 for 3D medical images and medical videos, using memory-based propagation across slices/frames.

Official codePaperWeights

โ† Model atlas

At a glanceโ€‹

FieldDetails
Model type3D and video promptable segmentation
Research team / organizationUniversity Health Network, University of Toronto and collaborating institutions
Input / modality3D CT/MRI/PET volumes and medical videos such as ultrasound or endoscopy.
Prompt / interactionSpatial prompts such as boxes/masks on a slice or frame, followed by propagation and interactive correction.
Code licenseCode repository: Apache-2.0. Check each Hugging Face checkpoint page and the original SAM 2 terms before redistribution or deployment.

๐Ÿ“š Paper and publicationโ€‹

MedSAM2: Segment Anything in 3D Medical Images and Videos โ€” arXiv:2504.03600 (2025 preprint).

๐Ÿ“ฆ Checkpoints and accessโ€‹

The official Hugging Face collection includes MedSAM2_latest.pt, MedSAM2_2411.pt and task-specific CT lesion, MRI liver lesion and ultrasound heart checkpoints. bash download.sh downloads all listed weights.

The code, model checkpoint and any required foundation-model checkpoint can have different terms. Review each linked source before use or redistribution.

โš™๏ธ Official setup and inferenceโ€‹

conda create -n medsam2 python=3.12 -y
conda activate medsam2
# Install a compatible PyTorch/CUDA build and the official package
pip install -e ".[dev]"
bash download.sh
python medsam2_infer_3D_CT.py -i CT_DeepLesion/images -o CT_DeepLesion/segmentation

That CLI example is CT-specific; follow the official MRI/video notebooks or scripts for those modalities.

โš ๏ธ Version and practical notesโ€‹

The upstream repository provides general and task-specific checkpoints. Record the exact checkpoint, training data, modality and prompt configuration; the latest release is not automatically identical to earlier published weights.

๐Ÿ“œ Licenseโ€‹

Code repository: Apache-2.0. Check each Hugging Face checkpoint page and the original SAM 2 terms before redistribution or deployment.

Citation: Cite the paper above and the upstream project as directed by its authors. This repository links to the original paper; it does not redistribute the code or weights.

Source pages checked: 27 October 2026. Upstream environments, weights and access policies may change; use the linked project as the source of truth.