Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ torchaudio.save("residual.wav", result.residual.cpu(), sample_rate) # Everythin

SAM-Audio supports three types of prompts:

1. **Text Prompting**: Describe the sound you want to isolate using natural language
1. **Text Prompting**: Describe the sound you want to isolate using natural language. To match training, please use lowercase noun-phrase/verb-phrase (NP/VP) format for text (for example instead of "Thunder can be heard in the background" use "thunder").
```python
processor(audios=[audio], descriptions=["A man speaking"])
processor(audios=[audio], descriptions=["man speaking"])
```

2. **Visual Prompting**: Use video frames and masks to isolate sounds associated with visual objects
Expand All @@ -83,7 +83,7 @@ SAM-Audio supports three types of prompts:

3. **Span Prompting**: Specify time ranges where the target sound occurs
```python
processor(audios=[audio], descriptions=["A horn honking"], anchors=[[["+", 6.3, 7.0]]])
processor(audios=[audio], descriptions=["car honking"], anchors=[[["+", 6.3, 7.0]]])
```

See the [examples](examples) directory for more detailed examples
Expand Down
2 changes: 1 addition & 1 deletion examples/span_prompting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
")\n",
"wav = wav.mean(0, keepdim=True)\n",
"inputs = processor(\n",
" audios=[wav], descriptions=[\"A horn honking\"], anchors=[[[\"+\", 6.3, 7.0]]]\n",
" audios=[wav], descriptions=[\"horn honking\"], anchors=[[[\"+\", 6.3, 7.0]]]\n",
").to(device)\n",
"with torch.inference_mode():\n",
" result = model.separate(inputs)"
Expand Down
2 changes: 1 addition & 1 deletion examples/text_prompting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"metadata": {},
"outputs": [],
"source": [
"inputs = processor(audios=[video_file], descriptions=[\"A man speaking\"]).to(device)\n",
"inputs = processor(audios=[video_file], descriptions=[\"man speaking\"]).to(device)\n",
"with torch.inference_mode():\n",
" result = model.separate(inputs)"
]
Expand Down