<!-- # hard line break macro for HTML -->

# fiftyone.zoo.models

* [fiftyone.zoo.models.torch](fiftyone.zoo.models.torch.md)
  * [`TorchvisionImageModelConfig`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig)
    * [`TorchvisionImageModelConfig.attributes()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.attributes)
    * [`TorchvisionImageModelConfig.builder()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.builder)
    * [`TorchvisionImageModelConfig.copy()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.copy)
    * [`TorchvisionImageModelConfig.custom_attributes()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.custom_attributes)
    * [`TorchvisionImageModelConfig.default()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.default)
    * [`TorchvisionImageModelConfig.download_model_if_necessary()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.download_model_if_necessary)
    * [`TorchvisionImageModelConfig.from_dict()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.from_dict)
    * [`TorchvisionImageModelConfig.from_json()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.from_json)
    * [`TorchvisionImageModelConfig.from_kwargs()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.from_kwargs)
    * [`TorchvisionImageModelConfig.from_str()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.from_str)
    * [`TorchvisionImageModelConfig.get_class_name()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.get_class_name)
    * [`TorchvisionImageModelConfig.init()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.init)
    * [`TorchvisionImageModelConfig.load_default()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.load_default)
    * [`TorchvisionImageModelConfig.parse_array()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_array)
    * [`TorchvisionImageModelConfig.parse_bool()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_bool)
    * [`TorchvisionImageModelConfig.parse_categorical()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_categorical)
    * [`TorchvisionImageModelConfig.parse_dict()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_dict)
    * [`TorchvisionImageModelConfig.parse_int()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_int)
    * [`TorchvisionImageModelConfig.parse_mutually_exclusive_fields()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_mutually_exclusive_fields)
    * [`TorchvisionImageModelConfig.parse_number()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_number)
    * [`TorchvisionImageModelConfig.parse_object()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_object)
    * [`TorchvisionImageModelConfig.parse_object_array()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_object_array)
    * [`TorchvisionImageModelConfig.parse_object_dict()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_object_dict)
    * [`TorchvisionImageModelConfig.parse_path()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_path)
    * [`TorchvisionImageModelConfig.parse_raw()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_raw)
    * [`TorchvisionImageModelConfig.parse_string()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.parse_string)
    * [`TorchvisionImageModelConfig.serialize()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.serialize)
    * [`TorchvisionImageModelConfig.to_str()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.to_str)
    * [`TorchvisionImageModelConfig.validate_all_or_nothing_fields()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.validate_all_or_nothing_fields)
    * [`TorchvisionImageModelConfig.write_json()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModelConfig.write_json)
  * [`TorchvisionImageModel`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel)
    * [`TorchvisionImageModel.build_get_item()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.build_get_item)
    * [`TorchvisionImageModel.can_embed_prompts`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.can_embed_prompts)
    * [`TorchvisionImageModel.classes`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.classes)
    * [`TorchvisionImageModel.collate_fn()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.collate_fn)
    * [`TorchvisionImageModel.device`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.device)
    * [`TorchvisionImageModel.embed()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.embed)
    * [`TorchvisionImageModel.embed_all()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.embed_all)
    * [`TorchvisionImageModel.from_config()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.from_config)
    * [`TorchvisionImageModel.from_dict()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.from_dict)
    * [`TorchvisionImageModel.from_json()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.from_json)
    * [`TorchvisionImageModel.from_kwargs()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.from_kwargs)
    * [`TorchvisionImageModel.get_embeddings()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.get_embeddings)
    * [`TorchvisionImageModel.has_collate_fn`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.has_collate_fn)
    * [`TorchvisionImageModel.has_embeddings`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.has_embeddings)
    * [`TorchvisionImageModel.has_logits`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.has_logits)
    * [`TorchvisionImageModel.mask_targets`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.mask_targets)
    * [`TorchvisionImageModel.media_type`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.media_type)
    * [`TorchvisionImageModel.num_classes`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.num_classes)
    * [`TorchvisionImageModel.parse()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.parse)
    * [`TorchvisionImageModel.predict()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.predict)
    * [`TorchvisionImageModel.predict_all()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.predict_all)
    * [`TorchvisionImageModel.preprocess`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.preprocess)
    * [`TorchvisionImageModel.ragged_batches`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.ragged_batches)
    * [`TorchvisionImageModel.required_keys`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.required_keys)
    * [`TorchvisionImageModel.skeleton`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.skeleton)
    * [`TorchvisionImageModel.store_logits`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.store_logits)
    * [`TorchvisionImageModel.transforms`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.transforms)
    * [`TorchvisionImageModel.using_gpu`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.using_gpu)
    * [`TorchvisionImageModel.using_half_precision`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.using_half_precision)
    * [`TorchvisionImageModel.validate()`](fiftyone.zoo.models.torch.md#fiftyone.zoo.models.torch.TorchvisionImageModel.validate)

## Module contents

The FiftyOne Model Zoo.

Copyright 2017-2026, Voxel51, Inc.
<br/>
[voxel51.com](https://voxel51.com/)
<br/>
<br/>

**Functions:**

| [`list_zoo_models`](#fiftyone.zoo.models.list_zoo_models)([tags, source, license])                   | Returns the list of available models in the FiftyOne Model Zoo.                               |
|------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| [`list_downloaded_zoo_models`](#fiftyone.zoo.models.list_downloaded_zoo_models)()                    | Returns information about the zoo models that have been downloaded.                           |
| [`is_zoo_model_downloaded`](#fiftyone.zoo.models.is_zoo_model_downloaded)(name)                      | Determines whether the zoo model of the given name is downloaded.                             |
| [`download_zoo_model`](#fiftyone.zoo.models.download_zoo_model)(name_or_url[, ...])                  | Downloads the specified model from the FiftyOne Model Zoo.                                    |
| [`install_zoo_model_requirements`](#fiftyone.zoo.models.install_zoo_model_requirements)(name[, ...]) | Installs any package requirements for the specified zoo model.                                |
| [`ensure_zoo_model_requirements`](#fiftyone.zoo.models.ensure_zoo_model_requirements)(name[, ...])   | Ensures that the package requirements for the specified zoo model are satisfied.              |
| [`load_zoo_model`](#fiftyone.zoo.models.load_zoo_model)(name_or_url[, model_name, ...])              | Loads the specified model from the FiftyOne Model Zoo.                                        |
| [`find_zoo_model`](#fiftyone.zoo.models.find_zoo_model)(name)                                        | Returns the path to the zoo model on disk.                                                    |
| [`get_zoo_model`](#fiftyone.zoo.models.get_zoo_model)(name)                                          | Returns the [`ZooModel`](#fiftyone.zoo.models.ZooModel) instance for the specified zoo model. |
| [`delete_zoo_model`](#fiftyone.zoo.models.delete_zoo_model)(name)                                    | Deletes the zoo model from local disk, if necessary.                                          |
| [`list_zoo_model_sources`](#fiftyone.zoo.models.list_zoo_model_sources)()                            | Returns the list of remote model sources that are registered locally.                         |
| [`register_zoo_model_source`](#fiftyone.zoo.models.register_zoo_model_source)(url_or_gh_repo[, ...]) | Registers a remote source of models, if necessary.                                            |
| [`delete_zoo_model_source`](#fiftyone.zoo.models.delete_zoo_model_source)(url_or_gh_repo)            | Deletes the specified remote source and all downloaded models associated with it.             |

**Classes:**

| [`HasZooModel`](#fiftyone.zoo.models.HasZooModel)()                                            | Mixin class for Config classes of [`fiftyone.core.models.Model`](fiftyone.core.models.md#fiftyone.core.models.Model) instances whose models are stored in the FiftyOne Model Zoo.   |
|------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`ZooModel`](#fiftyone.zoo.models.ZooModel)(base_name[, base_filename, subdir, ...])           | Class describing a model in the FiftyOne Model Zoo.                                                                                                                                 |
| [`RemoteZooModel`](#fiftyone.zoo.models.RemoteZooModel)(\*args, \*\*kwargs)                    |                                                                                                                                                                                     |
| [`RemoteModelManagerConfig`](#fiftyone.zoo.models.RemoteModelManagerConfig)(d)                 |                                                                                                                                                                                     |
| [`RemoteModelManager`](#fiftyone.zoo.models.RemoteModelManager)(config)                        |                                                                                                                                                                                     |
| [`ZooModelsManifest`](#fiftyone.zoo.models.ZooModelsManifest)([models, name, url])             | Class that describes the collection of models in the FiftyOne Model Zoo.                                                                                                            |
| [`RemoteZooModelsManifest`](#fiftyone.zoo.models.RemoteZooModelsManifest)([models, name, url]) | Class that describes the collection of remotely-sourced models in the FiftyOne Model Zoo.                                                                                           |

### fiftyone.zoo.models.list_zoo_models(tags=None, source=None, license=None)

Returns the list of available models in the FiftyOne Model Zoo.

Also includes models from any remote sources that you’ve registered.

Example usage:

```default
import fiftyone as fo
import fiftyone.zoo as foz

#
# List all zoo models
#

names = foz.list_zoo_models()
print(names)

#
# List all zoo models with the specified tag(s)
#

names = foz.list_zoo_models(tags="torch")
print(names)
```

* **Parameters:**
  * **tags** (*None*) – only include models that have the specified tag or list
    of tags
  * **source** (*None*) – only include models available via the given remote
    source
  * **license** (*None*) – only include models that are distributed under the
    specified license or any of the specified list of licenses. Run
    `fiftyone zoo models list` to see the available licenses
* **Returns:**
  a list of model names

### fiftyone.zoo.models.list_downloaded_zoo_models()

Returns information about the zoo models that have been downloaded.

* **Returns:**
  a dict mapping model names to (model path, [`ZooModel`](#fiftyone.zoo.models.ZooModel)) tuples

### fiftyone.zoo.models.is_zoo_model_downloaded(name)

Determines whether the zoo model of the given name is downloaded.

* **Parameters:**
  **name** – the name of the zoo model, which can have `@<ver>` appended to
  refer to a specific version of the model
* **Returns:**
  True/False

### fiftyone.zoo.models.download_zoo_model(name_or_url, model_name=None, overwrite=False)

Downloads the specified model from the FiftyOne Model Zoo.

If the model is already downloaded, it is not re-downloaded unless
`overwrite == True` is specified.

#### NOTE
To download from a private GitHub repository that you have access to,
provide your GitHub personal access token by setting the
`GITHUB_TOKEN` environment variable.

* **Parameters:**
  * **name_or_url** – 

    the name of the zoo model to download, which can have
    `@<ver>` appended to refer to a specific version of the model, or
    the remote source to download it from, which can be:
    - a GitHub repo URL like `https://github.com/<user>/<repo>`
    - a GitHub ref like
      `https://github.com/<user>/<repo>/tree/<branch>` or
      `https://github.com/<user>/<repo>/commit/<commit>`
    - a GitHub ref string like `<user>/<repo>[/<ref>]`
    - a publicly accessible URL of an archive (eg zip or tar) file
  * **model_name** (*None*) – the specific model to download, if `name_or_url`
    is a remote source
  * **overwrite** (*False*) – whether to overwrite any existing files
* **Returns:**
  tuple of
  - model: the [`ZooModel`](#fiftyone.zoo.models.ZooModel) for the model
  - model_path: the path to the downloaded model on disk

### fiftyone.zoo.models.install_zoo_model_requirements(name, error_level=None)

Installs any package requirements for the specified zoo model.

* **Parameters:**
  * **name** – the name of the zoo model, which can have `@<ver>` appended to
    refer to a specific version of the model
  * **error_level** (*None*) – 

    the error level to use, defined as:
    - 0: raise error if a requirement install fails
    - 1: log warning if a requirement install fails
    - 2: ignore install fails requirements

    By default, `fo.config.requirement_error_level` is used

### fiftyone.zoo.models.ensure_zoo_model_requirements(name, error_level=None, log_success=True)

Ensures that the package requirements for the specified zoo model are
satisfied.

* **Parameters:**
  * **name** – the name of the zoo model, which can have `@<ver>` appended to
    refer to a specific version of the model
  * **error_level** (*None*) – 

    the error level to use when installing/ensuring
    requirements, defined as:
    - 0: raise error if a requirement is not satisfied
    - 1: log warning if a requirement is not satisfied
    - 2: ignore unsatisfied requirements

    By default, `fo.config.requirement_error_level` is used
  * **log_success** (*True*) – whether to generate a log message when a
    requirement is satisfied

### fiftyone.zoo.models.load_zoo_model(name_or_url, model_name=None, download_if_necessary=True, ensure_requirements=True, install_requirements=False, error_level=None, cache=True, \*\*kwargs)

Loads the specified model from the FiftyOne Model Zoo.

By default, the model will be downloaded if necessary, and any documented
package requirements will be checked to ensure that they are installed.

#### NOTE
To download from a private GitHub repository that you have access to,
provide your GitHub personal access token by setting the
`GITHUB_TOKEN` environment variable.

* **Parameters:**
  * **name_or_url** – 

    the name of the zoo model to load, which can have
    `@<ver>` appended to refer to a specific version of the model, or
    the remote source to load it from, which can be:
    - a GitHub repo URL like `https://github.com/<user>/<repo>`
    - a GitHub ref like
      `https://github.com/<user>/<repo>/tree/<branch>` or
      `https://github.com/<user>/<repo>/commit/<commit>`
    - a GitHub ref string like `<user>/<repo>[/<ref>]`
    - a publicly accessible URL of an archive (eg zip or tar) file
  * **model_name** (*None*) – the specific model to load, if `name_or_url` is a
    remote source
  * **download_if_necessary** (*True*) – whether to download the model if
    necessary
  * **ensure_requirements** (*True*) – whether to ensure any requirements are
    installed before loading the model
  * **install_requirements** (*False*) – whether to install any requirements
    before loading the model
  * **error_level** (*None*) – 

    the error level to use when installing/ensuring
    requirements, defined as:
    - 0: raise error if a requirement is not satisfied
    - 1: log warning if a requirement is not satisfied
    - 2: ignore unsatisfied requirements

    By default, `fo.config.requirement_error_level` is used
  * **cache** (*True*) – whether to store a weak reference to the model so that
    running this method again will return the same instance while the
    model is still in use
  * **\*\*kwargs** – keyword arguments to inject into the model’s `Config`
    instance
* **Returns:**
  a [`fiftyone.core.models.Model`](fiftyone.core.models.md#fiftyone.core.models.Model)

### fiftyone.zoo.models.find_zoo_model(name)

Returns the path to the zoo model on disk.

The model must be downloaded. Use [`download_zoo_model()`](#fiftyone.zoo.models.download_zoo_model) to download
models.

* **Parameters:**
  **name** – the name of the zoo model, which can have `@<ver>` appended to
  refer to a specific version of the model
* **Returns:**
  the path to the model on disk
* **Raises:**
  **ValueError** – if the model does not exist or has not been downloaded

### fiftyone.zoo.models.get_zoo_model(name)

Returns the [`ZooModel`](#fiftyone.zoo.models.ZooModel) instance for the specified zoo model.

* **Parameters:**
  **name** – the name of the zoo model, which can have `@<ver>` appended to
  refer to a specific version of the model
* **Returns:**
  a [`ZooModel`](#fiftyone.zoo.models.ZooModel)

### fiftyone.zoo.models.delete_zoo_model(name)

Deletes the zoo model from local disk, if necessary.

* **Parameters:**
  **name** – the name of the zoo model, which can have `@<ver>` appended to
  refer to a specific version of the model

### fiftyone.zoo.models.list_zoo_model_sources()

Returns the list of remote model sources that are registered locally.

* **Returns:**
  the list of remote sources

### fiftyone.zoo.models.register_zoo_model_source(url_or_gh_repo, overwrite=False)

Registers a remote source of models, if necessary.

#### NOTE
To download from a private GitHub repository that you have access to,
provide your GitHub personal access token by setting the
`GITHUB_TOKEN` environment variable.

* **Parameters:**
  * **url_or_gh_repo** – 

    the remote source to register, which can be:
    - a GitHub repo URL like `https://github.com/<user>/<repo>`
    - a GitHub ref like
      `https://github.com/<user>/<repo>/tree/<branch>` or
      `https://github.com/<user>/<repo>/commit/<commit>`
    - a GitHub ref string like `<user>/<repo>[/<ref>]`
    - a publicly accessible URL of an archive (eg zip or tar) file
  * **overwrite** (*False*) – whether to overwrite any existing files

### fiftyone.zoo.models.delete_zoo_model_source(url_or_gh_repo)

Deletes the specified remote source and all downloaded models associated
with it.

* **Parameters:**
  **url_or_gh_repo** – 

  the remote source to delete, which can be:
  - a GitHub repo URL like `https://github.com/<user>/<repo>`
  - a GitHub ref like
    `https://github.com/<user>/<repo>/tree/<branch>` or
    `https://github.com/<user>/<repo>/commit/<commit>`
  - a GitHub ref string like `<user>/<repo>[/<ref>]`
  - a publicly accessible URL of an archive (eg zip or tar) file

### *class* fiftyone.zoo.models.HasZooModel

Bases: `HasPublishedModel`

Mixin class for Config classes of [`fiftyone.core.models.Model`](fiftyone.core.models.md#fiftyone.core.models.Model)
instances whose models are stored in the FiftyOne Model Zoo.

This class provides the following functionality:

- The model to load can be specified either by:
  1. providing a `model_name`, which specifies the zoo model to load.
     The model will be downloaded, if necessary
  2. providing a `model_path`, which directly specifies the path to the
     model to load
- [`fiftyone.core.models.ModelConfig`](fiftyone.core.models.md#fiftyone.core.models.ModelConfig) definitions that use zoo
  models with default deployments will have default values for any
  unspecified parameters loaded and applied at runtime

* **Parameters:**
  * **model_name** – the name of the zoo model to load. If this value is
    provided, `model_path` does not need to be
  * **model_path** – the path to an already downloaded zoo model on disk to
    load. If this value is provided, `model_name` does not need to be

**Methods:**

| [`download_model_if_necessary`](#fiftyone.zoo.models.HasZooModel.download_model_if_necessary)()   | Downloads the published model specified by the config, if necessary.   |
|---------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [`init`](#fiftyone.zoo.models.HasZooModel.init)(d)                                                | Initializes the published model config.                                |

#### download_model_if_necessary()

Downloads the published model specified by the config, if necessary.

After this method is called, the `model_path` attribute will always
contain the path to the model on disk.

#### init(d)

Initializes the published model config.

This method should be called by `ModelConfig.__init__()`, and it
performs the following tasks:

- Parses the `model_name` and `model_path` parameters
- Populates any default parameters in the provided ModelConfig dict

* **Parameters:**
  **d** – a ModelConfig dict
* **Returns:**
  a ModelConfig dict with any default parameters populated

### *class* fiftyone.zoo.models.ZooModel(base_name, base_filename=None, subdir=None, manager=None, author=None, version=None, url=None, source=None, license=None, description=None, size_bytes=None, default_deployment_config_dict=None, requirements=None, tags=None, date_added=None, training_data=None)

Bases: `Model`

Class describing a model in the FiftyOne Model Zoo.

* **Parameters:**
  * **base_name** – the base name of the model (no version info)
  * **base_filename** (*None*) – the base filename or directory of the model
    (no version info), if applicable
  * **author** (*None*) – the author of the model
  * **version** (*None*) – the version of the model
  * **url** (*None*) – the URL at which the model is hosted
  * **license** (*None*) – the license under which the model is distributed
  * **source** (*None*) – the source of the model
  * **description** (*None*) – the description of the model
  * **tags** (*None*) – a list of tags for the model
  * **size_bytes** (*None*) – the size of the model on disk
  * **date_added** (*None*) – the datetime that the model was added to the zoo
  * **requirements** (*None*) – the `eta.core.models.ModelRequirements` for the
    model
  * **manager** (*None*) – the [`fiftyone.core.models.ModelManager`](fiftyone.core.models.md#fiftyone.core.models.ModelManager) instance
    that describes the remote storage location of the model, if
    applicable
  * **default_deployment_config_dict** (*None*) – a
    [`fiftyone.core.models.ModelConfig`](fiftyone.core.models.md#fiftyone.core.models.ModelConfig) dict describing the
    recommended settings for deploying the model
  * **training_data** (*None*) – the training data information for the model, if applicable

**Methods:**

| [`attributes`](#fiftyone.zoo.models.ZooModel.attributes)()                                             | Returns a list of class attributes to be serialized.                         |
|--------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| [`copy`](#fiftyone.zoo.models.ZooModel.copy)()                                                         | Returns a deep copy of the object.                                           |
| [`custom_attributes`](#fiftyone.zoo.models.ZooModel.custom_attributes)([dynamic, private])             | Returns a customizable list of class attributes.                             |
| [`download_model`](#fiftyone.zoo.models.ZooModel.download_model)(model_path[, force])                  | Downloads the model to the given local path.                                 |
| [`ensure_requirements`](#fiftyone.zoo.models.ZooModel.ensure_requirements)([error_level, log_success]) | Ensures that any requirement(s) for this model are satisfied.                |
| [`flush_model`](#fiftyone.zoo.models.ZooModel.flush_model)(model_path)                                 | Flushes the copy of the model at the given local path, if necessary.         |
| [`flush_model_from_dir`](#fiftyone.zoo.models.ZooModel.flush_model_from_dir)(models_dir)               | Flushes the copy of the model in the given models directory, if necessary.   |
| [`from_dict`](#fiftyone.zoo.models.ZooModel.from_dict)(d[, subdir])                                    | Constructs a Model from a JSON dictionary.                                   |
| [`from_json`](#fiftyone.zoo.models.ZooModel.from_json)(path, \*args, \*\*kwargs)                       | Constructs a Serializable object from a JSON file.                           |
| [`from_str`](#fiftyone.zoo.models.ZooModel.from_str)(s, \*args, \*\*kwargs)                            | Constructs a Serializable object from a JSON string.                         |
| [`get_class_name`](#fiftyone.zoo.models.ZooModel.get_class_name)()                                     | Returns the fully-qualified class name string of this object.                |
| [`get_path_in_dir`](#fiftyone.zoo.models.ZooModel.get_path_in_dir)(models_dir)                         | Gets the model path for the model in the given models directory.             |
| [`has_tag`](#fiftyone.zoo.models.ZooModel.has_tag)(tag)                                                | Whether this model has the given tag.                                        |
| [`has_version_str`](#fiftyone.zoo.models.ZooModel.has_version_str)(name)                               | Determines whether the given model name has a version string.                |
| [`install_requirements`](#fiftyone.zoo.models.ZooModel.install_requirements)([error_level])            | Installs any necessary requirement(s) for this model.                        |
| [`is_in_dir`](#fiftyone.zoo.models.ZooModel.is_in_dir)(models_dir)                                     | Determines whether a copy of the model exists in the given models directory. |
| [`is_model_downloaded`](#fiftyone.zoo.models.ZooModel.is_model_downloaded)(model_path)                 | Determines whether the model is downloaded to the given location.            |
| [`parse_name`](#fiftyone.zoo.models.ZooModel.parse_name)(name)                                         | Parses the model name, returning the base name and the version, if any.      |
| [`serialize`](#fiftyone.zoo.models.ZooModel.serialize)([reflective])                                   | Serializes the object into a dictionary.                                     |
| [`to_str`](#fiftyone.zoo.models.ZooModel.to_str)([pretty_print])                                       | Returns a string representation of this object.                              |
| [`write_json`](#fiftyone.zoo.models.ZooModel.write_json)(path[, pretty_print])                         | Serializes the object and writes it to disk.                                 |

**Attributes:**

| [`comp_version`](#fiftyone.zoo.models.ZooModel.comp_version)         | The version of this model expressed as a `distutils.version.LooseVersion` intended for comparison operations.   |
|----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| [`filename`](#fiftyone.zoo.models.ZooModel.filename)                 | The version-aware filename of the model.                                                                        |
| [`has_manager`](#fiftyone.zoo.models.ZooModel.has_manager)           | Whether this model has a manager instance.                                                                      |
| [`has_requirements`](#fiftyone.zoo.models.ZooModel.has_requirements) | Whether this model has requirements in order to be used.                                                        |
| [`has_tags`](#fiftyone.zoo.models.ZooModel.has_tags)                 | Whether this model has tags.                                                                                    |
| [`has_version`](#fiftyone.zoo.models.ZooModel.has_version)           | Determines whether the model has a version.                                                                     |
| [`name`](#fiftyone.zoo.models.ZooModel.name)                         | The version-aware name of the model.                                                                            |
| [`supports_cpu`](#fiftyone.zoo.models.ZooModel.supports_cpu)         | Whether the model supports CPU (True), or not (False), or unknown (None).                                       |
| [`supports_gpu`](#fiftyone.zoo.models.ZooModel.supports_gpu)         | Whether the model supports GPU (True), or not (False), or unknown (None).                                       |

#### attributes()

Returns a list of class attributes to be serialized.

* **Returns:**
  a list of class attributes

#### *property* comp_version

The version of this model expressed as a
`distutils.version.LooseVersion` intended for comparison operations.

Models with no version are given a version of 0.0.0.

#### copy()

Returns a deep copy of the object.

* **Returns:**
  a Serializable instance

#### custom_attributes(dynamic=False, private=False)

Returns a customizable list of class attributes.

By default, all attributes in vars(self) are returned, minus private
attributes (those starting with “_”).

* **Parameters:**
  * **dynamic** – whether to include dynamic properties, e.g., those defined
    by getter/setter methods or the `@property` decorator. By
    default, this is False
  * **private** – whether to include private properties, i.e., those
    starting with “_”. By default, this is False
* **Returns:**
  a list of class attributes

#### download_model(model_path, force=False)

Downloads the model to the given local path.

If the download is forced, any existing model is overwritten. If the
download is not forced, the model will only be downloaded if it does
not already exist locally.

If the model has no manager, nothing is downloaded.

* **Parameters:**
  * **model_path** – the path to which to download the model
  * **force** – whether to force download the model. If True, the model is
    always downloaded. If False, the model is only downloaded if
    necessary. The default is False
* **Raises:**
  **ModelError** – if model downloading is not currently allowed

#### ensure_requirements(error_level=0, log_success=False)

Ensures that any requirement(s) for this model are satisfied.

* **Parameters:**
  * **error_level** – 

    the error level to use, defined as:

    0: raise error if a requirement is not satisfied
    1: log warning if a requirement is not satisifed
    2: ignore unsatisifed requirements
  * **log_success** – whether to generate a log message when a requirement
    is satisifed

#### *property* filename

The version-aware filename of the model.

#### flush_model(model_path)

Flushes the copy of the model at the given local path, if necessary.

* **Parameters:**
  **model_path** – the path on disk for the model

#### flush_model_from_dir(models_dir)

Flushes the copy of the model in the given models directory, if
necessary.

* **Parameters:**
  **models_dir** – the models directory

#### *classmethod* from_dict(d, subdir=None)

Constructs a Model from a JSON dictionary.

* **Parameters:**
  * **d** – a JSON dictionary
  * **subdir** (*optional*) – a subdirectory for the model
* **Returns:**
  a Model instance

#### *classmethod* from_json(path, \*args, \*\*kwargs)

Constructs a Serializable object from a JSON file.

Subclasses may override this method, but, by default, this method
simply reads the JSON and calls from_dict(), which subclasses must
implement.

* **Parameters:**
  * **path** – the path to the JSON file on disk
  * **\*args** – optional positional arguments for `self.from_dict()`
  * **\*\*kwargs** – optional keyword arguments for `self.from_dict()`
* **Returns:**
  an instance of the Serializable class

#### *classmethod* from_str(s, \*args, \*\*kwargs)

Constructs a Serializable object from a JSON string.

Subclasses may override this method, but, by default, this method
simply parses the string and calls from_dict(), which subclasses must
implement.

* **Parameters:**
  * **s** – a JSON string representation of a Serializable object
  * **\*args** – optional positional arguments for `self.from_dict()`
  * **\*\*kwargs** – optional keyword arguments for `self.from_dict()`
* **Returns:**
  an instance of the Serializable class

#### *classmethod* get_class_name()

Returns the fully-qualified class name string of this object.

#### get_path_in_dir(models_dir)

Gets the model path for the model in the given models directory.

* **Parameters:**
  **models_dir** – the models directory
* **Returns:**
  the model path, or None if the model has no manager

#### *property* has_manager

Whether this model has a manager instance.

#### *property* has_requirements

Whether this model has requirements in order to be used.

#### has_tag(tag)

Whether this model has the given tag.

* **Parameters:**
  **tag** – a tag
* **Returns:**
  True/False

#### *property* has_tags

Whether this model has tags.

#### *property* has_version

Determines whether the model has a version.

#### *static* has_version_str(name)

Determines whether the given model name has a version string.

* **Parameters:**
  **name** – the model name
* **Returns:**
  True/False

#### install_requirements(error_level=0)

Installs any necessary requirement(s) for this model.

* **Parameters:**
  **error_level** – 

  the error level to use, defined as:

  0: raise error if an install fails
  1: log warning if an install fails
  2: ignore install fails

#### is_in_dir(models_dir)

Determines whether a copy of the model exists in the given models
directory.

* **Parameters:**
  **models_dir** – the models directory
* **Returns:**
  True/False, or None if the model has no manager

#### is_model_downloaded(model_path)

Determines whether the model is downloaded to the given location.

If `model_path` is an archive, this method will also return `True` if a
directory with the same basename as `model_path` exists.

* **Parameters:**
  **model_path** – the path on disk for the model
* **Returns:**
  True/False, or None if the model has no manager

#### *property* name

The version-aware name of the model.

#### *static* parse_name(name)

Parses the model name, returning the base name and the version,
if any.

* **Parameters:**
  **name** – the name of the model, which can have “@<ver>” appended to
  refer to a specific version of the model
* **Returns:**
  the base name of the model
  version: the version of the model, or None if no version was found
* **Return type:**
  base_name

#### serialize(reflective=False)

Serializes the object into a dictionary.

Serialization is applied recursively to all attributes in the object,
including element-wise serialization of lists and dictionary values.

* **Parameters:**
  **reflective** – whether to include reflective attributes when
  serializing the object. By default, this is False
* **Returns:**
  a JSON dictionary representation of the object

#### *property* supports_cpu

Whether the model supports CPU (True), or not (False), or unknown
(None).

#### *property* supports_gpu

Whether the model supports GPU (True), or not (False), or unknown
(None).

#### to_str(pretty_print=True, \*\*kwargs)

Returns a string representation of this object.

* **Parameters:**
  * **pretty_print** – whether to render the JSON in human readable format
    with newlines and indentations. By default, this is True
  * **\*\*kwargs** – optional keyword arguments for `self.serialize()`
* **Returns:**
  a string representation of the object

#### write_json(path, pretty_print=False, \*\*kwargs)

Serializes the object and writes it to disk.

* **Parameters:**
  * **path** – the output path
  * **pretty_print** – whether to render the JSON in human readable format
    with newlines and indentations. By default, this is False
  * **\*\*kwargs** – optional keyword arguments for `self.serialize()`

### *class* fiftyone.zoo.models.RemoteZooModel(\*args, \*\*kwargs)

Bases: [`ZooModel`](#fiftyone.zoo.models.ZooModel)

**Methods:**

| [`load_model`](#fiftyone.zoo.models.RemoteZooModel.load_model)(\*\*kwargs)                                   |                                                                              |
|--------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| [`resolve_input`](#fiftyone.zoo.models.RemoteZooModel.resolve_input)(ctx)                                    |                                                                              |
| [`parse_parameters`](#fiftyone.zoo.models.RemoteZooModel.parse_parameters)(ctx, params)                      |                                                                              |
| [`attributes`](#fiftyone.zoo.models.RemoteZooModel.attributes)()                                             | Returns a list of class attributes to be serialized.                         |
| [`copy`](#fiftyone.zoo.models.RemoteZooModel.copy)()                                                         | Returns a deep copy of the object.                                           |
| [`custom_attributes`](#fiftyone.zoo.models.RemoteZooModel.custom_attributes)([dynamic, private])             | Returns a customizable list of class attributes.                             |
| [`download_model`](#fiftyone.zoo.models.RemoteZooModel.download_model)(model_path[, force])                  | Downloads the model to the given local path.                                 |
| [`ensure_requirements`](#fiftyone.zoo.models.RemoteZooModel.ensure_requirements)([error_level, log_success]) | Ensures that any requirement(s) for this model are satisfied.                |
| [`flush_model`](#fiftyone.zoo.models.RemoteZooModel.flush_model)(model_path)                                 | Flushes the copy of the model at the given local path, if necessary.         |
| [`flush_model_from_dir`](#fiftyone.zoo.models.RemoteZooModel.flush_model_from_dir)(models_dir)               | Flushes the copy of the model in the given models directory, if necessary.   |
| [`from_dict`](#fiftyone.zoo.models.RemoteZooModel.from_dict)(d[, subdir])                                    | Constructs a Model from a JSON dictionary.                                   |
| [`from_json`](#fiftyone.zoo.models.RemoteZooModel.from_json)(path, \*args, \*\*kwargs)                       | Constructs a Serializable object from a JSON file.                           |
| [`from_str`](#fiftyone.zoo.models.RemoteZooModel.from_str)(s, \*args, \*\*kwargs)                            | Constructs a Serializable object from a JSON string.                         |
| [`get_class_name`](#fiftyone.zoo.models.RemoteZooModel.get_class_name)()                                     | Returns the fully-qualified class name string of this object.                |
| [`get_path_in_dir`](#fiftyone.zoo.models.RemoteZooModel.get_path_in_dir)(models_dir)                         | Gets the model path for the model in the given models directory.             |
| [`has_tag`](#fiftyone.zoo.models.RemoteZooModel.has_tag)(tag)                                                | Whether this model has the given tag.                                        |
| [`has_version_str`](#fiftyone.zoo.models.RemoteZooModel.has_version_str)(name)                               | Determines whether the given model name has a version string.                |
| [`install_requirements`](#fiftyone.zoo.models.RemoteZooModel.install_requirements)([error_level])            | Installs any necessary requirement(s) for this model.                        |
| [`is_in_dir`](#fiftyone.zoo.models.RemoteZooModel.is_in_dir)(models_dir)                                     | Determines whether a copy of the model exists in the given models directory. |
| [`is_model_downloaded`](#fiftyone.zoo.models.RemoteZooModel.is_model_downloaded)(model_path)                 | Determines whether the model is downloaded to the given location.            |
| [`parse_name`](#fiftyone.zoo.models.RemoteZooModel.parse_name)(name)                                         | Parses the model name, returning the base name and the version, if any.      |
| [`serialize`](#fiftyone.zoo.models.RemoteZooModel.serialize)([reflective])                                   | Serializes the object into a dictionary.                                     |
| [`to_str`](#fiftyone.zoo.models.RemoteZooModel.to_str)([pretty_print])                                       | Returns a string representation of this object.                              |
| [`write_json`](#fiftyone.zoo.models.RemoteZooModel.write_json)(path[, pretty_print])                         | Serializes the object and writes it to disk.                                 |

**Attributes:**

| [`comp_version`](#fiftyone.zoo.models.RemoteZooModel.comp_version)         | The version of this model expressed as a `distutils.version.LooseVersion` intended for comparison operations.   |
|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| [`filename`](#fiftyone.zoo.models.RemoteZooModel.filename)                 | The version-aware filename of the model.                                                                        |
| [`has_manager`](#fiftyone.zoo.models.RemoteZooModel.has_manager)           | Whether this model has a manager instance.                                                                      |
| [`has_requirements`](#fiftyone.zoo.models.RemoteZooModel.has_requirements) | Whether this model has requirements in order to be used.                                                        |
| [`has_tags`](#fiftyone.zoo.models.RemoteZooModel.has_tags)                 | Whether this model has tags.                                                                                    |
| [`has_version`](#fiftyone.zoo.models.RemoteZooModel.has_version)           | Determines whether the model has a version.                                                                     |
| [`name`](#fiftyone.zoo.models.RemoteZooModel.name)                         | The version-aware name of the model.                                                                            |
| [`supports_cpu`](#fiftyone.zoo.models.RemoteZooModel.supports_cpu)         | Whether the model supports CPU (True), or not (False), or unknown (None).                                       |
| [`supports_gpu`](#fiftyone.zoo.models.RemoteZooModel.supports_gpu)         | Whether the model supports GPU (True), or not (False), or unknown (None).                                       |

#### load_model(\*\*kwargs)

#### resolve_input(ctx)

#### parse_parameters(ctx, params)

#### attributes()

Returns a list of class attributes to be serialized.

* **Returns:**
  a list of class attributes

#### *property* comp_version

The version of this model expressed as a
`distutils.version.LooseVersion` intended for comparison operations.

Models with no version are given a version of 0.0.0.

#### copy()

Returns a deep copy of the object.

* **Returns:**
  a Serializable instance

#### custom_attributes(dynamic=False, private=False)

Returns a customizable list of class attributes.

By default, all attributes in vars(self) are returned, minus private
attributes (those starting with “_”).

* **Parameters:**
  * **dynamic** – whether to include dynamic properties, e.g., those defined
    by getter/setter methods or the `@property` decorator. By
    default, this is False
  * **private** – whether to include private properties, i.e., those
    starting with “_”. By default, this is False
* **Returns:**
  a list of class attributes

#### download_model(model_path, force=False)

Downloads the model to the given local path.

If the download is forced, any existing model is overwritten. If the
download is not forced, the model will only be downloaded if it does
not already exist locally.

If the model has no manager, nothing is downloaded.

* **Parameters:**
  * **model_path** – the path to which to download the model
  * **force** – whether to force download the model. If True, the model is
    always downloaded. If False, the model is only downloaded if
    necessary. The default is False
* **Raises:**
  **ModelError** – if model downloading is not currently allowed

#### ensure_requirements(error_level=0, log_success=False)

Ensures that any requirement(s) for this model are satisfied.

* **Parameters:**
  * **error_level** – 

    the error level to use, defined as:

    0: raise error if a requirement is not satisfied
    1: log warning if a requirement is not satisifed
    2: ignore unsatisifed requirements
  * **log_success** – whether to generate a log message when a requirement
    is satisifed

#### *property* filename

The version-aware filename of the model.

#### flush_model(model_path)

Flushes the copy of the model at the given local path, if necessary.

* **Parameters:**
  **model_path** – the path on disk for the model

#### flush_model_from_dir(models_dir)

Flushes the copy of the model in the given models directory, if
necessary.

* **Parameters:**
  **models_dir** – the models directory

#### *classmethod* from_dict(d, subdir=None)

Constructs a Model from a JSON dictionary.

* **Parameters:**
  * **d** – a JSON dictionary
  * **subdir** (*optional*) – a subdirectory for the model
* **Returns:**
  a Model instance

#### *classmethod* from_json(path, \*args, \*\*kwargs)

Constructs a Serializable object from a JSON file.

Subclasses may override this method, but, by default, this method
simply reads the JSON and calls from_dict(), which subclasses must
implement.

* **Parameters:**
  * **path** – the path to the JSON file on disk
  * **\*args** – optional positional arguments for `self.from_dict()`
  * **\*\*kwargs** – optional keyword arguments for `self.from_dict()`
* **Returns:**
  an instance of the Serializable class

#### *classmethod* from_str(s, \*args, \*\*kwargs)

Constructs a Serializable object from a JSON string.

Subclasses may override this method, but, by default, this method
simply parses the string and calls from_dict(), which subclasses must
implement.

* **Parameters:**
  * **s** – a JSON string representation of a Serializable object
  * **\*args** – optional positional arguments for `self.from_dict()`
  * **\*\*kwargs** – optional keyword arguments for `self.from_dict()`
* **Returns:**
  an instance of the Serializable class

#### *classmethod* get_class_name()

Returns the fully-qualified class name string of this object.

#### get_path_in_dir(models_dir)

Gets the model path for the model in the given models directory.

* **Parameters:**
  **models_dir** – the models directory
* **Returns:**
  the model path, or None if the model has no manager

#### *property* has_manager

Whether this model has a manager instance.

#### *property* has_requirements

Whether this model has requirements in order to be used.

#### has_tag(tag)

Whether this model has the given tag.

* **Parameters:**
  **tag** – a tag
* **Returns:**
  True/False

#### *property* has_tags

Whether this model has tags.

#### *property* has_version

Determines whether the model has a version.

#### *static* has_version_str(name)

Determines whether the given model name has a version string.

* **Parameters:**
  **name** – the model name
* **Returns:**
  True/False

#### install_requirements(error_level=0)

Installs any necessary requirement(s) for this model.

* **Parameters:**
  **error_level** – 

  the error level to use, defined as:

  0: raise error if an install fails
  1: log warning if an install fails
  2: ignore install fails

#### is_in_dir(models_dir)

Determines whether a copy of the model exists in the given models
directory.

* **Parameters:**
  **models_dir** – the models directory
* **Returns:**
  True/False, or None if the model has no manager

#### is_model_downloaded(model_path)

Determines whether the model is downloaded to the given location.

If `model_path` is an archive, this method will also return `True` if a
directory with the same basename as `model_path` exists.

* **Parameters:**
  **model_path** – the path on disk for the model
* **Returns:**
  True/False, or None if the model has no manager

#### *property* name

The version-aware name of the model.

#### *static* parse_name(name)

Parses the model name, returning the base name and the version,
if any.

* **Parameters:**
  **name** – the name of the model, which can have “@<ver>” appended to
  refer to a specific version of the model
* **Returns:**
  the base name of the model
  version: the version of the model, or None if no version was found
* **Return type:**
  base_name

#### serialize(reflective=False)

Serializes the object into a dictionary.

Serialization is applied recursively to all attributes in the object,
including element-wise serialization of lists and dictionary values.

* **Parameters:**
  **reflective** – whether to include reflective attributes when
  serializing the object. By default, this is False
* **Returns:**
  a JSON dictionary representation of the object

#### *property* supports_cpu

Whether the model supports CPU (True), or not (False), or unknown
(None).

#### *property* supports_gpu

Whether the model supports GPU (True), or not (False), or unknown
(None).

#### to_str(pretty_print=True, \*\*kwargs)

Returns a string representation of this object.

* **Parameters:**
  * **pretty_print** – whether to render the JSON in human readable format
    with newlines and indentations. By default, this is True
  * **\*\*kwargs** – optional keyword arguments for `self.serialize()`
* **Returns:**
  a string representation of the object

#### write_json(path, pretty_print=False, \*\*kwargs)

Serializes the object and writes it to disk.

* **Parameters:**
  * **path** – the output path
  * **pretty_print** – whether to render the JSON in human readable format
    with newlines and indentations. By default, this is False
  * **\*\*kwargs** – optional keyword arguments for `self.serialize()`

### *class* fiftyone.zoo.models.RemoteModelManagerConfig(d)

Bases: `ModelManagerConfig`

**Methods:**

| [`attributes`](#fiftyone.zoo.models.RemoteModelManagerConfig.attributes)()                                                 | Returns a list of attributes to be serialized.                                                                         |
|----------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| [`builder`](#fiftyone.zoo.models.RemoteModelManagerConfig.builder)()                                                       | Returns a ConfigBuilder instance for this class.                                                                       |
| [`copy`](#fiftyone.zoo.models.RemoteModelManagerConfig.copy)()                                                             | Returns a deep copy of the object.                                                                                     |
| [`custom_attributes`](#fiftyone.zoo.models.RemoteModelManagerConfig.custom_attributes)([dynamic, private])                 | Returns a customizable list of class attributes.                                                                       |
| [`default`](#fiftyone.zoo.models.RemoteModelManagerConfig.default)()                                                       | Returns the default config instance.                                                                                   |
| [`from_dict`](#fiftyone.zoo.models.RemoteModelManagerConfig.from_dict)(d)                                                  | Constructs a Config object from a JSON dictionary.                                                                     |
| [`from_json`](#fiftyone.zoo.models.RemoteModelManagerConfig.from_json)(path, \*args, \*\*kwargs)                           | Constructs a Serializable object from a JSON file.                                                                     |
| [`from_kwargs`](#fiftyone.zoo.models.RemoteModelManagerConfig.from_kwargs)(\*\*kwargs)                                     | Constructs a Config object from keyword arguments.                                                                     |
| [`from_str`](#fiftyone.zoo.models.RemoteModelManagerConfig.from_str)(s, \*args, \*\*kwargs)                                | Constructs a Serializable object from a JSON string.                                                                   |
| [`get_class_name`](#fiftyone.zoo.models.RemoteModelManagerConfig.get_class_name)()                                         | Returns the fully-qualified class name string of this object.                                                          |
| [`load_default`](#fiftyone.zoo.models.RemoteModelManagerConfig.load_default)()                                             | Loads the default config instance from file.                                                                           |
| [`parse_array`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_array)(d, key[, default])                              | Parses a raw array attribute.                                                                                          |
| [`parse_bool`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_bool)(d, key[, default])                                | Parses a boolean value.                                                                                                |
| [`parse_categorical`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_categorical)(d, key, choices[, default])         | Parses a categorical JSON field, which must take a value from among the given choices.                                 |
| [`parse_dict`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_dict)(d, key[, default])                                | Parses a dictionary attribute.                                                                                         |
| [`parse_int`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_int)(d, key[, default])                                  | Parses an integer attribute.                                                                                           |
| [`parse_mutually_exclusive_fields`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_mutually_exclusive_fields)(fields) | Parses a mutually exclusive dictionary of pre-parsed fields, which must contain exactly one field with a truthy value. |
| [`parse_number`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_number)(d, key[, default])                            | Parses a number attribute.                                                                                             |
| [`parse_object`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_object)(d, key, cls[, default])                       | Parses an object attribute.                                                                                            |
| [`parse_object_array`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_object_array)(d, key, cls[, default])           | Parses an array of objects.                                                                                            |
| [`parse_object_dict`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_object_dict)(d, key, cls[, default])             | Parses a dictionary whose values are objects.                                                                          |
| [`parse_path`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_path)(d, key[, default])                                | Parses a path attribute.                                                                                               |
| [`parse_raw`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_raw)(d, key[, default])                                  | Parses a raw (arbitrary) JSON field.                                                                                   |
| [`parse_string`](#fiftyone.zoo.models.RemoteModelManagerConfig.parse_string)(d, key[, default])                            | Parses a string attribute.                                                                                             |
| [`serialize`](#fiftyone.zoo.models.RemoteModelManagerConfig.serialize)([reflective])                                       | Serializes the object into a dictionary.                                                                               |
| [`to_str`](#fiftyone.zoo.models.RemoteModelManagerConfig.to_str)([pretty_print])                                           | Returns a string representation of this object.                                                                        |
| [`validate_all_or_nothing_fields`](#fiftyone.zoo.models.RemoteModelManagerConfig.validate_all_or_nothing_fields)(fields)   | Validates a dictionary of pre-parsed fields checking that either all or none of the fields have a truthy value.        |
| [`write_json`](#fiftyone.zoo.models.RemoteModelManagerConfig.write_json)(path[, pretty_print])                             | Serializes the object and writes it to disk.                                                                           |

#### attributes()

Returns a list of attributes to be serialized.

* **Returns:**
  a list of attributes

#### *classmethod* builder()

Returns a ConfigBuilder instance for this class.

#### copy()

Returns a deep copy of the object.

* **Returns:**
  a Serializable instance

#### custom_attributes(dynamic=False, private=False)

Returns a customizable list of class attributes.

By default, all attributes in vars(self) are returned, minus private
attributes (those starting with “_”).

* **Parameters:**
  * **dynamic** – whether to include dynamic properties, e.g., those defined
    by getter/setter methods or the `@property` decorator. By
    default, this is False
  * **private** – whether to include private properties, i.e., those
    starting with “_”. By default, this is False
* **Returns:**
  a list of class attributes

#### *classmethod* default()

Returns the default config instance.

By default, this method instantiates the class from an empty
dictionary, which will only succeed if all attributes are optional.
Otherwise, subclasses should override this method to provide the
desired default configuration.

#### *classmethod* from_dict(d)

Constructs a Config object from a JSON dictionary.

Config subclass constructors accept JSON dictionaries, so this method
simply passes the dictionary to cls().

* **Parameters:**
  **d** – a dict of fields expected by cls
* **Returns:**
  an instance of cls

#### *classmethod* from_json(path, \*args, \*\*kwargs)

Constructs a Serializable object from a JSON file.

Subclasses may override this method, but, by default, this method
simply reads the JSON and calls from_dict(), which subclasses must
implement.

* **Parameters:**
  * **path** – the path to the JSON file on disk
  * **\*args** – optional positional arguments for `self.from_dict()`
  * **\*\*kwargs** – optional keyword arguments for `self.from_dict()`
* **Returns:**
  an instance of the Serializable class

#### *classmethod* from_kwargs(\*\*kwargs)

Constructs a Config object from keyword arguments.

* **Parameters:**
  **\*\*kwargs** – keyword arguments that define the fields expected by cls
* **Returns:**
  an instance of cls

#### *classmethod* from_str(s, \*args, \*\*kwargs)

Constructs a Serializable object from a JSON string.

Subclasses may override this method, but, by default, this method
simply parses the string and calls from_dict(), which subclasses must
implement.

* **Parameters:**
  * **s** – a JSON string representation of a Serializable object
  * **\*args** – optional positional arguments for `self.from_dict()`
  * **\*\*kwargs** – optional keyword arguments for `self.from_dict()`
* **Returns:**
  an instance of the Serializable class

#### *classmethod* get_class_name()

Returns the fully-qualified class name string of this object.

#### *classmethod* load_default()

Loads the default config instance from file.

Subclasses must implement this method if they intend to support
default instances.

#### *static* parse_array(d, key, default=<eta.core.config.NoDefault object>)

Parses a raw array attribute.

* **Parameters:**
  * **d** – a JSON dictionary
  * **key** – the key to parse
  * **default** – a default list to return if key is not present
* **Returns:**
  a list of raw (untouched) values
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if the field value was the wrong type or no default
      value was provided and the key was not found in the dictionary

#### *static* parse_bool(d, key, default=<eta.core.config.NoDefault object>)

Parses a boolean value.

* **Parameters:**
  * **d** – a JSON dictionary
  * **key** – the key to parse
  * **default** – a default bool to return if key is not present
* **Returns:**
  True/False
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if the field value was the wrong type or no default
      value was provided and the key was not found in the dictionary

#### *static* parse_categorical(d, key, choices, default=<eta.core.config.NoDefault object>)

Parses a categorical JSON field, which must take a value from among
the given choices.

* **Parameters:**
  * **d** – a JSON dictionary
  * **key** – the key to parse
  * **choices** – either an iterable of possible values or an enum-like
    class whose attributes define the possible values
  * **default** – a default value to return if key is not present
* **Returns:**
  the raw (untouched) value of the given field, which is equal to a
  value from `choices`
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if the key was present in the dictionary but its value
      was not an allowed choice, or if no default value was provided
      and the key was not found in the dictionary

#### *static* parse_dict(d, key, default=<eta.core.config.NoDefault object>)

Parses a dictionary attribute.

* **Parameters:**
  * **d** – a JSON dictionary
  * **key** – the key to parse
  * **default** – a default dict to return if key is not present
* **Returns:**
  a dictionary
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if the field value was the wrong type or no default
      value was provided and the key was not found in the dictionary

#### *static* parse_int(d, key, default=<eta.core.config.NoDefault object>)

Parses an integer attribute.

* **Parameters:**
  * **d** – a JSON dictionary
  * **key** – the key to parse
  * **default** – a default integer value to return if key is not present
* **Returns:**
  an int
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if the field value was the wrong type or no default
      value was provided and the key was not found in the dictionary

#### *static* parse_mutually_exclusive_fields(fields)

Parses a mutually exclusive dictionary of pre-parsed fields, which
must contain exactly one field with a truthy value.

* **Parameters:**
  **fields** – a dictionary of pre-parsed fields
* **Returns:**
  the (field, value) that was set
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if zero or more than one truthy value was found

#### *static* parse_number(d, key, default=<eta.core.config.NoDefault object>)

Parses a number attribute.

* **Parameters:**
  * **d** – a JSON dictionary
  * **key** – the key to parse
  * **default** – a default numeric value to return if key is not present
* **Returns:**
  a number (e.g. int, float)
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if the field value was the wrong type or no default
      value was provided and the key was not found in the dictionary

#### *static* parse_object(d, key, cls, default=<eta.core.config.NoDefault object>)

Parses an object attribute.

The value of d[key] can be either an instance of cls or a serialized
dict from an instance of cls.

* **Parameters:**
  * **d** – a JSON dictionary
  * **key** – the key to parse
  * **cls** – the class of d[key]
  * **default** – a default cls instance to return if key is not present
* **Returns:**
  an instance of cls
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if the field value was the wrong type or no default
      value was provided and the key was not found in the dictionary

#### *static* parse_object_array(d, key, cls, default=<eta.core.config.NoDefault object>)

Parses an array of objects.

The values in d[key] can be either instances of cls or serialized
dicts from instances of cls.

* **Parameters:**
  * **d** – a JSON dictionary
  * **key** – the key to parse
  * **cls** – the class of the elements of list d[key]
  * **default** – the default list to return if key is not present
* **Returns:**
  a list of cls instances
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if the field value was the wrong type or no default
      value was provided and the key was not found in the dictionary

#### *static* parse_object_dict(d, key, cls, default=<eta.core.config.NoDefault object>)

Parses a dictionary whose values are objects.

The values in d[key] can be either instances of cls or serialized
dicts from instances of cls.

* **Parameters:**
  * **d** – a JSON dictionary
  * **key** – the key to parse
  * **cls** – the class of the values of dictionary d[key]
  * **default** – the default dict of cls instances to return if key is not
    present
* **Returns:**
  a dictionary whose values are cls instances
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if the field value was the wrong type or no default
      value was provided and the key was not found in the dictionary

#### *static* parse_path(d, key, default=<eta.core.config.NoDefault object>)

Parses a path attribute.

The path is converted to an absolute path if necessary via
`os.path.abspath(os.path.expanduser(value))`.

* **Parameters:**
  * **d** – a JSON dictionary
  * **key** – the key to parse
  * **default** – a default string to return if key is not present
* **Returns:**
  a path string
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if the field value was the wrong type or no default
      value was provided and the key was not found in the dictionary

#### *static* parse_raw(d, key, default=<eta.core.config.NoDefault object>)

Parses a raw (arbitrary) JSON field.

* **Parameters:**
  * **d** – a JSON dictionary
  * **key** – the key to parse
  * **default** – a default value to return if key is not present
* **Returns:**
  the raw (untouched) value of the given field
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if no default value was provided and the key was not
      found in the dictionary

#### *static* parse_string(d, key, default=<eta.core.config.NoDefault object>)

Parses a string attribute.

* **Parameters:**
  * **d** – a JSON dictionary
  * **key** – the key to parse
  * **default** – a default string to return if key is not present
* **Returns:**
  a string
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if the field value was the wrong type or no default
      value was provided and the key was not found in the dictionary

#### serialize(reflective=False)

Serializes the object into a dictionary.

Serialization is applied recursively to all attributes in the object,
including element-wise serialization of lists and dictionary values.

* **Parameters:**
  **reflective** – whether to include reflective attributes when
  serializing the object. By default, this is False
* **Returns:**
  a JSON dictionary representation of the object

#### to_str(pretty_print=True, \*\*kwargs)

Returns a string representation of this object.

* **Parameters:**
  * **pretty_print** – whether to render the JSON in human readable format
    with newlines and indentations. By default, this is True
  * **\*\*kwargs** – optional keyword arguments for `self.serialize()`
* **Returns:**
  a string representation of the object

#### *static* validate_all_or_nothing_fields(fields)

Validates a dictionary of pre-parsed fields checking that either
all or none of the fields have a truthy value.

* **Parameters:**
  **fields** – a dictionary of pre-parsed fields
* **Raises:**
  [**ConfigError**](fiftyone.zoo.md#fiftyone.zoo.ConfigError) – if some values are truth and some are not

#### write_json(path, pretty_print=False, \*\*kwargs)

Serializes the object and writes it to disk.

* **Parameters:**
  * **path** – the output path
  * **pretty_print** – whether to render the JSON in human readable format
    with newlines and indentations. By default, this is False
  * **\*\*kwargs** – optional keyword arguments for `self.serialize()`

### *class* fiftyone.zoo.models.RemoteModelManager(config)

Bases: `ModelManager`

**Methods:**

| [`attributes`](#fiftyone.zoo.models.RemoteModelManager.attributes)()                                   | Returns a list of attributes to be serialized.                                                     |
|--------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| [`copy`](#fiftyone.zoo.models.RemoteModelManager.copy)()                                               | Returns a deep copy of the object.                                                                 |
| [`custom_attributes`](#fiftyone.zoo.models.RemoteModelManager.custom_attributes)([dynamic, private])   | Returns a customizable list of class attributes.                                                   |
| [`delete_model`](#fiftyone.zoo.models.RemoteModelManager.delete_model)()                               | Deletes the model from remote storage.                                                             |
| [`download_model`](#fiftyone.zoo.models.RemoteModelManager.download_model)(model_path[, force])        | Downloads the model to the given local path.                                                       |
| [`flush_model`](#fiftyone.zoo.models.RemoteModelManager.flush_model)(model_path)                       | Flushes the copy of the model at the given local path, if necessary.                               |
| [`from_config`](#fiftyone.zoo.models.RemoteModelManager.from_config)(config)                           | Instantiates a Configurable class from a <cls>Config instance.                                     |
| [`from_dict`](#fiftyone.zoo.models.RemoteModelManager.from_dict)(d)                                    | Builds the ModelManager subclass from a JSON dictionary.                                           |
| [`from_json`](#fiftyone.zoo.models.RemoteModelManager.from_json)(json_path)                            | Instantiates a Configurable class from a <cls>Config JSON file.                                    |
| [`from_kwargs`](#fiftyone.zoo.models.RemoteModelManager.from_kwargs)(\*\*kwargs)                       | Instantiates a Configurable class from keyword arguments defining the attributes of a <cls>Config. |
| [`from_str`](#fiftyone.zoo.models.RemoteModelManager.from_str)(s, \*args, \*\*kwargs)                  | Constructs a Serializable object from a JSON string.                                               |
| [`get_class_name`](#fiftyone.zoo.models.RemoteModelManager.get_class_name)()                           | Returns the fully-qualified class name string of this object.                                      |
| [`is_model_downloaded`](#fiftyone.zoo.models.RemoteModelManager.is_model_downloaded)(model_path)       | Determines whether the model is downloaded to the given location.                                  |
| [`parse`](#fiftyone.zoo.models.RemoteModelManager.parse)(class_name[, module_name])                    | Parses a Configurable subclass name string.                                                        |
| [`serialize`](#fiftyone.zoo.models.RemoteModelManager.serialize)([reflective])                         | Serializes the object into a dictionary.                                                           |
| [`to_str`](#fiftyone.zoo.models.RemoteModelManager.to_str)([pretty_print])                             | Returns a string representation of this object.                                                    |
| [`upload_model`](#fiftyone.zoo.models.RemoteModelManager.upload_model)(model_path, \*args, \*\*kwargs) |                                                                                                    |
| [`validate`](#fiftyone.zoo.models.RemoteModelManager.validate)(config)                                 | Validates that the given config is an instance of <cls>Config.                                     |
| [`write_json`](#fiftyone.zoo.models.RemoteModelManager.write_json)(path[, pretty_print])               | Serializes the object and writes it to disk.                                                       |

#### attributes()

Returns a list of attributes to be serialized.

* **Returns:**
  a list of attributes

#### copy()

Returns a deep copy of the object.

* **Returns:**
  a Serializable instance

#### custom_attributes(dynamic=False, private=False)

Returns a customizable list of class attributes.

By default, all attributes in vars(self) are returned, minus private
attributes (those starting with “_”).

* **Parameters:**
  * **dynamic** – whether to include dynamic properties, e.g., those defined
    by getter/setter methods or the `@property` decorator. By
    default, this is False
  * **private** – whether to include private properties, i.e., those
    starting with “_”. By default, this is False
* **Returns:**
  a list of class attributes

#### delete_model()

Deletes the model from remote storage.

#### download_model(model_path, force=False)

Downloads the model to the given local path.

If the download is forced, any existing model is overwritten. If the
download is not forced, the model will only be downloaded if it does
not already exist locally.

* **Parameters:**
  * **model_path** – the path to which to download the model
  * **force** – whether to force download the model. If True, the model is
    always downloaded. If False, the model is only downloaded if
    necessary. The default is False
* **Raises:**
  **ModelError** – if model downloading is not currently allowed

#### flush_model(model_path)

Flushes the copy of the model at the given local path, if necessary.

* **Parameters:**
  **model_path** – the path on disk for the model

#### *classmethod* from_config(config)

Instantiates a Configurable class from a <cls>Config instance.

#### *classmethod* from_dict(d)

Builds the ModelManager subclass from a JSON dictionary.

* **Parameters:**
  **d** – a JSON dictionary
* **Returns:**
  a ModelManager instance

#### *classmethod* from_json(json_path)

Instantiates a Configurable class from a <cls>Config JSON file.

* **Parameters:**
  **json_path** – path to a JSON file for type <cls>Config
* **Returns:**
  an instance of cls

#### *classmethod* from_kwargs(\*\*kwargs)

Instantiates a Configurable class from keyword arguments defining
the attributes of a <cls>Config.

* **Parameters:**
  **\*\*kwargs** – keyword arguments that define the fields of a
  <cls>Config dict
* **Returns:**
  an instance of cls

#### *classmethod* from_str(s, \*args, \*\*kwargs)

Constructs a Serializable object from a JSON string.

Subclasses may override this method, but, by default, this method
simply parses the string and calls from_dict(), which subclasses must
implement.

* **Parameters:**
  * **s** – a JSON string representation of a Serializable object
  * **\*args** – optional positional arguments for `self.from_dict()`
  * **\*\*kwargs** – optional keyword arguments for `self.from_dict()`
* **Returns:**
  an instance of the Serializable class

#### *classmethod* get_class_name()

Returns the fully-qualified class name string of this object.

#### is_model_downloaded(model_path)

Determines whether the model is downloaded to the given location.

If `model_path` is an archive, this method will also return `True` if a
directory with the same basename as `model_path` exists.

* **Parameters:**
  **model_path** – the path on disk for the model
* **Returns:**
  True/False

#### *static* parse(class_name, module_name=None)

Parses a Configurable subclass name string.

Assumes both the Configurable class and the Config class are defined
in the same module. The module containing the classes will be loaded
if necessary.

* **Parameters:**
  * **class_name** – a string containing the name of the Configurable class,
    e.g. “ClassName”, or a fully-qualified class name, e.g.
    “eta.core.config.ClassName”
  * **module_name** – a string containing the fully-qualified module name,
    e.g. “eta.core.config”, or None if class_name includes the
    module name. Set module_name = \_\_name_\_ to load a class from
    the calling module
* **Returns:**
  the Configurable class
  config_cls: the Config class associated with cls
* **Return type:**
  [cls](fiftyone.brain.internal.core.elasticsearch.md#fiftyone.brain.internal.core.elasticsearch.ElasticsearchSimilarityConfig.cls)

#### serialize(reflective=False)

Serializes the object into a dictionary.

Serialization is applied recursively to all attributes in the object,
including element-wise serialization of lists and dictionary values.

* **Parameters:**
  **reflective** – whether to include reflective attributes when
  serializing the object. By default, this is False
* **Returns:**
  a JSON dictionary representation of the object

#### to_str(pretty_print=True, \*\*kwargs)

Returns a string representation of this object.

* **Parameters:**
  * **pretty_print** – whether to render the JSON in human readable format
    with newlines and indentations. By default, this is True
  * **\*\*kwargs** – optional keyword arguments for `self.serialize()`
* **Returns:**
  a string representation of the object

#### *static* upload_model(model_path, \*args, \*\*kwargs)

#### *classmethod* validate(config)

Validates that the given config is an instance of <cls>Config.

* **Raises:**
  **ConfigurableError** – if config is not an instance of <cls>Config

#### write_json(path, pretty_print=False, \*\*kwargs)

Serializes the object and writes it to disk.

* **Parameters:**
  * **path** – the output path
  * **pretty_print** – whether to render the JSON in human readable format
    with newlines and indentations. By default, this is False
  * **\*\*kwargs** – optional keyword arguments for `self.serialize()`

### *class* fiftyone.zoo.models.ZooModelsManifest(models=None, name=None, url=None)

Bases: `ModelsManifest`

Class that describes the collection of models in the FiftyOne Model Zoo.

* **Parameters:**
  **models** – a list of [`ZooModel`](#fiftyone.zoo.models.ZooModel) instances

**Methods:**

| [`add_model`](#fiftyone.zoo.models.ZooModelsManifest.add_model)(model[, error_level])                                  | Adds the given model to the manifest.                                                 |
|------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| [`attributes`](#fiftyone.zoo.models.ZooModelsManifest.attributes)()                                                    | Returns a list of class attributes to be serialized.                                  |
| [`copy`](#fiftyone.zoo.models.ZooModelsManifest.copy)()                                                                | Returns a deep copy of the object.                                                    |
| [`custom_attributes`](#fiftyone.zoo.models.ZooModelsManifest.custom_attributes)([dynamic, private])                    | Returns a customizable list of class attributes.                                      |
| [`dir_has_manifest`](#fiftyone.zoo.models.ZooModelsManifest.dir_has_manifest)(models_dir)                              | Determines whether the given directory has a models manifest.                         |
| [`from_dict`](#fiftyone.zoo.models.ZooModelsManifest.from_dict)(d)                                                     | Constructs a ModelsManifest from a JSON dictionary.                                   |
| [`from_dir`](#fiftyone.zoo.models.ZooModelsManifest.from_dir)(models_dir)                                              | Loads the ModelsManifest from the given models directory.                             |
| [`from_json`](#fiftyone.zoo.models.ZooModelsManifest.from_json)(path, \*args, \*\*kwargs)                              | Constructs a Serializable object from a JSON file.                                    |
| [`from_str`](#fiftyone.zoo.models.ZooModelsManifest.from_str)(s, \*args, \*\*kwargs)                                   | Constructs a Serializable object from a JSON string.                                  |
| [`get_class_name`](#fiftyone.zoo.models.ZooModelsManifest.get_class_name)()                                            | Returns the fully-qualified class name string of this object.                         |
| [`get_latest_model_with_base_name`](#fiftyone.zoo.models.ZooModelsManifest.get_latest_model_with_base_name)(base_name) | Gets the Model instance for the latest version of the model with the given base name. |
| [`get_model_with_name`](#fiftyone.zoo.models.ZooModelsManifest.get_model_with_name)(name)                              | Gets the model with the given name.                                                   |
| [`has_model_with_filename`](#fiftyone.zoo.models.ZooModelsManifest.has_model_with_filename)(model)                     | Determines whether this manifest contains a model with a conflicting filename.        |
| [`has_model_with_name`](#fiftyone.zoo.models.ZooModelsManifest.has_model_with_name)(name)                              | Determines whether this manifest contains the model with the given name.              |
| [`make_manifest_path`](#fiftyone.zoo.models.ZooModelsManifest.make_manifest_path)(models_dir)                          | Makes the manifest path for the given models directory.                               |
| [`merge`](#fiftyone.zoo.models.ZooModelsManifest.merge)(models_manifest[, error_level])                                | Merges the models manifest into this one.                                             |
| [`remove_model`](#fiftyone.zoo.models.ZooModelsManifest.remove_model)(name[, error_level])                             | Removes the model with the given name from the ModelsManifest.                        |
| [`serialize`](#fiftyone.zoo.models.ZooModelsManifest.serialize)([reflective])                                          | Serializes the object into a dictionary.                                              |
| [`to_str`](#fiftyone.zoo.models.ZooModelsManifest.to_str)([pretty_print])                                              | Returns a string representation of this object.                                       |
| [`write_json`](#fiftyone.zoo.models.ZooModelsManifest.write_json)(path[, pretty_print])                                | Serializes the object and writes it to disk.                                          |
| [`write_to_dir`](#fiftyone.zoo.models.ZooModelsManifest.write_to_dir)(models_dir)                                      | Writes the ModelsManifest to the given models directory.                              |

**Attributes:**

| [`subdir`](#fiftyone.zoo.models.ZooModelsManifest.subdir)   |    |
|-------------------------------------------------------------|----|

#### add_model(model, error_level=0)

Adds the given model to the manifest.

* **Parameters:**
  * **model** – a Model instance
  * **error_level** – 

    the error level to use, defined as:

    0: raise error if the model cannot be added
    1: log warning if the model cannot be added
    2: ignore models that cannot be added

#### attributes()

Returns a list of class attributes to be serialized.

This method is called internally by `serialize()` to determine the
class attributes to serialize.

Subclasses can override this method, but, by default, all attributes in
vars(self) are returned, minus private attributes, i.e., those starting
with “_”. The order of the attributes in this list is preserved when
serializing objects, so a common pattern is for subclasses to override
this method if they want their JSON files to be organized in a
particular way.

* **Returns:**
  a list of class attributes to be serialized

#### copy()

Returns a deep copy of the object.

* **Returns:**
  a Serializable instance

#### custom_attributes(dynamic=False, private=False)

Returns a customizable list of class attributes.

By default, all attributes in vars(self) are returned, minus private
attributes (those starting with “_”).

* **Parameters:**
  * **dynamic** – whether to include dynamic properties, e.g., those defined
    by getter/setter methods or the `@property` decorator. By
    default, this is False
  * **private** – whether to include private properties, i.e., those
    starting with “_”. By default, this is False
* **Returns:**
  a list of class attributes

#### *static* dir_has_manifest(models_dir)

Determines whether the given directory has a models manifest.

* **Parameters:**
  **models_dir** – the models directory
* **Returns:**
  True/False

#### *classmethod* from_dict(d)

Constructs a ModelsManifest from a JSON dictionary.

* **Parameters:**
  **d** – a JSON dictionary
* **Returns:**
  a ModelsManifest

#### *classmethod* from_dir(models_dir)

Loads the ModelsManifest from the given models directory.

* **Parameters:**
  **models_dir** – the models directory
* **Returns:**
  a ModelsManifest

#### *classmethod* from_json(path, \*args, \*\*kwargs)

Constructs a Serializable object from a JSON file.

Subclasses may override this method, but, by default, this method
simply reads the JSON and calls from_dict(), which subclasses must
implement.

* **Parameters:**
  * **path** – the path to the JSON file on disk
  * **\*args** – optional positional arguments for `self.from_dict()`
  * **\*\*kwargs** – optional keyword arguments for `self.from_dict()`
* **Returns:**
  an instance of the Serializable class

#### *classmethod* from_str(s, \*args, \*\*kwargs)

Constructs a Serializable object from a JSON string.

Subclasses may override this method, but, by default, this method
simply parses the string and calls from_dict(), which subclasses must
implement.

* **Parameters:**
  * **s** – a JSON string representation of a Serializable object
  * **\*args** – optional positional arguments for `self.from_dict()`
  * **\*\*kwargs** – optional keyword arguments for `self.from_dict()`
* **Returns:**
  an instance of the Serializable class

#### *classmethod* get_class_name()

Returns the fully-qualified class name string of this object.

#### get_latest_model_with_base_name(base_name)

Gets the Model instance for the latest version of the model with the
given base name.

* **Parameters:**
  **base_name** – the base name of the model
* **Returns:**
  the Model instance
* **Raises:**
  **ModelError** – if the model was not found

#### get_model_with_name(name)

Gets the model with the given name.

* **Parameters:**
  **name** – the name of the model
* **Returns:**
  the Model instance
* **Raises:**
  **ModelError** – if the model was not found

#### has_model_with_filename(model)

Determines whether this manifest contains a model with a conflicting
filename.

* **Parameters:**
  **model** – a Model instance
* **Returns:**
  True/False

#### has_model_with_name(name)

Determines whether this manifest contains the model with the
given name.

* **Parameters:**
  **name** – the model name
* **Returns:**
  True/False

#### *static* make_manifest_path(models_dir)

Makes the manifest path for the given models directory.

* **Parameters:**
  **models_dir** – the models directory
* **Returns:**
  the manifest path

#### merge(models_manifest, error_level=0)

Merges the models manifest into this one.

* **Parameters:**
  * **models_manifest** – a ModelsManifest
  * **error_level** – 

    the error level to use, defined as:

    0: raise error if a model cannot be added
    1: log warning if a model cannot be added
    2: ignore models that cannot be added

#### remove_model(name, error_level=0)

Removes the model with the given name from the ModelsManifest.

* **Parameters:**
  * **name** – the name of the model
  * **error_level** – 

    the error level to use, defined as:

    0: raise error if the model cannot be added
    1: log warning if the model cannot be added
    2: ignore models that cannot be added

#### serialize(reflective=False)

Serializes the object into a dictionary.

Serialization is applied recursively to all attributes in the object,
including element-wise serialization of lists and dictionary values.

* **Parameters:**
  **reflective** – whether to include reflective attributes when
  serializing the object. By default, this is False
* **Returns:**
  a JSON dictionary representation of the object

#### *property* subdir

#### to_str(pretty_print=True, \*\*kwargs)

Returns a string representation of this object.

* **Parameters:**
  * **pretty_print** – whether to render the JSON in human readable format
    with newlines and indentations. By default, this is True
  * **\*\*kwargs** – optional keyword arguments for `self.serialize()`
* **Returns:**
  a string representation of the object

#### write_json(path, pretty_print=False, \*\*kwargs)

Serializes the object and writes it to disk.

* **Parameters:**
  * **path** – the output path
  * **pretty_print** – whether to render the JSON in human readable format
    with newlines and indentations. By default, this is False
  * **\*\*kwargs** – optional keyword arguments for `self.serialize()`

#### write_to_dir(models_dir)

Writes the ModelsManifest to the given models directory.

* **Parameters:**
  **models_dir** – the models directory

### *class* fiftyone.zoo.models.RemoteZooModelsManifest(models=None, name=None, url=None)

Bases: [`ZooModelsManifest`](#fiftyone.zoo.models.ZooModelsManifest)

Class that describes the collection of remotely-sourced models in the
FiftyOne Model Zoo.

* **Parameters:**
  **models** – a list of [`RemoteZooModel`](#fiftyone.zoo.models.RemoteZooModel) instances

**Methods:**

| [`add_model`](#fiftyone.zoo.models.RemoteZooModelsManifest.add_model)(model[, error_level])                                  | Adds the given model to the manifest.                                                 |
|------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| [`attributes`](#fiftyone.zoo.models.RemoteZooModelsManifest.attributes)()                                                    | Returns a list of class attributes to be serialized.                                  |
| [`copy`](#fiftyone.zoo.models.RemoteZooModelsManifest.copy)()                                                                | Returns a deep copy of the object.                                                    |
| [`custom_attributes`](#fiftyone.zoo.models.RemoteZooModelsManifest.custom_attributes)([dynamic, private])                    | Returns a customizable list of class attributes.                                      |
| [`dir_has_manifest`](#fiftyone.zoo.models.RemoteZooModelsManifest.dir_has_manifest)(models_dir)                              | Determines whether the given directory has a models manifest.                         |
| [`from_dict`](#fiftyone.zoo.models.RemoteZooModelsManifest.from_dict)(d)                                                     | Constructs a ModelsManifest from a JSON dictionary.                                   |
| [`from_dir`](#fiftyone.zoo.models.RemoteZooModelsManifest.from_dir)(models_dir)                                              | Loads the ModelsManifest from the given models directory.                             |
| [`from_json`](#fiftyone.zoo.models.RemoteZooModelsManifest.from_json)(path, \*args, \*\*kwargs)                              | Constructs a Serializable object from a JSON file.                                    |
| [`from_str`](#fiftyone.zoo.models.RemoteZooModelsManifest.from_str)(s, \*args, \*\*kwargs)                                   | Constructs a Serializable object from a JSON string.                                  |
| [`get_class_name`](#fiftyone.zoo.models.RemoteZooModelsManifest.get_class_name)()                                            | Returns the fully-qualified class name string of this object.                         |
| [`get_latest_model_with_base_name`](#fiftyone.zoo.models.RemoteZooModelsManifest.get_latest_model_with_base_name)(base_name) | Gets the Model instance for the latest version of the model with the given base name. |
| [`get_model_with_name`](#fiftyone.zoo.models.RemoteZooModelsManifest.get_model_with_name)(name)                              | Gets the model with the given name.                                                   |
| [`has_model_with_filename`](#fiftyone.zoo.models.RemoteZooModelsManifest.has_model_with_filename)(model)                     | Determines whether this manifest contains a model with a conflicting filename.        |
| [`has_model_with_name`](#fiftyone.zoo.models.RemoteZooModelsManifest.has_model_with_name)(name)                              | Determines whether this manifest contains the model with the given name.              |
| [`make_manifest_path`](#fiftyone.zoo.models.RemoteZooModelsManifest.make_manifest_path)(models_dir)                          | Makes the manifest path for the given models directory.                               |
| [`merge`](#fiftyone.zoo.models.RemoteZooModelsManifest.merge)(models_manifest[, error_level])                                | Merges the models manifest into this one.                                             |
| [`remove_model`](#fiftyone.zoo.models.RemoteZooModelsManifest.remove_model)(name[, error_level])                             | Removes the model with the given name from the ModelsManifest.                        |
| [`serialize`](#fiftyone.zoo.models.RemoteZooModelsManifest.serialize)([reflective])                                          | Serializes the object into a dictionary.                                              |
| [`to_str`](#fiftyone.zoo.models.RemoteZooModelsManifest.to_str)([pretty_print])                                              | Returns a string representation of this object.                                       |
| [`write_json`](#fiftyone.zoo.models.RemoteZooModelsManifest.write_json)(path[, pretty_print])                                | Serializes the object and writes it to disk.                                          |
| [`write_to_dir`](#fiftyone.zoo.models.RemoteZooModelsManifest.write_to_dir)(models_dir)                                      | Writes the ModelsManifest to the given models directory.                              |

**Attributes:**

| [`subdir`](#fiftyone.zoo.models.RemoteZooModelsManifest.subdir)   |    |
|-------------------------------------------------------------------|----|

#### add_model(model, error_level=0)

Adds the given model to the manifest.

* **Parameters:**
  * **model** – a Model instance
  * **error_level** – 

    the error level to use, defined as:

    0: raise error if the model cannot be added
    1: log warning if the model cannot be added
    2: ignore models that cannot be added

#### attributes()

Returns a list of class attributes to be serialized.

This method is called internally by `serialize()` to determine the
class attributes to serialize.

Subclasses can override this method, but, by default, all attributes in
vars(self) are returned, minus private attributes, i.e., those starting
with “_”. The order of the attributes in this list is preserved when
serializing objects, so a common pattern is for subclasses to override
this method if they want their JSON files to be organized in a
particular way.

* **Returns:**
  a list of class attributes to be serialized

#### copy()

Returns a deep copy of the object.

* **Returns:**
  a Serializable instance

#### custom_attributes(dynamic=False, private=False)

Returns a customizable list of class attributes.

By default, all attributes in vars(self) are returned, minus private
attributes (those starting with “_”).

* **Parameters:**
  * **dynamic** – whether to include dynamic properties, e.g., those defined
    by getter/setter methods or the `@property` decorator. By
    default, this is False
  * **private** – whether to include private properties, i.e., those
    starting with “_”. By default, this is False
* **Returns:**
  a list of class attributes

#### *static* dir_has_manifest(models_dir)

Determines whether the given directory has a models manifest.

* **Parameters:**
  **models_dir** – the models directory
* **Returns:**
  True/False

#### *classmethod* from_dict(d)

Constructs a ModelsManifest from a JSON dictionary.

* **Parameters:**
  **d** – a JSON dictionary
* **Returns:**
  a ModelsManifest

#### *classmethod* from_dir(models_dir)

Loads the ModelsManifest from the given models directory.

* **Parameters:**
  **models_dir** – the models directory
* **Returns:**
  a ModelsManifest

#### *classmethod* from_json(path, \*args, \*\*kwargs)

Constructs a Serializable object from a JSON file.

Subclasses may override this method, but, by default, this method
simply reads the JSON and calls from_dict(), which subclasses must
implement.

* **Parameters:**
  * **path** – the path to the JSON file on disk
  * **\*args** – optional positional arguments for `self.from_dict()`
  * **\*\*kwargs** – optional keyword arguments for `self.from_dict()`
* **Returns:**
  an instance of the Serializable class

#### *classmethod* from_str(s, \*args, \*\*kwargs)

Constructs a Serializable object from a JSON string.

Subclasses may override this method, but, by default, this method
simply parses the string and calls from_dict(), which subclasses must
implement.

* **Parameters:**
  * **s** – a JSON string representation of a Serializable object
  * **\*args** – optional positional arguments for `self.from_dict()`
  * **\*\*kwargs** – optional keyword arguments for `self.from_dict()`
* **Returns:**
  an instance of the Serializable class

#### *classmethod* get_class_name()

Returns the fully-qualified class name string of this object.

#### get_latest_model_with_base_name(base_name)

Gets the Model instance for the latest version of the model with the
given base name.

* **Parameters:**
  **base_name** – the base name of the model
* **Returns:**
  the Model instance
* **Raises:**
  **ModelError** – if the model was not found

#### get_model_with_name(name)

Gets the model with the given name.

* **Parameters:**
  **name** – the name of the model
* **Returns:**
  the Model instance
* **Raises:**
  **ModelError** – if the model was not found

#### has_model_with_filename(model)

Determines whether this manifest contains a model with a conflicting
filename.

* **Parameters:**
  **model** – a Model instance
* **Returns:**
  True/False

#### has_model_with_name(name)

Determines whether this manifest contains the model with the
given name.

* **Parameters:**
  **name** – the model name
* **Returns:**
  True/False

#### *static* make_manifest_path(models_dir)

Makes the manifest path for the given models directory.

* **Parameters:**
  **models_dir** – the models directory
* **Returns:**
  the manifest path

#### merge(models_manifest, error_level=0)

Merges the models manifest into this one.

* **Parameters:**
  * **models_manifest** – a ModelsManifest
  * **error_level** – 

    the error level to use, defined as:

    0: raise error if a model cannot be added
    1: log warning if a model cannot be added
    2: ignore models that cannot be added

#### remove_model(name, error_level=0)

Removes the model with the given name from the ModelsManifest.

* **Parameters:**
  * **name** – the name of the model
  * **error_level** – 

    the error level to use, defined as:

    0: raise error if the model cannot be added
    1: log warning if the model cannot be added
    2: ignore models that cannot be added

#### serialize(reflective=False)

Serializes the object into a dictionary.

Serialization is applied recursively to all attributes in the object,
including element-wise serialization of lists and dictionary values.

* **Parameters:**
  **reflective** – whether to include reflective attributes when
  serializing the object. By default, this is False
* **Returns:**
  a JSON dictionary representation of the object

#### *property* subdir

#### to_str(pretty_print=True, \*\*kwargs)

Returns a string representation of this object.

* **Parameters:**
  * **pretty_print** – whether to render the JSON in human readable format
    with newlines and indentations. By default, this is True
  * **\*\*kwargs** – optional keyword arguments for `self.serialize()`
* **Returns:**
  a string representation of the object

#### write_json(path, pretty_print=False, \*\*kwargs)

Serializes the object and writes it to disk.

* **Parameters:**
  * **path** – the output path
  * **pretty_print** – whether to render the JSON in human readable format
    with newlines and indentations. By default, this is False
  * **\*\*kwargs** – optional keyword arguments for `self.serialize()`

#### write_to_dir(models_dir)

Writes the ModelsManifest to the given models directory.

* **Parameters:**
  **models_dir** – the models directory
