BAT is an open-source, web-based tool for the manual annotation of events in audio recordings developed at BMAT. It was developed in the context of a PhD and right now it is maintained by its author in his free time. By no means is it a professional tool.
- It provides an easy way to annotate the salience of simultaneous sound sources.
- It allows to define multiple ontologies to adapt to multiple tasks.
- It offers the possibility to cross-annotate audio data.
- It is easy to install and deploy on servers.
-
Install docker and docker-compose. For the details on docker installation you can use the official documentation guide
-
Clone the master branch of this repository.
-
Create file named .env in the project root (near the docker-compose.yml file) with the following text:
DJANGO_SETTINGS_MODULE=config.settings.local POSTGRES_PASSWORD=change_this_password POSTGRES_USER=change_this_user DJANGO_SECRET_KEY=insert_a_long_string_with_ascii_chars
-
Stop the postgresql service on your computer (if it exists).
$ sudo service postgresql stop
-
Build BAT.
$ (sudo) docker-compose build
-
Now you can add an admin user.
$ (sudo) docker-compose run django python manage.py createsuperuser
-
Run BAT locally or on a server.
$ (sudo) docker-compose up
-
Open http://localhost:8003/annotation_tool/ or http://<your_server>:8003/annotation_tool/ in your browser. You can change the port in docker-compose.yml.
-
To close BAT, open a new terminal, go to the directory of the repository and type:
$ (sudo) docker-compose down
-
To access the database using the DJANGO shell: (to close it use 9.)
$ (sudo) docker-compose run django python manage.py shell
-
To log into the postgresql database:
$ (sudo) docker ps -a # identify which is the postgresql container $ (sudo) docker exec -i <container ID> psql -U bat_admin -p 5432
-
As the admin you can create projects, define classes and upload wavs to projects. First of all create the set of classes that you want to annotate with. To do so go to "Classes" and click on "Add Class".
-
Once the classes are defined you need to create the project. Projects are usually named after the type of events that we want to annotate (instrument sounds, chords, everyday life sounds, etc.). To create one, go to "Projects" and click "Add Project". Name it, pick the classes you want to use and choose whether or not events can overlap for your particular annotation task.
-
The third step is to upload the audio data that you want to annotate in the "upload data page". BAT works with segments, so you will have to enter a value in the segment length field. If you write -1, the whole duration of the audio file will be used as the segment length. Right now BAT accepts only wav files.
-
Your project is ready. Create an annotator account and start annotating!
-
To annotate, create an annotator user, log in, go to the "new anotation page", and select a project. You will be automatically redirected to the "annotation page".
-
The annotation has two phases: the event identification and the salience assigning pahses.
-
In the event identification you create regions containing events that are of interest to the project's task by clicking and dragging over the waveform. Assign a class to these regions using the labels under the waveform or the keyboard shortcuts. Remember that you can also add tags to these regions.
-
If your project allows overlaps, some of the created regions might overlap. To finish the annotation you need to solve these overlaps, which means assigning how salient is each of the overlapping classes: first, click on the "solve overlaps" button. You will see that new regions, click on the label of those with more than one class to assign their salience.
-
Annotation is finished! Click on either "finish annotation" or "finish annotation and load next"
- From the CrowdCurio project (https://github.com/CrowdCurio/audio-annotator): extended versions of wavesurfer.js and regions.js plugins.