susnato / pop2piano_dev

huggingface.co
Total runs: 55
24-hour runs: 4
7-day runs: 28
30-day runs: 37
Model's Last Updated: August 29 2023
automatic-speech-recognition

Introduction of pop2piano_dev

Model Details of pop2piano_dev

POP2PIANO

Pop2Piano, a Transformer network that generates piano covers given waveforms of pop music.

Model Details

Pop2Piano was proposed in the paper Pop2Piano : Pop Audio-based Piano Cover Generation by Jongho Choi and Kyogu Lee.

Piano covers of pop music are widely enjoyed, but generating them from music is not a trivial task. It requires great expertise with playing piano as well as knowing different characteristics and melodies of a song. With Pop2Piano you can directly generate a cover from a song's audio waveform. It is the first model to directly generate a piano cover from pop audio without melody and chord extraction modules.

Pop2Piano is an encoder-decoder Transformer model based on T5 . The input audio is transformed to its waveform and passed to the encoder, which transforms it to a latent representation. The decoder uses these latent representations to generate token ids in an autoregressive way. Each token id corresponds to one of four different token types: time, velocity, note and 'special'. The token ids are then decoded to their equivalent MIDI file.

Model Sources

Usage

To use Pop2Piano, you will need to install the 🤗 Transformers library, as well as the following third party modules:

pip install https://github.com/huggingface/transformers.git
pip install pretty-midi==0.2.9 essentia==2.1b6.dev1034 librosa scipy

Please note that you may need to restart your runtime after installation.

Pop music to Piano
Code Example
  • Using your own Audio
>>> import librosa
>>> from transformers import Pop2PianoForConditionalGeneration, Pop2PianoProcessor

>>> audio, sr = librosa.load("<your_audio_file_here>", sr=44100)  # feel free to change the sr to a suitable value.
>>> model = Pop2PianoForConditionalGeneration.from_pretrained("sweetcocoa/pop2piano")
>>> processor = Pop2PianoProcessor.from_pretrained("sweetcocoa/pop2piano")

>>> inputs = processor(audio=audio, sampling_rate=sr, return_tensors="pt")
>>> model_output = model.generate(input_features=inputs["input_features"], composer="composer1")
>>> tokenizer_output = processor.batch_decode(
...     token_ids=model_output, feature_extractor_output=inputs
... )["pretty_midi_objects"][0]
>>> tokenizer_output.write("./Outputs/midi_output.mid")
  • Audio from Hugging Face Hub
>>> from datasets import load_dataset
>>> from transformers import Pop2PianoForConditionalGeneration, Pop2PianoProcessor

>>> model = Pop2PianoForConditionalGeneration.from_pretrained("sweetcocoa/pop2piano")
>>> processor = Pop2PianoProcessor.from_pretrained("sweetcocoa/pop2piano")
>>> ds = load_dataset("sweetcocoa/pop2piano_ci", split="test")

>>> inputs = processor(
...     audio=ds["audio"][0]["array"], sampling_rate=ds["audio"][0]["sampling_rate"], return_tensors="pt"
... )
>>> model_output = model.generate(input_features=inputs["input_features"], composer="composer1")
>>> tokenizer_output = processor.batch_decode(
...     token_ids=model_output, feature_extractor_output=inputs
... )["pretty_midi_objects"][0]
>>> tokenizer_output.write("./Outputs/midi_output.mid")
Example

Here we present an example of generated MIDI.

  • Actual Pop Music
  • Generated MIDI
Tips
  1. Pop2Piano is an Encoder-Decoder based model like T5.
  2. Pop2Piano can be used to generate midi-audio files for a given audio sequence.
  3. Choosing different composers in Pop2PianoForConditionalGeneration.generate() can lead to variety of different results.
  4. Setting the sampling rate to 44.1 kHz when loading the audio file can give good performance.
  5. Though Pop2Piano was mainly trained on Korean Pop music, it also does pretty well on other Western Pop or Hip Hop songs.

Citation

BibTeX:

@misc{choi2023pop2piano,
      title={Pop2Piano : Pop Audio-based Piano Cover Generation}, 
      author={Jongho Choi and Kyogu Lee},
      year={2023},
      eprint={2211.00895},
      archivePrefix={arXiv},
      primaryClass={cs.SD}
}

Runs of susnato pop2piano_dev on huggingface.co

55
Total runs
4
24-hour runs
11
3-day runs
28
7-day runs
37
30-day runs

More Information About pop2piano_dev huggingface.co Model

pop2piano_dev huggingface.co

pop2piano_dev huggingface.co is an AI model on huggingface.co that provides pop2piano_dev's model effect (), which can be used instantly with this susnato pop2piano_dev model. huggingface.co supports a free trial of the pop2piano_dev model, and also provides paid use of the pop2piano_dev. Support call pop2piano_dev model through api, including Node.js, Python, http.

pop2piano_dev huggingface.co Url

https://huggingface.co/susnato/pop2piano_dev

susnato pop2piano_dev online free

pop2piano_dev huggingface.co is an online trial and call api platform, which integrates pop2piano_dev's modeling effects, including api services, and provides a free online trial of pop2piano_dev, you can try pop2piano_dev online for free by clicking the link below.

susnato pop2piano_dev online free url in huggingface.co:

https://huggingface.co/susnato/pop2piano_dev

pop2piano_dev install

pop2piano_dev is an open source model from GitHub that offers a free installation service, and any user can find pop2piano_dev on GitHub to install. At the same time, huggingface.co provides the effect of pop2piano_dev install, users can directly use pop2piano_dev installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

pop2piano_dev install url in huggingface.co:

https://huggingface.co/susnato/pop2piano_dev

Url of pop2piano_dev

pop2piano_dev huggingface.co Url

Provider of pop2piano_dev huggingface.co

susnato
ORGANIZATIONS

Other API from susnato

huggingface.co

Total runs: 114.6K
Run Growth: 25.6K
Growth Rate: 22.29%
Updated:October 29 2023
huggingface.co

Total runs: 755
Run Growth: -127
Growth Rate: -16.82%
Updated:January 21 2024
huggingface.co

Total runs: 282
Run Growth: -1
Growth Rate: -0.35%
Updated:November 01 2023
huggingface.co

Total runs: 25
Run Growth: 7
Growth Rate: 28.00%
Updated:November 01 2023
huggingface.co

Total runs: 15
Run Growth: 7
Growth Rate: 46.67%
Updated:January 03 2023
huggingface.co

Total runs: 7
Run Growth: 2
Growth Rate: 28.57%
Updated:June 04 2024
huggingface.co

Total runs: 7
Run Growth: 0
Growth Rate: 0.00%
Updated:June 04 2024
huggingface.co

Total runs: 5
Run Growth: 0
Growth Rate: 0.00%
Updated:December 31 2022