class documentation

class ModelZooApplyCommand(Command): (source)

View In Hierarchy

Apply zoo models to datasets.

When applying remotely-sourced zoo models, you can provide any of the following formats:

  • 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

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.

Examples:

# Apply a zoo model to a dataset
fiftyone zoo models apply <model-name> <dataset-name> <label-field>

# Apply a remotely-sourced zoo model to a dataset
fiftyone zoo models apply https://github.com/<user>/<repo> \
    <dataset-name> <label-field> --model-name <model-name>
fiftyone zoo models apply <url> \
    <dataset-name> <label-field> --model-name <model-name>

# Apply a zoo model with some customized parameters
fiftyone zoo models apply \
    <model-name> <dataset-name> <label-field> \
    --confidence-thresh 0.7 \
    --store-logits \
    --batch-size 32
Static Method execute Executes the command on the given args.
Static Method setup Setup the command-line arguments for the command.
@staticmethod
def execute(parser, args): (source)

Executes the command on the given args.

Parameters
parserthe argparse.ArgumentParser instance for the command
argsan argparse.Namespace instance containing the arguments for the command
@staticmethod
def setup(parser): (source)

Setup the command-line arguments for the command.

Parameters
parseran argparse.ArgumentParser instance