Skip to main content

Tooling for agile modeling on large machine perception embedding databases.

Project description

Perch Hoplite

CI

Hoplite is a system for storing large volumes of embeddings from machine perception models. We focus on combining vector search with active learning workflows, aka agile modeling.

While we get this documentation ready, we recommend checking out the main Perch repository, which includes embedding model training code.

This repository consists of four sub-libraries:

  • db - The core database functionality for storing embeddings and related metadata. The database also handles labels applied to embeddings and vector search, both exact and approximate.
  • agile - Tooling (and example notebooks) for agile modeling on top of the Hoplite db layer, combining search and active learning approaches. This library includes organizing labeled data and training linear classifiers over embeddings, as well as tooling for embedding large datasets.
  • zoo - A bioacoustics model zoo. A basic wrapper class is provided, and any model which can transform windows of audio samples into embeddings can then be used in the agile modeling workflow.
  • taxonomy - A database of taxonomic information, especially for handling conversions between the various bird taxonomies.

Each sub-library has its own documentation.

Installation

The repository can be installed with either pip or poetry. Poetry allows more granular management of dependencies.

First, install some basic dependencies. Note that for GPU support, you may install tensorflow[and-cuda] instead of tensorflow-cpu.

sudo apt-get update
sudo apt-get install libsndfile1 ffmpeg
pip install absl-py
pip install requests
# You may skip tensorflow installation if only using the hoplite/db library.
# However, these are required for agile modeling and most models in the zoo.
pip install tensorflow-cpu
pip install tensorflow-hub

Then to install with pip:

pip install git+https://github.com/google-research/perch-hoplite.git

Then run the tests and check that they pass:

python -m unittest discover -s hoplite/db/tests -p "*test.py"
python -m unittest discover -s hoplite/taxonomy -p "*test.py"
python -m unittest discover -s hoplite/zoo -p "*test.py"
python -m unittest discover -s hoplite/agile/tests -p "*test.py"

Or, install with poetry:

# Install Poetry for package management
curl -sSL https://install.python-poetry.org | python3 -

# Install all dependencies specified in the poetry configs.
poetry install

Notes on Dependencies

Machine learning framework libraries are pretty heavy! It can also be difficult to coordinate CUDA versions across multiple frameworks to ensure good GPU behavior. Thus, we provide some ability to select dependencies according to your needs.

Tensorflow is used in the agile library for training linear classifiers. If you do not need the agile library or any of the tensorflow models in the zoo, you may skip installation of tensorflow dependencies with pip. Alternatively, you can use poetry to install without tensorflow like so:

poetry install --without tf

The primary place where multiple frameworks may be needed is in the zoo library, which provides wrappers for various bioacoustic models. To install with JAX (allowing use of some models in the zoo):

poetry install --with jax

Disclaimer

This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.

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

perch_hoplite-0.1.0.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

perch_hoplite-0.1.0-py3-none-any.whl (2.7 MB view details)

Uploaded Python 3

File details

Details for the file perch_hoplite-0.1.0.tar.gz.

File metadata

  • Download URL: perch_hoplite-0.1.0.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for perch_hoplite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf9ca6c442cbeb2b3a478fc80b8258b33db610f73e3f674a3b57fd1092406581
MD5 91b947a610a242379ca210891f070864
BLAKE2b-256 f6f6b19585e1120d52a2394362b64a0f7d9d2082908ccfa942a4c1811c8d38c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for perch_hoplite-0.1.0.tar.gz:

Publisher: publish.yml on google-research/perch-hoplite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file perch_hoplite-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: perch_hoplite-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for perch_hoplite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b1ab5716369313808d43665d1e5e04c638f86b107d9374c28f65ff5a65c2234
MD5 83fdf7afe5c57e801065fde936fdbcdf
BLAKE2b-256 180557ca969f35a50a7b718ac6e7c363d21dd5f60468c7f1db0f3d5a74eceea3

See more details on using hashes here.

Provenance

The following attestation bundles were made for perch_hoplite-0.1.0-py3-none-any.whl:

Publisher: publish.yml on google-research/perch-hoplite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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