Downloads · 30 days
0
Yinghoo/spleete
spleete is a machine learning model from Yinghoo. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for adapter-transformers. The card lists the license as apache-2.0.
Downloads · 30 days
0
Access
Public
Updated Jun 25, 2024
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 62%
From the Hugging Face model README
pip install spleeter
import os from spleeter.separator import Separator from spleeter.audio.adapter import AudioAdapter
def separate_vocals(input_file, output_dir): # 创建一个Separator对象,使用2stems预训练模型(vocals 和 accompaniment) separator = Separator('spleeter:2stems')
# 创建输出目录(如果不存在)
os.makedirs(output_dir, exist_ok=True)
# 执行分离
separator.separate_to_file(input_file, output_dir)
print(f"分离完成。结果保存在 {output_dir}")
if name == "main": input_mp3 = "path/to/your/input.mp3" # 替换为你的MP3文件路径 output_directory = "path/to/output/directory" # 替换为你想要保存输出的目录
separate_vocals(input_mp3, output_directory)