Zoo Plugin#

A plugin that contains utilities for working with the FiftyOne Dataset Zoo and FiftyOne Model Zoo.

Installation#

fiftyone plugins download \
    https://github.com/voxel51/fiftyone-plugins \
    --plugin-names @voxel51/zoo

Refer to the main README for more information about managing downloaded plugins and developing plugins locally.

Configuration#

You can optionally configure which license(s) models and datasets must be distributed under in order to be made available by this plugin’s operators by setting the following plugin secrets:

export FIFTYONE_ZOO_ALLOWED_MODEL_LICENSES="MIT,Apache 2.0"
export FIFTYONE_ZOO_ALLOWED_DATASET_LICENSES="CC-BY-SA-3.0,CC-BY-4.0"

Run the following commands to see the available models/datasets and their licenses:

fiftyone zoo models list
fiftyone zoo datasets list

You can also provide a specific list of models and datasets that should be made available by this plugin’s operators by setting the following plugin secrets:

export FIFTYONE_ZOO_ALLOWED_MODEL_NAMES="clip-vit-base32-torch,zero-shot-classification-transformer-torch"
export FIFTYONE_ZOO_ALLOWED_DATASET_NAMES="quickstart,coco-2017"

Usage#

  1. Launch the App:

import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("quickstart")
session = fo.launch_app(dataset)
  1. Press ` or click the Browse operations action to open the Operators list

  2. Select any of the operators listed below!

Operators#

load_zoo_dataset#

You can use this operator to download any dataset from the FiftyOne Dataset Zoo.

This operator is essentially a wrapper around the load_zoo_dataset() method:

dataset = foz.load_zoo_dataset(name, splits=splits, ...)

where the operator’s form allows you to choose a dataset and provide any applicable optional arguments for load_zoo_dataset().

apply_zoo_model#

You can use this operator to download and run inference with any model from the FiftyOne Model Zoo.

This operator is essentially a wrapper around the load_zoo_model(), apply_model(), compute_embeddings(), and compute_patch_embeddings() methods:

model = foz.load_zoo_model(name)

# Predictions
dataset_or_view.apply_model(
    model,
    label_field=label_field,
    ...,
)

# Embeddings
dataset_or_view.compute_embeddings(
    model,
    embeddings_field=embeddings_field,
    ...
)

# Patch embeddings
dataset_or_view.compute_patch_embeddings(
    model,
    patches_field,
    embeddings_field=embeddings_field,
    ...
)

where the operator’s form allows you to choose a model, an inference type (predictions or embeddings, if applicable), a field in which to store the inference results, and provide any applicable optional arguments.