Skip to content

Commit 556ef21

Browse files
committed
Initial commit from private spleeter
1 parent dc39414 commit 556ef21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+3924
-3
lines changed

.gitignore

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
db.sqlite3
58+
59+
# Flask stuff:
60+
instance/
61+
.webassets-cache
62+
63+
# Scrapy stuff:
64+
.scrapy
65+
66+
# Sphinx documentation
67+
docs/_build/
68+
69+
# PyBuilder
70+
target/
71+
72+
# Jupyter Notebook
73+
.ipynb_checkpoints
74+
75+
# pyenv
76+
.python-version
77+
78+
# celery beat schedule file
79+
celerybeat-schedule
80+
81+
# SageMath parsed files
82+
*.sage.py
83+
84+
# Environments
85+
.env
86+
.venv
87+
env/
88+
venv/
89+
ENV/
90+
env.bak/
91+
venv.bak/
92+
93+
# Spyder project settings
94+
.spyderproject
95+
.spyproject
96+
97+
# Rope project settings
98+
.ropeproject
99+
100+
# mkdocs documentation
101+
/site
102+
103+
# mypy
104+
.mypy_cache/
105+
.vscode
106+
.DS_Store
107+
__pycache__
108+
**/reporting
109+
110+
pretrained_models
111+
docs/build
112+
.vscode

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019-present, Deezer SA.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
include src/resources/*.json
2+
include README.md
3+
include LICENSE

Makefile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# =======================================================
2+
# Build script for distribution packaging.
3+
#
4+
# @author Deezer Research <[email protected]>
5+
# @licence MIT Licence
6+
# =======================================================
7+
8+
clean:
9+
rm -Rf *.egg-info
10+
rm -Rf dist
11+
12+
build:
13+
@echo "=== Build CPU bdist package"
14+
@python3 setup.py sdist
15+
@echo "=== CPU version checksum"
16+
@openssl sha256 dist/*.tar.gz
17+
18+
build-gpu:
19+
@echo "=== Build GPU bdist package"
20+
@python3 setup.py sdist --target gpu
21+
@echo "=== GPU version checksum"
22+
@openssl sha256 dist/*.tar.gz
23+
24+
upload:
25+
twine upload dist/*
26+
27+
test-upload:
28+
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
29+
30+
all: clean build build-gpu upload

README.md

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,64 @@
1-
# spleeter
1+
<img src="https://github.com/deezer/spleeter/raw/master/images/spleeter_logo.png" height="80" />
22

3-
<img src=images/spleeter_logo.png height=100>
3+
[![PyPI version](https://badge.fury.io/py/spleeter.svg)](https://badge.fury.io/py/spleeter) ![Conda](https://img.shields.io/conda/dn/conda-forge/spleeter)
44

5+
## About
56

6-
spleeter will be made available soon!
7+
**Spleeter** is the [Deezer](https://www.deezer.com/) source separation library with pretrained models
8+
written in [Python](https://www.python.org/) and uses [Tensorflow](tensorflow.org/). It makes it easy
9+
to train source separation model (assuming you have a dataset of isolated sources), and provides
10+
already trained state of the art model for performing various flavour of separation :
11+
12+
* Vocals (singing voice) / accompaniment separation ([2 stems](https://github.com/deezer/spleeter/wiki/2.-Getting-started#using-2stems-model))
13+
* Vocals / drums / bass / other separation ([4 stems](https://github.com/deezer/spleeter/wiki/2.-Getting-started#using-4stems-model))
14+
* Vocals / drums / bass / piano / other separation ([5 stems](https://github.com/deezer/spleeter/wiki/2.-Getting-started#using-5stems-model))
15+
16+
2 stems and 4 stems models have state of the art performances on the
17+
[musdb](https://sigsep.github.io/datasets/musdb.html) dataset. It is also very fast as
18+
it can perform separation of audio files to 4 stems 100x faster than real-time when run on a *GPU*.
19+
We designed it so you can use it straight from [command line](https://github.com/deezer/spleeter/wiki/2.-Getting-started#usage)
20+
as well as directly in your own development pipeline as a
21+
[Python library](https://github.com/deezer/spleeter/wiki/4.-API-Reference#separator)
22+
23+
**Spleeter** can be installed with [Conda](https://github.com/deezer/spleeter/wiki/1.-Installation#using-conda),
24+
with [pip](https://github.com/deezer/spleeter/wiki/1.-Installation#using-pip) or be used with
25+
[Docker](https://github.com/deezer/spleeter/wiki/2.-Getting-started#using-docker-image).
26+
27+
## Quick start
28+
29+
Want to try it out ? Just clone the repository and install a
30+
[Conda](https://github.com/deezer/spleeter/wiki/1.-Installation#using-conda)
31+
environment to start separating audio file as follows:
32+
33+
```bash
34+
$ git clone https://github.com/Deezer/spleeter
35+
$ conda env create -f spleeter/conda/spleeter-cpu.yaml
36+
$ conda activate spleeter-cpu
37+
$ spleeter separate -i spleeter/audio_example.mp3 -p spleeter:2stems -o output
38+
```
39+
You should get two separated audio files (`vocals.wav` and `accompaniment.wav`)
40+
in the `output/audio_example` folder.
41+
42+
For a more detailed documentation, please check the [repository wiki](https://github.com/deezer/spleeter/wiki)
43+
44+
## Reference
45+
If you use **Spleeter** in your work, please cite:
46+
47+
```
48+
@misc{spleeter2019,
49+
title={Spleeter: A Fast And State-of-the Art Music Source Separation Tool With Pre-trained Models},
50+
author={Romain Hennequin and Anis Khlif and Felix Voituret and Manuel Moussallam},
51+
howpublished={Late-Breaking/Demo ISMIR 2019},
52+
month={November},
53+
year={2019}
54+
}
55+
```
56+
57+
## License
58+
The code of **Spleeter** is MIT-licensed.
59+
60+
## Note
61+
This repository include a demo audio file `audio_example.mp3` which is an excerpt
62+
from Slow Motion Dream by Steven M Bryant (c) copyright 2011 Licensed under a Creative
63+
Commons Attribution (3.0) license. http://dig.ccmixter.org/files/stevieb357/34740
64+
Ft: CSoul,Alex Beroza & Robert Siekawitch

audio_example.mp3

257 KB
Binary file not shown.

conda/spleeter-cpu.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: spleeter-cpu
2+
3+
channels:
4+
- conda-forge
5+
- anaconda
6+
7+
dependencies:
8+
- python=3.7
9+
- tensorflow=1.14.0
10+
- ffmpeg
11+
- pandas==0.25.1
12+
- requests
13+
- pip
14+
- pip:
15+
- museval==0.3.0
16+
- musdb==0.3.1
17+
- norbert==0.2.1
18+
- spleeter

conda/spleeter-gpu.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: spleeter-gpu
2+
3+
channels:
4+
- conda-forge
5+
- anaconda
6+
7+
dependencies:
8+
- python=3.7
9+
- tensorflow-gpu=1.14.0
10+
- ffmpeg
11+
- pandas==0.25.1
12+
- requests
13+
- pip
14+
- pip:
15+
- museval==0.3.0
16+
- musdb==0.3.1
17+
- norbert==0.2.1
18+
- spleeter
19+

configs/2stems/base_config.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"train_csv": "path/to/train.csv",
3+
"validation_csv": "path/to/test.csv",
4+
"model_dir": "2stems",
5+
"mix_name": "mix",
6+
"instrument_list": ["vocals", "accompaniment"],
7+
"sample_rate":44100,
8+
"frame_length":4096,
9+
"frame_step":1024,
10+
"T":512,
11+
"F":1024,
12+
"n_channels":2,
13+
"separation_exponent":2,
14+
"mask_extension":"zeros",
15+
"learning_rate": 1e-4,
16+
"batch_size":4,
17+
"training_cache":"training_cache",
18+
"validation_cache":"validation_cache",
19+
"train_max_steps": 1000000,
20+
"throttle_secs":300,
21+
"random_seed":0,
22+
"save_checkpoints_steps":150,
23+
"save_summary_steps":5,
24+
"model":{
25+
"type":"unet.unet",
26+
"params":{}
27+
}
28+
}

configs/4stems/base_config.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"train_csv": "path/to/train.csv",
3+
"validation_csv": "path/to/test.csv",
4+
"model_dir": "4stems",
5+
"mix_name": "mix",
6+
"instrument_list": ["vocals", "drums", "bass", "other"],
7+
"sample_rate":44100,
8+
"frame_length":4096,
9+
"frame_step":1024,
10+
"T":512,
11+
"F":1024,
12+
"n_channels":2,
13+
"separation_exponent":2,
14+
"mask_extension":"zeros",
15+
"learning_rate": 1e-4,
16+
"batch_size":4,
17+
"training_cache":"training_cache",
18+
"validation_cache":"validation_cache",
19+
"train_max_steps": 1500000,
20+
"throttle_secs":600,
21+
"random_seed":3,
22+
"save_checkpoints_steps":300,
23+
"save_summary_steps":5,
24+
"model":{
25+
"type":"unet.unet",
26+
"params":{
27+
"conv_activation":"ELU",
28+
"deconv_activation":"ELU"
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)