[Bug] The separation results from python library perform not well.
- Dominant language
- Python
- Stars
- 28.4k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
- [☑️] 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.
```python
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
Contributor guide
Research direction
Start with the Python API example using AudioAdapter.default(), Separator, and spleeter/resources/2stems.json, then compare it with the spleeter.ipynb command-line flow. Reproduce the issue with audio_example.mp3 and inspect whether the generated vocals.wav and accomplaniment.wav contain separated stems rather than a quieter copy of the input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- audio-video-rtc, machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100