This article was automatically translated from Japanese using AI. The Japanese version is the authoritative version.
What is Python Video Annotator?
Python Video Annotator is an application that lets you analyze recorded videos and annotate events within them along a timeline.
Researchers in neuroscience and ethology can use it to record videos of animals and then analyze and quantify their behavior.
For example, suppose you are recording mouse behavior and want to score actions such as sticking out the tongue, wagging the tail, or moving the ears.
When in the video does each action occur, and how long does it last?
Watching the video and logging everything in Excel each time becomes overwhelming once you have defined many behaviors.
With a tool like this, you can record annotations directly on the video and export the timing and event information.
There used to be an open-source application called VCode for recording animal behavior.
The problem, however, was that it no longer runs on current computer operating systems.
Python Video Annotator works on modern PCs and retains the essential features, while also allowing you to combine it with external sensor data (such as pressure gauges) and behavior-quantification tools like DeepLabCut, making it an extremely useful tool for researchers.
How to install
The official website describes the installation procedure in detail, but I could not get it to install properly on my computer. (Installing it directly may have caused conflicts with packages that were already installed.)
So instead I followed the approach described on the GitHub page, building a virtual environment with Anaconda and installing it there.
It sounds complicated when described in words, but the steps are very simple.
As of now (October 20, 2021) it does not appear to support the latest macOS (Big Sur 11.6), though this will probably be fixed soon.
For that reason, I will use Windows as the example here.
That said, on macOS the steps are basically the same once you have installed Anaconda and can use the conda command, so please refer to this guide once support is available. (For details, see my previous post.)
Install Anaconda and open the Anaconda prompt.
Then create a virtual environment and activate it.
conda create -n videoannotator python=3.6
conda activate videoannotator
Next, install the required packages.
pip install opencv-python-headless pyqt5==5.14.1 pyqtwebengine==5.14.0
Then install Python Video Annotator.
pip install python-video-annotator
Once all the processing finishes, the installation is complete.
To launch it, activate the virtual environment first and then run it.
conda activate videoannotator
start-video-annotator
If the software starts up, you are all set.
