Birdwatcher is a Python computer vision library for analyzing animal behavior in a Python scientific computing environment.
Birdwatcher should help you getting up and running quickly when building analysis code or tools for specific measurements. It provides functionality that is common in video analysis, such as reading and writing videos into and from numpy arrays, applying processing algorithms such as background subtraction, morphological transformation, resizing, drawing on frames etc. Much of the underlying video and image processing is based on FFmpeg and OpenCV, but Birdwatcher is easier to use for many tasks because its higher-level implementation of functionality.
In addition to video analysis tools, Birdwatcher has high-level functions for behavioral analysis based on such tools, although currently these are limited to movement/location detection of single animals.
Despite its name, Birdwatcher is not only for birds. We also successfully analyzed dog behavior, and it could be used on anything that moves. It is being used in our lab but still under heavy development, and should be considered alpha software.
Code can be found on GitHub: https://github.com/gbeckers/Birdwatcher .
Documentation can be found at https://birdwatcher.readthedocs.io .
It is developed by Gabriel Beckers and Carien Mol, at Experimental Psychology, Utrecht University. It is open source, freely available under the New BSD License terms.
Birdwatcher officially supports Python 3.9 or higher, but older Python 3 versions may also work.
User installation
We recommend using Anaconda for installation. Install Anaconda from https://www.anaconda.com/ .
Open Anaconda prompt in terminal.
Create new environment for Birdwatcher (name is up to you, in example here 'mybirdwatcher'). We install Jupyter lab and ffmpeg at the same time:
$ conda create -n mybirdwatcher python=3.9 jupyterlab ffmpeg git
Switch to this new environment:
Linux and MacOS:
$ source activate mybirdwatcher
Windows:
$ conda activate mybirdwatcher
Install Birdwatcher:
Stable latest official release from PyPi:
$ pip install Birdwatcher
If instead you want the latest version of the git master branch from, use:
$ pip install git+https://github.com/gbeckers/birdwatcher@master
Dependencies
The following dependencies are automatically taken care of when you install Birdwatcher using the pip method above:
- numpy
- pandas
- matplotlib
- seaborn
- darr
- opencv-python
- opencv-contrib-python
It further depends on:
- ffmpeg (including ffprobe)
If you do not use the conda way above to install ffmpeg, you need to install it yourself (https://www.ffmpeg.org/).
To quickly learn the fundamentals of Birdwatcher, please walk through our notebooks. First, you need to download the notebooks and example videos from github. Then, navigate to the directory of the notebooks and activate the 'mybirdwatcher' environment. Type jupyter lab which opens in your browser. You can now open the notebooks and run the tutorial.
To run the test suite:
>>>import birdwatcher as bw
>>>bw.test()
..................................................
----------------------------------------------------------------------
Ran 50 tests in 75.858s
OK
<unittest.runner.TextTestResult run=50 errors=0 failures=0>
https://birdwatcher.readthedocs.io
See jupyter notebook directory.
Sita ter Haar and Dylan Minekus helped exploring the application of movement detection algorithms.