Skip to main content

Anntotate episodic events of videos

Project description

Behavior Annotator

Alt text

Table of contents

Installation

  1. Install Git
  2. In git bash, run
git clone https://github.com/hsingchien/Bannotator.git
  1. In anaconda prompt, go to annotator directory, run
conda env create -f environment.yml
  1. Then activate the environment
conda activate bannotator
  1. Under this environment, go to the bannotator directory, run
python setup.py develop
  1. To open the app, under this environment, run
annotate-behavior

Usage

GUI

Alt text

The GUI layout has 5 major areas.

  • Video display area, where you can add multiple videos.
  • Stream area shows the enlarged portion of the color coded streams.
  • Stream overviews provide the bird's-eye view of the full annotation and the current progress.
  • Behavior table dock where ID, name, keystroke and color are shown in the Behaviors tab; number of epochs and percentage of the time are shown in the Stats tab.
  • Epoch tables where epochs are shown in the All Epochs tab, epochs of selected behaviors are shown in the Behavior Epochs tab.

Video

  • Annotator supports major video formats and the Norpix Streampix seq files. Only uncompressed seq (RAW) or compressed seq in JPEG format are currently supported.

  • Annotator is capable of displaying multiple videos simultaneously, therefore is great for experiments with multiple video streams. If videos have different number of frames, the 1st added video is treated as the main video and the other videos are stretched to the length of the video 1.

  • Annotator provides several different video layouts. Side by side, Stacked or Grid (this option becomes available when number of videos reaches 4).

  • Video can be played at various speed.

Annotation

The annotator is compatible with the format of annotation txt file of Piotr's MATLAB toolbox. If you are a user of the behavior annotator of this toolbox, you can view/edit your existing annotation files as well as keep using your configuration files to create new annotations. The output annotation txt files are also back compatible with Piotr's annotator.

If you do not have configuration files to start with, you can create an new annotation from scratch using New annotaion dialog in the Annotation menu. To enable this option you need to add a video first so that the annotator knows the length of the annotation.

Alt text

First, set the number of streams. In the text editor, input behavior - keystroke pair in each line, parsed by '-' or space. The dialog actively checks the input to ensure the behavior-keystroke pairs are unique. Once created, all the streams will be initialized with the first behavior in your list. Usually the first behavior label is reserved for the blank label of name "other" or "blank", which will be assigned grey color.

Once the new streams are created, go through the video and label the events. Press keystroke to label the current frame as well as the rest of the Epoch.

Epoch is the fundamental unit of the annotation. An Annotation contains Streams which contains a series of Epoch. Each Stream also contains several Behavior objects each one of which stores name, color, keystroke and ID of a user defined behavior. Behavior objects also collects all the Epochs of this kind in its stream.

KeyPress Functions

Space : Play/Pause video

/ : Increase/Decrease playing speed

/ : Previous/Next frame

1 - 0 : Change the current stream to stream 1 - 10

` : Rotate current stream through all streams

-/+ : Move to previous/next epoch of current stream

CTRL-/CTRL+ : Move to previous/next epoch of selected behavior

Contributing

Your contributions are always welcome! Contribution guideline will be available soon.

Acknowledgement

This project is inspired by Piotr's MATLAB toolbox.

Seq file reading is inspired by PIMS.

Random color generator distinctipy

The project is built with PySide6.

License

The MIT License (MIT) 2017 - Xingjian Zhang.

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

bannotator-1.0.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

bannotator-1.0.0-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file bannotator-1.0.0.tar.gz.

File metadata

  • Download URL: bannotator-1.0.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for bannotator-1.0.0.tar.gz
Algorithm Hash digest
SHA256 62e5d5c570ed5486a316dbb14f403fe75ddca8c388c99bf89974e587ff0a8f29
MD5 dac7110ee13c1b6585201704484324c3
BLAKE2b-256 9ce2f2c37d60d63045ad4c12865fab6c771002cf85ce7f2a1b7b68c88bd5d189

See more details on using hashes here.

File details

Details for the file bannotator-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: bannotator-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for bannotator-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8693fa47ff3f2481e34892aabcce27753af55036b850d36af8e5e687c16a420
MD5 5ed66e9ecb24daed25a3e9634bc29a20
BLAKE2b-256 b5677696f1a19d73c0fe220e32303f0f2d93f17a6e2608ee0f9d05aeba257481

See more details on using hashes here.

Supported by

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