Functions for working with this data repository: https://figshare.com/articles/BirdsongRecognition/3470165
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.
The code for the network can be found here:
The original code was released under the GNU license:
koumura because that's the last name of the first author
on the paper, and because I am too lazy to type
$ pip install koumura
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,
>>> from koumura import parse_xml >>> seq_list = parse_xml(xml_file='./Bird0/Annotation.xml', concat_seqs_into_songs=False) >>> seq_list Sequence from 0.wav with position 32000 and length 43168 >>> seq_list.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
Importantly, each song is broken up into a number of "sequences". You can set the flag
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
package, which converts this annotation format and others to a
tidy comma-separated value format.
koumura package also provides a convenience function to load the annotation
for an individual song,
load_song_annot. This is basically a wrapper
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
Please feel free to raise an issue here:
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size koumura-0.1.1a1-py3-none-any.whl (9.6 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size koumura-0.1.1a1.tar.gz (10.7 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for koumura-0.1.1a1-py3-none-any.whl