spleeter icon indicating copy to clipboard operation
spleeter copied to clipboard

[Bug] The separation results from python library perform not well.

Open njusq opened this issue 1 year ago • 0 comments

  • [☑️] I didn't find a similar issue already open.
  • [☑️] I read the documentation (README AND Wiki)
  • [☑️] I have installed FFMpeg
  • [☑️] My problem is related to Spleeter only, not a derivative product (such as Webapplication, or GUI provided by others)

Description

I try spleeter using command line(https://github.com/deezer/spleeter/blob/master/spleeter.ipynb), it works really well. When I try it from python library (https://github.com/deezer/spleeter/wiki/4.-API-Reference#separator), the output from the separator of the audio "audio_example.mp3" is not separated. Is there anything wrong when I got the separation results?

Step to reproduce

The below python script shows how I got the separation result.

import numpy as np
import soundfile as sf
from spleeter.audio.adapter import AudioAdapter
from spleeter.separator import Separator
# Load wav using adapter
input_file = "audio_example.mp3"
audio_loader = AudioAdapter.default()
sr = 44100
signal, _ = audio_loader.load(input_file, sample_rate=sr)
# separate
separator = Separator('spleeter/resources/2stems.json')
pred = separator.separate(signal)
sf.write("output/vocals.wav", pred["vocals"], sr)
sf.write("output/accomplaniment.wav", pred["accompaniment"], sr)

Output

The output vocals and accompaniment seem like compressing the volume of the input "audio_example.mp3", not the correct separation result.

Environment

OS Linux
Installation type pip
RAM available XGo
Hardware spec CPU

Additional context

njusq avatar Apr 19 '23 03:04 njusq