Model card for samvit_base_patch16_1024.ultrasam

A SAM ViT-B/16 image encoder at 1024x1024 from UltraSam, a foundation model for ultrasound.
Ported from the official CAMMA checkpoint (mmdet format) to timm (samvit_base_patch16).

Model Details

Model Usage

Image Embeddings

from urllib.request import urlopen
from PIL import Image
import timm

# get example image
img = Image.open(
  urlopen(
    "https://github.com/CAMMA-public/UltraSam/raw/main/assets/UltraSam_main.png"
  )
)

# load model from the hub
model = timm.create_model(
  model_name="hf-hub:1aurent/samvit_base_patch16_1024.ultrasam",
  pretrained=True,
).eval()

# get model specific transforms (normalization, resize)
data_config = timm.data.resolve_model_data_config(model)
transforms = timm.data.create_transform(**data_config, is_training=False)

data = transforms(img.convert("RGB")).unsqueeze(0) # input is a (batch_size, num_channels, img_size, img_size) shaped tensor
output = model(data)  # output is a (batch_size, num_features) shaped tensor

Citation

@article{meyer2025ultrasam,
  title={Ultrasam: a foundation model for ultrasound using large open-access segmentation datasets},
  author={Meyer, Adrien and Murali, Aditya and Zarin, Farahdiba and Mutter, Didier and Padoy, Nicolas},
  journal={International Journal of Computer Assisted Radiology and Surgery},
  pages={1--10},
  year={2025},
  publisher={Springer}
}
Downloads last month
35
Safetensors
Model size
89.7M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Paper for 1aurent/samvit_base_patch16_1024.ultrasam