https://github.com/csteinmetz1/wavebeat

End-to-end beat and downbeat tracking in the time domain.

https://github.com/csteinmetz1/wavebeat

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org, zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

End-to-end beat and downbeat tracking in the time domain.

Basic Info
  • Host: GitHub
  • Owner: csteinmetz1
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 2.18 MB
Statistics
  • Stars: 120
  • Watchers: 4
  • Forks: 14
  • Open Issues: 3
  • Releases: 0
Created over 5 years ago · Last pushed over 4 years ago
Metadata Files
Readme License

README.md

# WaveBeat End-to-end beat and downbeat tracking in the time domain. | [Paper](https://arxiv.org/abs/2110.01436) | [Code](https://github.com/csteinmetz1/wavebeat) | [Video](https://youtu.be/rHSvRQOlric) | [Slides](https://csteinmetz1.github.io/wavebeat/resources/AES_151__WaveBeat_slides.pdf) |

Setup

First clone the repo. git clone https://github.com/csteinmetz1/wavebeat.git cd wavebeat

Setup a virtual environment and activate it. This requires that you use Python 3.8. python3 -m venv env/ source env/bin/activate Next install numpy, cython, and aiohttp first, manually. pip install numpy cython aiohttp Then install the wavebeat module. python setup.py install

This will ensure that madmom installs properly, as it currently fails unless cython, numpy, and aiohttp are installed first.

Predicting beats

To begin you will first need to download the pre-trained model here. Place it in the checkpoints/ directory, rename to get the .ckpt file.

cd checkpoints wget https://zenodo.org/record/5525120/files/wavebeat_epoch%3D98-step%3D24749.ckpt?download=1 mv wavebeat_epoch=98-step=24749.ckpt?download=1 wavebeat_epoch=98-step=24749.ckpt

Functional interface

If you would like to use the functional interface you can create a script and import wavebeat as follows.

```python from wavebeat.tracker import beatTracker

beat, downbeats = beatTracker('audio.wav') ```

Script interface

We provide a simple script interface to load an audio file and predict the beat and downbeat locations with a pre-trained model. Run the model by providing a path to an audio file.

python predict.py path_to_audio.wav

Evaluation

In order to run the training and evaluation code you will additionally need to install all of the development requirements. pip install -r requirements.txt

To recreate our reported results you will first need to have access to the datasets. See the paper for details on where to find them.

Use the command below to run the evaluation on GPU. python simple_test.py \ --logdir mdoels/wavebeatv1/ \ --ballroom_audio_dir /path/to/BallroomData \ --ballroom_annot_dir /path/to/BallroomAnnotations \ --beatles_audio_dir /path/to/The_Beatles \ --beatles_annot_dir /path/to/The_Beatles_Annotations/beat/The_Beatles \ --hainsworth_audio_dir /path/to/hainsworth/wavs \ --hainsworth_annot_dir /path/to/hainsworth/beat \ --rwc_popular_audio_dir /path/to/rwc_popular/audio \ --rwc_popular_annot_dir /path/to/rwc_popular/beat \ --gtzan_audio_dir /path/to/gtzan/ \ --gtzan_annot_dir /path/to/GTZAN-Rhythm/jams \ --smc_audio_dir /path/to/SMC_MIREX/SMC_MIREX_Audio \ --smc_annot_dir /path/to/SMC_MIREX/SMC_MIREX_Annotations_05_08_2014 \ --num_workers 8 \

Training

To train the model with the same hyperparameters as those used in the paper, assuming the datasets are available, run the following command.

python train.py \ --ballroom_audio_dir /path/to/BallroomData \ --ballroom_annot_dir /path/to/BallroomAnnotations \ --beatles_audio_dir /path/to/The_Beatles \ --beatles_annot_dir /path/to/The_Beatles_Annotations/beat/The_Beatles \ --hainsworth_audio_dir /path/to/hainsworth/wavs \ --hainsworth_annot_dir /path/to/hainsworth/beat \ --rwc_popular_audio_dir /path/to/rwc_popular/audio \ --rwc_popular_annot_dir /path/to/rwc_popular/beat \ --gpus 1 \ --preload \ --precision 16 \ --patience 10 \ --train_length 2097152 \ --eval_length 2097152 \ --model_type dstcn \ --act_type PReLU \ --norm_type BatchNorm \ --channel_width 32 \ --channel_growth 32 \ --augment \ --batch_size 16 \ --lr 1e-3 \ --gradient_clip_val 4.0 \ --audio_sample_rate 22050 \ --num_workers 24 \ --max_epochs 100 \

Cite

If you use this code in your work please consider citing us.

@inproceedings{steinmetz2021wavebeat, title={{WaveBeat}: End-to-end beat and downbeat tracking in the time domain}, author={Steinmetz, Christian J. and Reiss, Joshua D.}, booktitle={151st AES Convention}, year={2021}}

Owner

  • Name: Christian J. Steinmetz
  • Login: csteinmetz1
  • Kind: user
  • Location: London, UK
  • Company: @aim-qmul

Machine learning for Hi-Fi audio. PhD Researcher at C4DM.

GitHub Events

Total
  • Watch event: 3
Last Year
  • Watch event: 3

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 5
  • Total pull requests: 1
  • Average time to close issues: 8 days
  • Average time to close pull requests: 6 minutes
  • Total issue authors: 5
  • Total pull request authors: 1
  • Average comments per issue: 0.4
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Becomebright (1)
  • csteinmetz1 (1)
  • sevagh (1)
  • BeBuBu (1)
  • tshpakova (1)
Pull Request Authors
  • nicolasanjoran (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

requirements.txt pypi
  • Cython ==0.29.22
  • Markdown ==3.3.3
  • Pillow ==8.1.0
  • PyYAML ==5.3.1
  • SoundFile ==0.10.3.post1
  • Werkzeug ==1.0.1
  • absl-py ==0.11.0
  • aiohttp ==3.7.3
  • async-timeout ==3.0.1
  • attrs ==20.3.0
  • cachetools ==4.2.1
  • certifi ==2020.12.5
  • cffi ==1.14.5
  • chardet ==3.0.4
  • cycler ==0.10.0
  • fsspec ==0.8.5
  • future ==0.18.2
  • google-auth ==1.26.1
  • google-auth-oauthlib ==0.4.2
  • grpcio ==1.35.0
  • idna ==2.10
  • joblib ==1.0.1
  • julius ==0.2.2
  • kiwisolver ==1.3.1
  • madmom ==0.16.1
  • matplotlib ==3.3.4
  • mido ==1.2.9
  • mir-eval ==0.6
  • multidict ==5.1.0
  • numpy ==1.20.1
  • oauthlib ==3.1.0
  • protobuf ==3.14.0
  • pyasn1 ==0.4.8
  • pyasn1-modules ==0.2.8
  • pycparser ==2.20
  • pyparsing ==2.4.7
  • python-dateutil ==2.8.1
  • pytorch-lightning ==1.1.8
  • requests ==2.25.1
  • requests-oauthlib ==1.3.0
  • rsa ==4.7.1
  • scikit-learn ==0.24.1
  • scipy ==1.6.0
  • six ==1.15.0
  • sklearn ==0.0
  • sox ==1.4.1
  • soxbindings ==1.2.2
  • tensorboard ==2.4.1
  • tensorboard-plugin-wit ==1.8.0
  • threadpoolctl ==2.1.0
  • torch ==1.7.1
  • torchaudio ==0.7.2
  • torchsummary ==1.5.1
  • torchvision ==0.8.2
  • tqdm ==4.56.2
  • typing-extensions ==3.7.4.3
  • urllib3 ==1.26.3
  • yarl ==1.6.3
setup.py pypi
  • Pillow *
  • cython *
  • julius *
  • madmom *
  • matplotlib *
  • mir_eval *
  • numpy *
  • pytorch_lightning ==1.1.8
  • scipy *
  • soxbindings *
  • torch ==1.7.1
  • torchaudio ==0.7.2
  • torchvision ==0.8.2
  • tqdm *