bannotator


Namebannotator JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryAnntotate episodic events of videos
upload_time2023-11-20 05:54:41
maintainer
docs_urlNone
author
requires_python>=3.9
licenseMIT License Copyright (c) 2023 Xingjian Zhang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords video annotate gui
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Behavior Annotator

![Alt text](https://github.com/hsingchien/Bannotator/blob/main/src/bannotator/resources/bg_readme.png?raw=true)

# Table of contents

- [Installation](#installation)
- [Usage](#usage)
  - [GUI](#GUI)
  - [Video](#video)
  - [Annotation](#annotation)
  - [KeyPress Functions](#keypress-functions)
- [Contributing](#contributing)
- [Acknowledgement](#acknowledgement)
- [License](#license)

# Installation

1. Install Git
2. In git bash, run

```bash
git clone https://github.com/hsingchien/Bannotator.git
```

3. In anaconda prompt, go to annotator directory, run

```bash
conda env create -f environment.yml
```

4. Then activate the environment

```bash
conda activate bannotator
```

5. Under this environment, go to the bannotator directory, run

```bash
python setup.py develop
```

6. To open the app, under this environment, run

```bash
annotate-behavior
```

# Usage

### GUI

![Alt text](https://github.com/hsingchien/Bannotator/blob/main/src/bannotator/resources/app_illustration.png?raw=true)

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](https://github.com/pdollar/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](https://github.com/hsingchien/Bannotator/blob/main/src/bannotator/resources/new_annotation_dialog.png?raw=true)

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

<kbd>Space</kbd> : Play/Pause video

<kbd>&#8593;</kbd> / <kbd>&#8595;</kbd> : Increase/Decrease playing speed

<kbd>&#8592;</kbd> / <kbd>&#8594;</kbd> : Previous/Next frame

<kbd>1</kbd> - <kbd>0</kbd> : Change the current stream to stream 1 - 10

<kbd>`</kbd> : Rotate current stream through all streams

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

<kbd>CTRL</kbd><kbd>-</kbd>/<kbd>CTRL</kbd><kbd>+</kbd> : 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](https://github.com/pdollar/toolbox).

Seq file reading is inspired by [PIMS](https://github.com/soft-matter/pims).

Random color generator [distinctipy](https://github.com/alan-turing-institute/distinctipy)

The project is built with [PySide6](https://doc.qt.io/qtforpython-6/index.html#).

# License

The MIT License (MIT) 2017 - [Xingjian Zhang](https://github.com/hsingchien/).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "bannotator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "video,annotate,gui",
    "author": "",
    "author_email": "Xingjian Zhang <hsingchien.zhang@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/9c/e2/f2c37d60d63045ad4c12865fab6c771002cf85ce7f2a1b7b68c88bd5d189/bannotator-1.0.0.tar.gz",
    "platform": null,
    "description": "# Behavior Annotator\n\n![Alt text](https://github.com/hsingchien/Bannotator/blob/main/src/bannotator/resources/bg_readme.png?raw=true)\n\n# Table of contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [GUI](#GUI)\n  - [Video](#video)\n  - [Annotation](#annotation)\n  - [KeyPress Functions](#keypress-functions)\n- [Contributing](#contributing)\n- [Acknowledgement](#acknowledgement)\n- [License](#license)\n\n# Installation\n\n1. Install Git\n2. In git bash, run\n\n```bash\ngit clone https://github.com/hsingchien/Bannotator.git\n```\n\n3. In anaconda prompt, go to annotator directory, run\n\n```bash\nconda env create -f environment.yml\n```\n\n4. Then activate the environment\n\n```bash\nconda activate bannotator\n```\n\n5. Under this environment, go to the bannotator directory, run\n\n```bash\npython setup.py develop\n```\n\n6. To open the app, under this environment, run\n\n```bash\nannotate-behavior\n```\n\n# Usage\n\n### GUI\n\n![Alt text](https://github.com/hsingchien/Bannotator/blob/main/src/bannotator/resources/app_illustration.png?raw=true)\n\nThe GUI layout has 5 major areas.\n\n- Video display area, where you can add multiple videos.\n- Stream area shows the enlarged portion of the color coded streams.\n- Stream overviews provide the bird's-eye view of the full annotation and the current progress.\n- 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.\n- Epoch tables where epochs are shown in the All Epochs tab, epochs of selected behaviors are shown in the Behavior Epochs tab.\n\n### Video\n\n- Annotator supports major video formats and the Norpix Streampix seq files. Only uncompressed seq (RAW) or compressed seq in JPEG format are currently supported.\n\n- 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.\n\n- Annotator provides several different video layouts. Side by side, Stacked or Grid (this option becomes available when number of videos reaches 4).\n\n- Video can be played at various speed.\n\n### Annotation\n\nThe annotator is compatible with the format of annotation txt file of [Piotr's MATLAB toolbox](https://github.com/pdollar/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.\n\nIf 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.\n\n![Alt text](https://github.com/hsingchien/Bannotator/blob/main/src/bannotator/resources/new_annotation_dialog.png?raw=true)\n\nFirst, 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.\n\nOnce 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.\n\n`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.\n\n### KeyPress Functions\n\n<kbd>Space</kbd> : Play/Pause video\n\n<kbd>&#8593;</kbd> / <kbd>&#8595;</kbd> : Increase/Decrease playing speed\n\n<kbd>&#8592;</kbd> / <kbd>&#8594;</kbd> : Previous/Next frame\n\n<kbd>1</kbd> - <kbd>0</kbd> : Change the current stream to stream 1 - 10\n\n<kbd>`</kbd> : Rotate current stream through all streams\n\n<kbd>-</kbd>/<kbd>+</kbd> : Move to previous/next epoch of current stream\n\n<kbd>CTRL</kbd><kbd>-</kbd>/<kbd>CTRL</kbd><kbd>+</kbd> : Move to previous/next epoch of selected behavior\n\n# Contributing\n\nYour contributions are always welcome! Contribution guideline will be available soon.\n\n# Acknowledgement\n\nThis project is inspired by [Piotr's MATLAB toolbox](https://github.com/pdollar/toolbox).\n\nSeq file reading is inspired by [PIMS](https://github.com/soft-matter/pims).\n\nRandom color generator [distinctipy](https://github.com/alan-turing-institute/distinctipy)\n\nThe project is built with [PySide6](https://doc.qt.io/qtforpython-6/index.html#).\n\n# License\n\nThe MIT License (MIT) 2017 - [Xingjian Zhang](https://github.com/hsingchien/).\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 Xingjian Zhang  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Anntotate episodic events of videos",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/hsingchien/Bannotator"
    },
    "split_keywords": [
        "video",
        "annotate",
        "gui"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b5677696f1a19d73c0fe220e32303f0f2d93f17a6e2608ee0f9d05aeba257481",
                "md5": "5ed66e9ecb24daed25a3e9634bc29a20",
                "sha256": "e8693fa47ff3f2481e34892aabcce27753af55036b850d36af8e5e687c16a420"
            },
            "downloads": -1,
            "filename": "bannotator-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5ed66e9ecb24daed25a3e9634bc29a20",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 1151672,
            "upload_time": "2023-11-20T05:54:38",
            "upload_time_iso_8601": "2023-11-20T05:54:38.836924Z",
            "url": "https://files.pythonhosted.org/packages/b5/67/7696f1a19d73c0fe220e32303f0f2d93f17a6e2608ee0f9d05aeba257481/bannotator-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9ce2f2c37d60d63045ad4c12865fab6c771002cf85ce7f2a1b7b68c88bd5d189",
                "md5": "dac7110ee13c1b6585201704484324c3",
                "sha256": "62e5d5c570ed5486a316dbb14f403fe75ddca8c388c99bf89974e587ff0a8f29"
            },
            "downloads": -1,
            "filename": "bannotator-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "dac7110ee13c1b6585201704484324c3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 1148649,
            "upload_time": "2023-11-20T05:54:41",
            "upload_time_iso_8601": "2023-11-20T05:54:41.184768Z",
            "url": "https://files.pythonhosted.org/packages/9c/e2/f2c37d60d63045ad4c12865fab6c771002cf85ce7f2a1b7b68c88bd5d189/bannotator-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-20 05:54:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hsingchien",
    "github_project": "Bannotator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bannotator"
}
        
Elapsed time: 0.16770s