46
stars
23
commits
5
repos using this model
2
linked in READMEs
Jul 10, 2025
updated
Segment Anything in 3D Medical Images and Videos
Jun Ma* 1,2,
Zongxin Yang* 3,
Sumin Kim2,4,5,
Bihui Chen2,4,5,
Mohammed Baharoon2,3,5,
Adibvafa Fallahpour2,4,5,
Reza Asakereh4,7,
Hongwei Lyu4,
Bo Wang† 1,2,4,5,6
* Equal contribution † Corresponding author
1AI Collaborative Centre, University Health Network, Toronto, Canada
2Vector Institute for Artificial Intelligence, Toronto, Canada
3Department of Biomedical Informatics, Harvard Medical School, Harvard University, Boston, USA
4Peter Munk Cardiac Centre, University Health Network, Toronto, Canada
5Department of Computer Science, University of Toronto, Toronto, Canada
6Department of Laboratory Medicine and Pathobiology, University of Toronto, Toronto, Canada
7Roche Canada and Genentech
MedSAM2 is a promptable segmentation segmentation model tailored for medical imaging applications. Built upon the foundation of the Segment Anything Model (SAM) 2.1, MedSAM2 has been specifically adapted and fine-tuned for various 3D medical images and videos.
You can download the models directly from the Hugging Face repository:
# Using huggingface_hub
from huggingface_hub import hf_hub_download
# Download the recommended latest model
model_path = hf_hub_download(repo_id="wanglab/MedSAM2", filename="MedSAM2_latest.pt")
# Or download a specific fine-tuned model
heart_us_model_path = hf_hub_download(repo_id="wanglab/MedSAM2", filename="MedSAM2_US_Heart.pt")
liver_model_path = hf_hub_download(repo_id="wanglab/MedSAM2", filename="MedSAM2_MRI_LiverLesion.pt")
from huggingface_hub import hf_hub_download
import os
# Create checkpoints directory if it doesn't exist
os.makedirs("checkpoints", exist_ok=True)
# List of model filenames
model_files = [
"MedSAM2_2411.pt",
"MedSAM2_US_Heart.pt",
"MedSAM2_MRI_LiverLesion.pt",
"MedSAM2_CTLesion.pt",
"MedSAM2_latest.pt"
]
# Download all models
for model_file in model_files:
local_path = os.path.join("checkpoints", model_file)
hf_hub_download(
repo_id="wanglab/MedSAM2",
filename=model_file,
local_dir="checkpoints",
local_dir_use_symlinks=False
)
print(f"Downloaded {model_file} to {local_path}")
Alternatively, you can manually download the models from the Hugging Face repository page.
@article{MedSAM2,
title={MedSAM2: Segment Anything in 3D Medical Images and Videos},
author={Ma, Jun and Yang, Zongxin and Kim, Sumin and Chen, Bihui and Baharoon, Mohammed and Fallahpour, Adibvafa and Asakereh, Reza and Lyu, Hongwei and Wang, Bo},
journal={arXiv preprint arXiv:2504.03600},
year={2025}
}
The model weights can only be used for research and education purposes.
46
stars
23
commits
5
repos using this model
2
linked in READMEs
Jul 10, 2025
updated
Segment Anything in 3D Medical Images and Videos
Jun Ma* 1,2,
Zongxin Yang* 3,
Sumin Kim2,4,5,
Bihui Chen2,4,5,
Mohammed Baharoon2,3,5,
Adibvafa Fallahpour2,4,5,
Reza Asakereh4,7,
Hongwei Lyu4,
Bo Wang† 1,2,4,5,6
* Equal contribution † Corresponding author
1AI Collaborative Centre, University Health Network, Toronto, Canada
2Vector Institute for Artificial Intelligence, Toronto, Canada
3Department of Biomedical Informatics, Harvard Medical School, Harvard University, Boston, USA
4Peter Munk Cardiac Centre, University Health Network, Toronto, Canada
5Department of Computer Science, University of Toronto, Toronto, Canada
6Department of Laboratory Medicine and Pathobiology, University of Toronto, Toronto, Canada
7Roche Canada and Genentech
MedSAM2 is a promptable segmentation segmentation model tailored for medical imaging applications. Built upon the foundation of the Segment Anything Model (SAM) 2.1, MedSAM2 has been specifically adapted and fine-tuned for various 3D medical images and videos.
You can download the models directly from the Hugging Face repository:
# Using huggingface_hub
from huggingface_hub import hf_hub_download
# Download the recommended latest model
model_path = hf_hub_download(repo_id="wanglab/MedSAM2", filename="MedSAM2_latest.pt")
# Or download a specific fine-tuned model
heart_us_model_path = hf_hub_download(repo_id="wanglab/MedSAM2", filename="MedSAM2_US_Heart.pt")
liver_model_path = hf_hub_download(repo_id="wanglab/MedSAM2", filename="MedSAM2_MRI_LiverLesion.pt")
from huggingface_hub import hf_hub_download
import os
# Create checkpoints directory if it doesn't exist
os.makedirs("checkpoints", exist_ok=True)
# List of model filenames
model_files = [
"MedSAM2_2411.pt",
"MedSAM2_US_Heart.pt",
"MedSAM2_MRI_LiverLesion.pt",
"MedSAM2_CTLesion.pt",
"MedSAM2_latest.pt"
]
# Download all models
for model_file in model_files:
local_path = os.path.join("checkpoints", model_file)
hf_hub_download(
repo_id="wanglab/MedSAM2",
filename=model_file,
local_dir="checkpoints",
local_dir_use_symlinks=False
)
print(f"Downloaded {model_file} to {local_path}")
Alternatively, you can manually download the models from the Hugging Face repository page.
@article{MedSAM2,
title={MedSAM2: Segment Anything in 3D Medical Images and Videos},
author={Ma, Jun and Yang, Zongxin and Kim, Sumin and Chen, Bihui and Baharoon, Mohammed and Fallahpour, Adibvafa and Asakereh, Reza and Lyu, Hongwei and Wang, Bo},
journal={arXiv preprint arXiv:2504.03600},
year={2025}
}
The model weights can only be used for research and education purposes.