Skip to main content

Functions for working with this data repository: https://figshare.com/articles/BirdsongRecognition/3470165

Project description

koumura

Functions for working with data from the following repository: https://figshare.com/articles/BirdsongRecognition/3470165

The repository contains .wav files of Bengalese finch song from ten birds and annotation for the songs in .xml files.

This repository provides a great resource, and was used to benchmark a sliding window-based neural network for segmenting and labeling the elements of birdsong, as described in the following paper:
Koumura, Takuya, and Kazuo Okanoya.
"Automatic recognition of element classes and boundaries in the birdsong with variable sequences."
PloS one 11.7 (2016): e0159188.
https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0159188

The code for the network can be found here:
https://github.com/takuya-koumura/birdsong-recognition

The original code was released under the GNU license:
https://github.com/takuya-koumura/birdsong-recognition/blob/master/LICENSE

The koumura module is used with the conbirt package to make the repository a dataset available in the hybrid-vocal-classifier and songdeck libraries.

It's called koumura because that's the last name of the first author on the paper, and because I am too lazy to type PyBirdsongRecognition.

Installation

$ pip install koumura

Usage

The main thing that koumura gives you is easy access to the annotation, without having to deal with the .xml file format.

To access the annotation in the Annotation.xml files for each bird, use the parse_xml function.

>>> from koumura import parse_xml
>>> seq_list = parse_xml(xml_file='./Bird0/Annotation.xml', concat_seqs_into_songs=False)
>>> seq_list[0]
Sequence from 0.wav with position 32000 and length 43168
>>> seq_list[0].syls[:3]
[Syllable labeled 0 at position 2240 with length 2688, Syllable labeled 0 at position 8256 with length 2784, Syllable labeled 0 at position 14944 with length 2816]  

Notice that this package preserves the abstraction of the original code, where syllables and sequences of syllables are represented as objects. This can be helpful if you are trying to replicate functionality from that code.
Importantly, each song is broken up into a number of "sequences". You can set the flag concat_seqs_into_songs to True if you want parse_xml to concatenate sequences by song (.wav file), so that each Sequence is actually all the sequences from one song.
If you are using the annotation to work with the dataset for some other purpose, you may find it more convenient to work with some other format. For that, please check out the conbirt package, which converts this annotation format and others to a tidy comma-separated value format.

The koumura package also provides a convenience function to load the annotation for an individual song, load_song_annot. This is basically a wrapper around parse_xml that filters out the songs you don't want.

>>> from koumura import load_song_annot
>>> wav1 = load_song_annot(wav_file='1.wav')
>>> print(wav1)                                                                                                  
Sequence from 1.wav with position 32000 and length 214176  

Getting Help

Please feel free to raise an issue here:
https://github.com/NickleDave/koumura/issues

License

BSD License.

Citation

If you use this module, please cite the DOI: DOI

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

koumura-0.1.1a1.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

koumura-0.1.1a1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file koumura-0.1.1a1.tar.gz.

File metadata

  • Download URL: koumura-0.1.1a1.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for koumura-0.1.1a1.tar.gz
Algorithm Hash digest
SHA256 bef899c80e25b4bd01e87e9afbea9a0794472a5d88f2b214dff73364d6d25e92
MD5 e2a087f79ebf58c05180b3ca85e9d56e
BLAKE2b-256 8770c4efc379b5055f474e2ba26598f91118570d162d82adf24cc6844898a93d

See more details on using hashes here.

File details

Details for the file koumura-0.1.1a1-py3-none-any.whl.

File metadata

  • Download URL: koumura-0.1.1a1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for koumura-0.1.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 fdccd91db96e3e07cc1de1fb50609e0310a1f13f79de2fa41225036e5de0d1b5
MD5 9348a66e9f9f631796cbc5782f30b93e
BLAKE2b-256 f8a14693b6edb94e8409a2f03d20f560f4df95ba9c5ba9a32997dab9d8dd299e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page