Skip to content

Commit

Permalink
Initial commit from private spleeter
Browse files Browse the repository at this point in the history
  • Loading branch information
romi1502 committed Oct 28, 2019
1 parent dc39414 commit 556ef21
Show file tree
Hide file tree
Showing 47 changed files with 3,924 additions and 3 deletions.
112 changes: 112 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.vscode
.DS_Store
__pycache__
**/reporting

pretrained_models
docs/build
.vscode
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019-present, Deezer SA.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include src/resources/*.json
include README.md
include LICENSE
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# =======================================================
# Build script for distribution packaging.
#
# @author Deezer Research <[email protected]>
# @licence MIT Licence
# =======================================================

clean:
rm -Rf *.egg-info
rm -Rf dist

build:
@echo "=== Build CPU bdist package"
@python3 setup.py sdist
@echo "=== CPU version checksum"
@openssl sha256 dist/*.tar.gz

build-gpu:
@echo "=== Build GPU bdist package"
@python3 setup.py sdist --target gpu
@echo "=== GPU version checksum"
@openssl sha256 dist/*.tar.gz

upload:
twine upload dist/*

test-upload:
twine upload --repository-url https://test.pypi.org/legacy/ dist/*

all: clean build build-gpu upload
64 changes: 61 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,64 @@
# spleeter
<img src="https://github.com/deezer/spleeter/raw/master/images/spleeter_logo.png" height="80" />

<img src=images/spleeter_logo.png height=100>
[![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)

## About

spleeter will be made available soon!
**Spleeter** is the [Deezer](https://www.deezer.com/) source separation library with pretrained models
written in [Python](https://www.python.org/) and uses [Tensorflow](tensorflow.org/). It makes it easy
to train source separation model (assuming you have a dataset of isolated sources), and provides
already trained state of the art model for performing various flavour of separation :

* Vocals (singing voice) / accompaniment separation ([2 stems](https://github.com/deezer/spleeter/wiki/2.-Getting-started#using-2stems-model))
* Vocals / drums / bass / other separation ([4 stems](https://github.com/deezer/spleeter/wiki/2.-Getting-started#using-4stems-model))
* Vocals / drums / bass / piano / other separation ([5 stems](https://github.com/deezer/spleeter/wiki/2.-Getting-started#using-5stems-model))

2 stems and 4 stems models have state of the art performances on the
[musdb](https://sigsep.github.io/datasets/musdb.html) dataset. It is also very fast as
it can perform separation of audio files to 4 stems 100x faster than real-time when run on a *GPU*.
We designed it so you can use it straight from [command line](https://github.com/deezer/spleeter/wiki/2.-Getting-started#usage)
as well as directly in your own development pipeline as a
[Python library](https://github.com/deezer/spleeter/wiki/4.-API-Reference#separator)

**Spleeter** can be installed with [Conda](https://github.com/deezer/spleeter/wiki/1.-Installation#using-conda),
with [pip](https://github.com/deezer/spleeter/wiki/1.-Installation#using-pip) or be used with
[Docker](https://github.com/deezer/spleeter/wiki/2.-Getting-started#using-docker-image).

## Quick start

Want to try it out ? Just clone the repository and install a
[Conda](https://github.com/deezer/spleeter/wiki/1.-Installation#using-conda)
environment to start separating audio file as follows:

```bash
$ git clone https://github.com/Deezer/spleeter
$ conda env create -f spleeter/conda/spleeter-cpu.yaml
$ conda activate spleeter-cpu
$ spleeter separate -i spleeter/audio_example.mp3 -p spleeter:2stems -o output
```
You should get two separated audio files (`vocals.wav` and `accompaniment.wav`)
in the `output/audio_example` folder.

For a more detailed documentation, please check the [repository wiki](https://github.com/deezer/spleeter/wiki)

## Reference
If you use **Spleeter** in your work, please cite:

```
@misc{spleeter2019,
title={Spleeter: A Fast And State-of-the Art Music Source Separation Tool With Pre-trained Models},
author={Romain Hennequin and Anis Khlif and Felix Voituret and Manuel Moussallam},
howpublished={Late-Breaking/Demo ISMIR 2019},
month={November},
year={2019}
}
```

## License
The code of **Spleeter** is MIT-licensed.

## Note
This repository include a demo audio file `audio_example.mp3` which is an excerpt
from Slow Motion Dream by Steven M Bryant (c) copyright 2011 Licensed under a Creative
Commons Attribution (3.0) license. http://dig.ccmixter.org/files/stevieb357/34740
Ft: CSoul,Alex Beroza & Robert Siekawitch
Binary file added audio_example.mp3
Binary file not shown.
18 changes: 18 additions & 0 deletions conda/spleeter-cpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: spleeter-cpu

channels:
- conda-forge
- anaconda

dependencies:
- python=3.7
- tensorflow=1.14.0
- ffmpeg
- pandas==0.25.1
- requests
- pip
- pip:
- museval==0.3.0
- musdb==0.3.1
- norbert==0.2.1
- spleeter
19 changes: 19 additions & 0 deletions conda/spleeter-gpu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: spleeter-gpu

channels:
- conda-forge
- anaconda

dependencies:
- python=3.7
- tensorflow-gpu=1.14.0
- ffmpeg
- pandas==0.25.1
- requests
- pip
- pip:
- museval==0.3.0
- musdb==0.3.1
- norbert==0.2.1
- spleeter

28 changes: 28 additions & 0 deletions configs/2stems/base_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"train_csv": "path/to/train.csv",
"validation_csv": "path/to/test.csv",
"model_dir": "2stems",
"mix_name": "mix",
"instrument_list": ["vocals", "accompaniment"],
"sample_rate":44100,
"frame_length":4096,
"frame_step":1024,
"T":512,
"F":1024,
"n_channels":2,
"separation_exponent":2,
"mask_extension":"zeros",
"learning_rate": 1e-4,
"batch_size":4,
"training_cache":"training_cache",
"validation_cache":"validation_cache",
"train_max_steps": 1000000,
"throttle_secs":300,
"random_seed":0,
"save_checkpoints_steps":150,
"save_summary_steps":5,
"model":{
"type":"unet.unet",
"params":{}
}
}
31 changes: 31 additions & 0 deletions configs/4stems/base_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"train_csv": "path/to/train.csv",
"validation_csv": "path/to/test.csv",
"model_dir": "4stems",
"mix_name": "mix",
"instrument_list": ["vocals", "drums", "bass", "other"],
"sample_rate":44100,
"frame_length":4096,
"frame_step":1024,
"T":512,
"F":1024,
"n_channels":2,
"separation_exponent":2,
"mask_extension":"zeros",
"learning_rate": 1e-4,
"batch_size":4,
"training_cache":"training_cache",
"validation_cache":"validation_cache",
"train_max_steps": 1500000,
"throttle_secs":600,
"random_seed":3,
"save_checkpoints_steps":300,
"save_summary_steps":5,
"model":{
"type":"unet.unet",
"params":{
"conv_activation":"ELU",
"deconv_activation":"ELU"
}
}
}
31 changes: 31 additions & 0 deletions configs/5stems/base_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"train_csv": "path/to/train.csv",
"validation_csv": "path/to/test.csv",
"model_dir": "5stems",
"mix_name": "mix",
"instrument_list": ["vocals", "piano", "drums", "bass", "other"],
"sample_rate":44100,
"frame_length":4096,
"frame_step":1024,
"T":512,
"F":1024,
"n_channels":2,
"separation_exponent":2,
"mask_extension":"zeros",
"learning_rate": 1e-4,
"batch_size":4,
"training_cache":"training_cache",
"validation_cache":"validation_cache",
"train_max_steps": 2500000,
"throttle_secs":600,
"random_seed":8,
"save_checkpoints_steps":300,
"save_summary_steps":5,
"model":{
"type":"unet.softmax_unet",
"params":{
"conv_activation":"ELU",
"deconv_activation":"ELU"
}
}
}
Loading

0 comments on commit 556ef21

Please sign in to comment.