https://github.com/fwcd/spleeter-pytorch
Spleeter implementation using PyTorch with support for conversion to Core ML
https://github.com/fwcd/spleeter-pytorch
audio coreml pytorch spleeter stems
Last synced: about 1 year ago
JSON representation
Spleeter implementation using PyTorch with support for conversion to Core ML
- Host: GitHub
- URL: https://github.com/fwcd/spleeter-pytorch
- Owner: fwcd
- License: mit
- Created: 2023-05-11T11:23:41.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-07T06:23:48.000Z (almost 3 years ago)
- Last Synced: 2025-04-01T02:48:15.748Z (about 1 year ago)
- Topics: audio, coreml, pytorch, spleeter, stems
- Language: Python
- Homepage:
- Size: 91.2 MB
- Stars: 19
- Watchers: 3
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# spleeter-pytorch
A small implementation of the [Spleeter](https://github.com/deezer/spleeter) stem separation model in PyTorch. Using this model, audio files can be demixed into vocals, instrumentation etc.
## Example
Install the package using `pip3 install .`, then run
```sh
spleeter-pytorch audio-example.mp3
```
to separate the example file. The output will be located in `output/stems`.
## Conversion to Core ML
The non-FFT parts of the Spleeter model can be converted to Core ML, for efficient inference on macOS/iOS devices. To perform the conversion, run
```sh
./convert-to-coreml
```
The `.mlpackage` will be located under `output/coreml`.
> Note: The converted model corresponds to the [`Separator`](spleeter_pytorch/separator.py) module and still requires the consumer of the model to manually perform the STFT conversion as performed in the [`Estimator`](spleeter_pytorch/estimator.py). This is due to Core ML [not supporting FFT operations yet](https://github.com/apple/coremltools/issues/1311).
## Note
* Currently this is only tested with the 2stems model. Feel free to [get one of the other models](https://github.com/deezer/spleeter/releases/tag/v1.4.0) and test it on them.
* There might be some bugs, the quality of output isn't as good as the original. If someone found the reason, please open a pull request. Thanks.
## Reference
* [Original Spleeter](https://github.com/deezer/spleeter) by [`deezer`](https://github.com/deezer)
* [Original `spleeter-pytorch`](https://github.com/tuan3w/spleeter-pytorch) by [`tuan3w`](https://github.com/tuan3w)
## License
**MIT**.