Metadata-Version: 2.3
Name: beast-backbones
Version: 1.1.0
Summary: Behavioral analysis via self-supervised pretraining of transformers
License: MIT
Keywords: machine learning,deep learning,computer_vision
Author: Yanchen Wang
Requires-Python: >=3.10
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Image Processing
Provides-Extra: dev
Requires-Dist: flake8-pyproject ; extra == "dev"
Requires-Dist: imgaug
Requires-Dist: isort ; extra == "dev"
Requires-Dist: jaxtyping
Requires-Dist: lightning
Requires-Dist: numpy (<2.0.0)
Requires-Dist: opencv-python-headless
Requires-Dist: pillow
Requires-Dist: pytest ; extra == "dev"
Requires-Dist: pytest-html ; extra == "dev"
Requires-Dist: requests ; extra == "dev"
Requires-Dist: scikit-learn
Requires-Dist: tensorboard
Requires-Dist: torchvision
Requires-Dist: tqdm
Requires-Dist: transformers
Requires-Dist: typeguard (==2.13.3)
Project-URL: Documentation, https://github.com/paninski-lab/beast
Project-URL: Repository, https://github.com/paninski-lab/beast
Description-Content-Type: text/markdown

# beast

![GitHub](https://img.shields.io/github/license/paninski-lab/beast)
![PyPI](https://img.shields.io/pypi/v/py-beast)

**Be**havioral **a**nalysis via **s**elf-supervised pretraining of **t**ransformers

`beast` is a package for pretraining vision transformers on unlabeled data to provide backbones 
for downstream tasks like pose estimation, action segmentation, and neural encoding.

## Installation

### Step 1: Install ffmpeg
First, check to see if you have ffmpeg installed by typing the following in the terminal:

```commandline
ffmpeg -version
```

If not, install:

```commandline
sudo apt install ffmpeg
```

### Step 2: Create a conda environment

First, [install anaconda](https://docs.anaconda.com/free/anaconda/install/index.html).

Next, create and activate a conda environment:

```commandline
conda create --yes --name beast python=3.10
conda activate beast
```

### Step 3: Download the repo from github and install
Move to your home directory (or wherever you would like to download the code) and install:

```commandline
cd ~
git clone https://github.com/paninski-lab/beast
cd beast
pip install -e .
```

## Usage

`beast` comes with a simple command line interface. To get more information, run
```commandline
beast -h
```

### Extract frames

Extract frames from a directory of videos to train `beast` with.

```commandline
beast extract --input <video_dir> --output <output_dir> [options]
```

Type "beast extract -h" in the terminal for details on the options.

### Train a model

You will need to specify a config path; see the `configs` directory for examples.

```commandline
beast train --config <config_path> [options]
```

Type "beast train -h" in the terminal for details on the options.

### Run inference

Inference on a single video or a directory of videos: 

```commandline
beast predict --model <model_dir> --input <video_path> [options]
```

Inference on (possibly nested) directories of images: 

```commandline
beast predict --model <model_dir> --input <video_path> [options]
```

Type "beast predict -h" in the terminal for details on the options.

