Skip to content

convert spleeter pretrained model to pytorch and onnx, then convert to mnn

License

Notifications You must be signed in to change notification settings

bigcash/spleeter-pytorch-mnn

Repository files navigation

spleeter-pytorch-mnn

convert spleeter pretrained model to pytorch and onnx, then convert to mnn

Download pretrained

Convert

TF model → ONNX(use pytorch) → MNN

  • TF model → ONNX model(use pytorch)
python convert2onnx.py
  • ONNX model → MNN model
# FP32
mnnconvert -f ONNX --modelFile vocals.onnx --MNNModel vocals.mnn
mnnconvert -f ONNX --modelFile accompaniment.onnx --MNNModel accompaniment.mnn

# FP16
mnnconvert -f ONNX --modelFile vocals.onnx --MNNModel vocals_fp16.mnn --fp16 FP16
mnnconvert -f ONNX --modelFile accompaniment.onnx --MNNModel accompaniment_fp16.mnn --fp16 FP16

Usage

  • run with TF model
python test_estimator.py
  • run with MNN
python spleeter_mnn.py

Performance

  • Test on my laptop: Inter(R) Core(TM) i5-8300H CPU @ 2.30GHz 2.30GHz
- TF model MNN model
CPU 0.4666s 0.6690s

WORSE use MNN?

Acknowledge

About

convert spleeter pretrained model to pytorch and onnx, then convert to mnn

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages