facebook / sam-audio-large

huggingface.co
Total runs: 13.6K
24-hour runs: -71
7-day runs: -262
30-day runs: -2.8K
Model's Last Updated: December 31 2025

Introduction of sam-audio-large

Model Details of sam-audio-large

SAM-Audio: Segment Anything Model for Audio

SAM-Audio is a model for isolating any sound in audio using text, visual, or temporal prompts. It can separate specific sounds from complex audio mixtures based on natural language descriptions, visual cues from video, or time spans.

Authentication

Before using SAM-Audio, you need to:

  1. Request access to the checkpoints on the SAM-Audio Hugging Face repo
  2. Authenticate with Hugging Face: huggingface-cli login
Usage

SAM-Audio supports three types of prompting: text, visual, and span. Each method allows you to specify which sounds to isolate in different ways.

1. Text Prompting

Use natural language descriptions to isolate sounds.

import torch
import torchaudio
from sam_audio import SAMAudio, SAMAudioProcessor

# Load model and processor
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = SAMAudio.from_pretrained("facebook/sam-audio-large").to(device).eval()
processor = SAMAudioProcessor.from_pretrained("facebook/sam-audio-large")

# Load audio file
audio_file = "path/to/audio.wav"

# Describe the sound you want to isolate
description = "A man speaking"

# Process and separate
inputs = processor(audios=[audio_file], descriptions=[description]).to(device)
with torch.inference_mode():
    result = model.separate(inputs)

# Save results
torchaudio.save("target.wav", result.target[0].unsqueeze(0).cpu(), processor.audio_sampling_rate)
torchaudio.save("residual.wav", result.residual[0].unsqueeze(0).cpu(), processor.audio_sampling_rate)

Examples of text descriptions:

  • "A person coughing"
  • "Raindrops are falling heavily, splashing on the ground"
  • "A dog barking"
  • "Piano playing a melody"
  • "Car engine revving"
2. Visual Prompting

Isolate sounds associated with specific visual objects in a video using masked video frames.

import torch
import numpy as np
from sam_audio import SAMAudio, SAMAudioProcessor
from torchcodec.decoders import VideoDecoder

# NOTE: Requires SAM3 for creating masks
# pip install git+https://github.com/facebookresearch/sam3.git
from sam3.model_builder import build_sam3_video_predictor

# Load SAM-Audio model
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = SAMAudio.from_pretrained("facebook/sam-audio-large").to(device).eval()
processor = SAMAudioProcessor.from_pretrained("facebook/sam-audio-large")

# Load video
video_file = "path/to/video.mp4"
decoder = VideoDecoder(video_file)
frames = decoder[:]

# Create mask using SAM3 (example with text prompt)
video_predictor = build_sam3_video_predictor()
response = video_predictor.handle_request({
    "type": "start_session",
    "resource_path": video_file,
})
session_id = response["session_id"]

masks = []
for frame_index in range(len(decoder)):
    response = video_predictor.handle_request({
        "type": "add_prompt",
        "session_id": session_id,
        "frame_index": frame_index,
        "text": "The person on the left",  # Visual object to isolate
    })
    mask = response["outputs"]["out_binary_masks"]
    if mask.shape[0] == 0:
        mask = np.zeros_like(frames[0, [0]], dtype=bool)
    masks.append(mask[:1])

mask = torch.from_numpy(np.concatenate(masks)).unsqueeze(1)

# Process with visual prompting
inputs = processor(
    audios=[video_file],
    descriptions=[""],
    masked_videos=processor.mask_videos([frames], [mask]),
).to(device)

with torch.inference_mode():
    result = model.separate(inputs)
3. Span Prompting (Temporal Anchors)

Specify time ranges where the target sound occurs or doesn't occur. This provides a specific example to the model of what to isolate

import torch
import torchaudio
from sam_audio import SAMAudio, SAMAudioProcessor

# Load model and processor
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = SAMAudio.from_pretrained("facebook/sam-audio-large").to(device).eval()
processor = SAMAudioProcessor.from_pretrained("facebook/sam-audio-large")

# Define anchors: [type, start_time, end_time]
# "+" means the sound IS present in this time range
# "-" means the sound is NOT present in this time range
anchors = [
    ["+", 6.3, 7.0],  # Sound occurs between 6.3 and 7.0 seconds
]

# Process with span prompting
inputs = processor(
    audios=[audio_file],
    descriptions=["A horn honking"],
    anchors=[anchors],
).to(device)

with torch.inference_mode():
    result = model.separate(inputs)

Example with multiple anchors:

anchors = [
    ["+", 2.0, 3.5],   # Sound present from 2.0 to 3.5 seconds
    ["+", 8.0, 9.0],   # Sound present from 8.0 to 9.0 seconds
    ["-", 0.0, 1.0],   # Sound NOT present from 0.0 to 1.0 seconds
]
Output Format

The model.separate() method returns a result object with:

  • result.target : The isolated sound (what you asked for)
  • result.residual : Everything else (the remainder)

Both are list[torch.Tensor] where each tensor is a 1D waveform

Citation

If you use SAM-Audio in your research, please cite:

@article{sam-audio,
  title={SAM-Audio: Segment Anything in Audio},
  author={Bowen Shi, Andros Tjandra, John Hoffman, Helin Wang, Yi-Chiao Wu, Luya Gao, Julius Richter, Matt Le, Apoorv Vyas, Sanyuan Chen, Christoph Feichtenhofer, Piotr Dollár, Wei-Ning Hsu, Ann Lee},
  year={2025}
  url={arxiv link coming soon}
}
License

This project is licensed under the SAM License. See the LICENSE file for details.

Runs of facebook sam-audio-large on huggingface.co

13.6K
Total runs
-71
24-hour runs
132
3-day runs
-262
7-day runs
-2.8K
30-day runs

More Information About sam-audio-large huggingface.co Model

More sam-audio-large license Visit here:

https://choosealicense.com/licenses/sam-license

sam-audio-large huggingface.co

sam-audio-large huggingface.co is an AI model on huggingface.co that provides sam-audio-large's model effect (), which can be used instantly with this facebook sam-audio-large model. huggingface.co supports a free trial of the sam-audio-large model, and also provides paid use of the sam-audio-large. Support call sam-audio-large model through api, including Node.js, Python, http.

sam-audio-large huggingface.co Url

https://huggingface.co/facebook/sam-audio-large

facebook sam-audio-large online free

sam-audio-large huggingface.co is an online trial and call api platform, which integrates sam-audio-large's modeling effects, including api services, and provides a free online trial of sam-audio-large, you can try sam-audio-large online for free by clicking the link below.

facebook sam-audio-large online free url in huggingface.co:

https://huggingface.co/facebook/sam-audio-large

sam-audio-large install

sam-audio-large is an open source model from GitHub that offers a free installation service, and any user can find sam-audio-large on GitHub to install. At the same time, huggingface.co provides the effect of sam-audio-large install, users can directly use sam-audio-large installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

sam-audio-large install url in huggingface.co:

https://huggingface.co/facebook/sam-audio-large

Url of sam-audio-large

sam-audio-large huggingface.co Url

Provider of sam-audio-large huggingface.co

facebook
ORGANIZATIONS

Other API from facebook

huggingface.co

Total runs: 8.1M
Run Growth: 34.4K
Growth Rate: 0.43%
Updated:January 20 2022
huggingface.co

Total runs: 7.4M
Run Growth: -8.8M
Growth Rate: -118.06%
Updated:September 15 2023
huggingface.co

Total runs: 3.3M
Run Growth: 1.0M
Growth Rate: 30.05%
Updated:January 17 2024
huggingface.co

Total runs: 3.1M
Run Growth: -1.6M
Growth Rate: -49.80%
Updated:September 06 2023
huggingface.co

Total runs: 2.7M
Run Growth: -380.9K
Growth Rate: -13.72%
Updated:December 28 2021
huggingface.co

Total runs: 2.2M
Run Growth: 187.2K
Growth Rate: 8.31%
Updated:March 23 2023
huggingface.co

Total runs: 2.2M
Run Growth: -156.2K
Growth Rate: -7.10%
Updated:January 25 2024
huggingface.co

Total runs: 2.0M
Run Growth: -240.9K
Growth Rate: -11.84%
Updated:November 21 2025
huggingface.co

Total runs: 846.2K
Run Growth: -27.8K
Growth Rate: -3.33%
Updated:September 06 2023
huggingface.co

Total runs: 474.2K
Run Growth: 91.2K
Growth Rate: 19.30%
Updated:February 29 2024
huggingface.co

Total runs: 462.9K
Run Growth: -156.6K
Growth Rate: -33.56%
Updated:May 22 2023
huggingface.co

Total runs: 433.8K
Run Growth: -3.5K
Growth Rate: -0.82%
Updated:March 17 2025
huggingface.co

Total runs: 357.3K
Run Growth: -35.0K
Growth Rate: -9.86%
Updated:January 12 2024
huggingface.co

Total runs: 320.3K
Run Growth: -53.2K
Growth Rate: -16.54%
Updated:September 06 2023
huggingface.co

Total runs: 309.3K
Run Growth: 43.9K
Growth Rate: 14.08%
Updated:September 15 2023
huggingface.co

Total runs: 294.1K
Run Growth: -32.7K
Growth Rate: -11.29%
Updated:November 17 2022
huggingface.co

Total runs: 284.9K
Run Growth: -333.4K
Growth Rate: -107.70%
Updated:January 12 2024
huggingface.co

Total runs: 284.2K
Run Growth: 49.3K
Growth Rate: 17.17%
Updated:June 15 2023
huggingface.co

Total runs: 236.9K
Run Growth: 14.3K
Growth Rate: 6.02%
Updated:July 23 2024
huggingface.co

Total runs: 205.5K
Run Growth: -120.4K
Growth Rate: -57.41%
Updated:July 25 2023
huggingface.co

Total runs: 190.1K
Run Growth: 107.3K
Growth Rate: 46.34%
Updated:May 22 2023
huggingface.co

Total runs: 185.9K
Run Growth: 74.1K
Growth Rate: 40.18%
Updated:September 06 2023
huggingface.co

Total runs: 182.2K
Run Growth: 55.3K
Growth Rate: 29.97%
Updated:February 12 2023
huggingface.co

Total runs: 163.6K
Run Growth: 405
Growth Rate: 0.25%
Updated:September 01 2023
huggingface.co

Total runs: 151.9K
Run Growth: -176.2K
Growth Rate: -114.85%
Updated:November 17 2023
huggingface.co

Total runs: 140.7K
Run Growth: 80.6K
Growth Rate: 56.90%
Updated:November 16 2023
huggingface.co

Total runs: 119.1K
Run Growth: -10.2K
Growth Rate: -8.47%
Updated:June 03 2022
huggingface.co

Total runs: 118.0K
Run Growth: 27.8K
Growth Rate: 23.58%
Updated:November 20 2023
huggingface.co

Total runs: 117.2K
Run Growth: 25.5K
Growth Rate: 21.96%
Updated:January 25 2023
huggingface.co

Total runs: 116.2K
Run Growth: -25.4K
Growth Rate: -23.42%
Updated:June 13 2023
huggingface.co

Total runs: 100.0K
Run Growth: -16.7K
Growth Rate: -16.19%
Updated:September 15 2023
huggingface.co

Total runs: 92.5K
Run Growth: 64.9K
Growth Rate: 70.79%
Updated:February 12 2023
huggingface.co

Total runs: 78.0K
Run Growth: -171.6K
Growth Rate: -209.82%
Updated:June 13 2023
huggingface.co

Total runs: 58.9K
Run Growth: 17.7K
Growth Rate: 29.98%
Updated:January 25 2023
huggingface.co

Total runs: 51.4K
Run Growth: -25.8K
Growth Rate: -50.12%
Updated:March 28 2026
huggingface.co

Total runs: 48.0K
Run Growth: -22.0K
Growth Rate: -45.79%
Updated:January 29 2026
huggingface.co

Total runs: 47.0K
Run Growth: -2.3K
Growth Rate: -4.78%
Updated:March 13 2024