Piano transcription inference toolbox
Project description
Piano transcription inference
This toolbox is a piano transcription inference package that can be easily installed. Users can transcribe their favorite piano recordings to MIDI files after installation. To see how the piano transcription system is trained, please visit: https://github.com/bytedance/piano_transcription.
Demos
Here is a demo of our piano transcription system: https://www.youtube.com/watch?v=5U-WL0QvKCg
Installation
The piano transcription system is developed with Python 3.7 and PyTorch 1.4.0 (Should work with other versions, but not fully tested). Install PyTorch (>=1.4) following https://pytorch.org/. Users should have ffmpeg installed to transcribe mp3 files.
pip install piano_transcription_inference
Then, installation finished!
Or users could also install from source code:
$ python3 setup.py install
Usage
python3 example.py --audio_path='resources/cut_liszt.mp3' --output_midi_path='cut_liszt.mid' --cuda
For example:
import librosa
from piano_transcription_inference import PianoTranscription, sample_rate
# Load audio
(audio, _) = librosa.core.load('resources/cut_liszt.mp3', sr=sample_rate, mono=True)
# Transcriptor
transcriptor = PianoTranscription(device='cuda')
# Transcribe and write out to MIDI file
transcribed_dict = transcriptor.transcribe(audio, 'cut_liszt.mid')
Visualization of piano transcription
Demo. Lang Lang: Franz Liszt - Love Dream (Liebestraum) [audio] [transcribed_midi]
FAQs
If users met the problem of command line shows "Killed". This can be caused by users do not have sufficient memory.
Applications
We have built a large-scale classical piano MIDI dataset https://github.com/bytedance/GiantMIDI-Piano using our piano transcription system.
Cite
[1] High-resolution Piano Transcription with Pedals by Regressing Onsets and Offsets Times, [To appear], 2020
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for piano-transcription-inference-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f74d335f8b3608239dbab5c2ddb269b4709a91039ca95bfbf80fb3fa078d1e5 |
|
MD5 | 7f090d81cd8700201687b7424866a615 |
|
BLAKE2b-256 | 081894d872b5cc0c03547a74098d4b707456d21f6a0622fda97acf8d896d45de |
Hashes for piano_transcription_inference-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af60b0b9c498b18f8f0f529e2db8d62e906bd1ed6b48b99029f4a088314c2852 |
|
MD5 | 3d140f0517cd794bfb16710e89d6e002 |
|
BLAKE2b-256 | 1b330f182379c6a6378796f61b89e6c2d3ef0faf5cfd5ec8a6879a02f2a65f04 |