[PYTHON] The simplest way to build a Spleeter usage environment using Windows

Introduction

What is Spleeter? ⇒ A great guy who separates music data into parts by machine learning! !!

There are many articles published that include unnecessary steps such as installing Git for building the environment of Spleeter for Windows, so I tried to summarize the simple steps.

Preparation

  1. Download Miniconda (Python 3.x Windows installers) from the following site. https://docs.conda.io/en/latest/miniconda.html

  2. Create "spleeter-cpu.yaml" with a text editor.

spleeter-cpu.yaml



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

Installation

  1. Install the Miniconda downloaded in preparation with the default settings.
  2. Start Anaconda Prompt (Miniconda3) from the start menu.
  3. Execute conda env create -f [path of spleeter-cpu.yaml]. It will be downloaded in various ways, so wait until it is completed.
  4. Run conda info --envs and verify that" spleeter-cpu "has been created.

how to use

  1. Start Anaconda Prompt (Miniconda3) from the start menu.
  2. Run conda activate spleeter-cpu.
  3. Execute spleeter separate -i [music data path] -o [output destination path] -p spleeter: [2 or 4 or 5] stems.

Example: spleeter separate -i hoge.wav -o D: \ hoge -p spleeter: 2stems

Use the numbers [2 or 4 or 5] according to the number of parts you want to separate. 2: Vocal / Accompaniment 4: Vocal / Drum / Bass / Other 5: Vocal / Drum / Bass / Piano / Other

Machine learning data is downloaded to the input source folder, so if you unify the input source, you can shorten the time from the next time onwards ...

bonus

I also have a batch that can process multiple files by D & D. Please rewrite [User name] according to your environment. If spaces, tabs, equal signs, semicolons, and commas that are recognized as delimiters in the command prompt specifications are included in the music data file name, the output destination folder will be strange.

spleeter.bat



@echo off
set DESTPATH=%~dp1
set /P ITEM="Enter the number of separations and press Enter(2/4/5):"

set FLAG=False
if %ITEM%==2 set FLAG=True
if %ITEM%==4 set FLAG=True
if %ITEM%==5 set FLAG=True

if %FLAG%==True (
 call C:\Users\[User name]\miniconda3\Scripts\activate.bat
 call conda activate spleeter-cpu
 for %%f in (%*) do call python -m spleeter separate -i %%f -o %DESTPATH% -p spleeter:%ITEM%stems
echo It's over. Press any key to exit.
)else echo The number of separations is strange. Press any key to exit.
pause > nul

Recommended Posts

The simplest way to build a Spleeter usage environment using Windows
Build a Python environment and transfer data to the server
Build a go environment using Docker
How to build a LAMP environment using Vagrant and VirtulBox Note
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
How to build a sphinx translation environment
I want to build a Python environment
[Mac] Build a Python 3.x environment at the fastest speed using Docker
Build Linux on a Windows environment. Steps to install Laradock and migrate
Simply build a Python 3 execution environment on Windows
Build a python environment to learn the theory and implementation of deep learning
Instructions for connecting Google Colab. To the local runtime in a Windows environment
Build a GVim-based Python development environment on Windows 10 (3) GVim8.0 & Python3.6
I tried to build an environment with WSL + Ubuntu + VS Code in a Windows environment
How to write a GUI using the maya command
How to set up a Python environment using pyenv
A real way for people using python 3.8.0-2 from windows to work with multibyte characters
The shortest route to get a cultural fish environment
Build a GVim-based Python development environment on Windows 10 (1) Installation
How to build a Django (python) environment on docker
I want to easily build a model-based development environment
Build a Python virtual environment using venv (Django + MySQL ①)
[Go + Gin] I tried to build a Docker environment
Build a Python environment on your Mac using pyenv
How to build a development environment for TensorFlow (1.0.0) (Mac)
Build a Python development environment using pyenv on MacOS
Fixed a way to force Windows to boot in UEFI
How to build a Python environment on amazon linux 2
The story of using circleci to build manylinux wheels
Build a machine learning environment natively on Windows 10 (x64)
Build a lightweight Fast API development environment using Docker
How to build a Python virtual execution environment using Visual Studio Code and pipenv on a Windows machine (also Jupyter notebook)
I tried to automate the construction of a hands-on environment using IBM Cloud's SoftLayer API
I tried the super-resolution algorithm "PULSE" in a Windows environment
How to build a new python virtual environment on Ubuntu
Add an extension to build a more comfortable Jupyter environment
Probably the easiest way to create a pdf with Python3
Introducing Kaggle's Docker Image on Windows to build an environment
How to generate a query using the IN operator in Django
Build a GVim-based Python development environment on Windows 10 (2) Basic settings
I made a VGG16 model using TensorFlow (on the way)
How to build a python2.7 series development environment with Vagrant
The usual way to add a Kernel with Jupyter Notebook
pyenv, virtualenv Use docker to manage the environment without using
Try to model a multimodal distribution using the EM algorithm
Build a Flask development environment at low cost using Docker
Build a LAMP environment [CentOS 7]
Build Python environment on Windows
Build python environment on windows
Build a machine learning environment
Build a Python environment offline
I tried to create a server environment that runs on Windows 10
Build a Selenium environment on Amazon Linux 2 in the shortest time
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
Build a local development environment for Lambda + Python using Serverless Framework
Try using virtualenv, which can build a virtual environment for Python
Try to edit a new image using the trained StyleGAN2 model
The road to web application development is a long way off
Build a Python execution environment using GPU with GCP Compute engine
[AWS / Tello] Build a system to operate the drone on the cloud
Using TensorFlow in the cloud integrated development environment Cloud9 ~ Basics of usage ~