Name | piano-transcription-inference JSON |
Version |
0.0.6
JSON |
| download |
home_page | None |
Summary | Piano transcription inference toolbox |
upload_time | 2025-01-26 02:30:41 |
maintainer | None |
docs_url | None |
author | Qiuqiang Kong |
requires_python | >=3.6 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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 following https://pytorch.org/. Users should have **ffmpeg** installed to transcribe mp3 files.
```bash
pip install piano_transcription_inference
```
Installation is finished!
## Usage
Want to try it out but don't want to install anything? We have set up a [Google Colab](https://colab.research.google.com/github/qiuqiangkong/piano_transcription_inference/blob/master/resources/inference.ipynb).
```python
python3 example.py --audio_path='resources/cut_liszt.mp3' --output_midi_path='cut_liszt.mid' --cuda
```
This will download the pretrained model from https://zenodo.org/record/4034264.
Users could also execute the inference code line by line:
```python
import librosa
from piano_transcription_inference import PianoTranscription, sample_rate
# Load audio
audio, _ = librosa.load(path=audio_path, sr=sample_rate, mono=True)
# Transcriptor
transcriptor = PianoTranscription(device='cuda', checkpoint_path=None) # device: 'cuda' | 'cpu'
# 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]](resources/cut_liszt.mp3) [[transcribed_midi]](resources/cut_liszt.mid)
<img src="resources/cut_liszt.png">
## FAQs
This repo support Linux and Mac. Windows has not been tested.
If users met "audio.exceptions.NoBackendError", then check if ffmpeg is installed.
If users met the problem of "Killed". This is caused by there are not 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
Raw data
{
"_id": null,
"home_page": null,
"name": "piano-transcription-inference",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Qiuqiang Kong",
"author_email": "qiuqiangkong@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/15/d8/8b2d1f2f9dba01c122686e2b7910ced8dfe14fc246099d44607c6fa460f1/piano_transcription_inference-0.0.6.tar.gz",
"platform": null,
"description": "# Piano transcription inference\n\nThis 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.\n\n## Demos\nHere is a demo of our piano transcription system: https://www.youtube.com/watch?v=5U-WL0QvKCg\n\n## Installation\nThe piano transcription system is developed with Python 3.7 and PyTorch 1.4.0 (Should work with other versions, but not fully tested).\nInstall PyTorch following https://pytorch.org/. Users should have **ffmpeg** installed to transcribe mp3 files.\n\n```bash\npip install piano_transcription_inference\n```\n\nInstallation is finished! \n\n## Usage\nWant to try it out but don't want to install anything? We have set up a [Google Colab](https://colab.research.google.com/github/qiuqiangkong/piano_transcription_inference/blob/master/resources/inference.ipynb).\n\n```python\npython3 example.py --audio_path='resources/cut_liszt.mp3' --output_midi_path='cut_liszt.mid' --cuda\n```\n\nThis will download the pretrained model from https://zenodo.org/record/4034264. \n\nUsers could also execute the inference code line by line:\n\n```python\nimport librosa\nfrom piano_transcription_inference import PianoTranscription, sample_rate\n\n# Load audio\naudio, _ = librosa.load(path=audio_path, sr=sample_rate, mono=True)\n\n# Transcriptor\ntranscriptor = PianoTranscription(device='cuda', checkpoint_path=None) # device: 'cuda' | 'cpu'\n\n# Transcribe and write out to MIDI file\ntranscribed_dict = transcriptor.transcribe(audio, 'cut_liszt.mid')\n```\n\n## Visualization of piano transcription\n\n**Demo.** Lang Lang: Franz Liszt - Love Dream (Liebestraum) [[audio]](resources/cut_liszt.mp3) [[transcribed_midi]](resources/cut_liszt.mid)\n\n<img src=\"resources/cut_liszt.png\">\n\n## FAQs\nThis repo support Linux and Mac. Windows has not been tested.\n\nIf users met \"audio.exceptions.NoBackendError\", then check if ffmpeg is installed.\n\nIf users met the problem of \"Killed\". This is caused by there are not sufficient memory.\n\n## Applications\n\nWe have built a large-scale classical piano MIDI dataset https://github.com/bytedance/GiantMIDI-Piano using our piano transcription system.\n\n## Cite\n[1] High-resolution Piano Transcription with Pedals by Regressing Onsets and Offsets Times, [To appear], 2020\n",
"bugtrack_url": null,
"license": null,
"summary": "Piano transcription inference toolbox",
"version": "0.0.6",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "a0642360ab1eecf4c01a6c5d1bfb308f08a196236a559bcc135ca203e6742a5b",
"md5": "ffcacc2c645a7da4a7f7c768c637e9af",
"sha256": "64348200b700a0ee792aa62386803fb2a638e378b3835b9a7ccff4701f0612f5"
},
"downloads": -1,
"filename": "piano_transcription_inference-0.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ffcacc2c645a7da4a7f7c768c637e9af",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 14988,
"upload_time": "2025-01-26T02:30:39",
"upload_time_iso_8601": "2025-01-26T02:30:39.045379Z",
"url": "https://files.pythonhosted.org/packages/a0/64/2360ab1eecf4c01a6c5d1bfb308f08a196236a559bcc135ca203e6742a5b/piano_transcription_inference-0.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "15d88b2d1f2f9dba01c122686e2b7910ced8dfe14fc246099d44607c6fa460f1",
"md5": "a002cabd12da9a94d178f97f5d7cc822",
"sha256": "b6dd00f9b4bcacb6140725f03b4139a5e0f4acd35a69e492a5d1f734ecfbd231"
},
"downloads": -1,
"filename": "piano_transcription_inference-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "a002cabd12da9a94d178f97f5d7cc822",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 13881,
"upload_time": "2025-01-26T02:30:41",
"upload_time_iso_8601": "2025-01-26T02:30:41.129769Z",
"url": "https://files.pythonhosted.org/packages/15/d8/8b2d1f2f9dba01c122686e2b7910ced8dfe14fc246099d44607c6fa460f1/piano_transcription_inference-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-26 02:30:41",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "piano-transcription-inference"
}