ScoutBot CLI

ScoutBot is the machine learning interface for the Wild Me Scout project. This page specifies the Command Line Interface (CLI) to interact with all of the algorithms and machine learning models that have been pretrained for inference in a production environment.

scoutbot

ScoutBot CLI

scoutbot [OPTIONS] COMMAND [ARGS]...

batch

Run the ScoutBot pipeline in batch on a list of input image filepaths. An example output of the JSON can be seen below.

{
    '/path/to/image1.ext': {
        'wic': 0.5,
        'loc': [
            {
                'l': 'elephant',
                'c': 0.9,
                'x': 100,
                'y': 100,
                'w': 50,
                'h': 10
            },
            ...
        ],
    },
    '/path/to/image2.ext': {
        'wic': 0.5,
        'loc': [
            {
                'l': 'elephant',
                'c': 0.9,
                'x': 100,
                'y': 100,
                'w': 50,
                'h': 10
            },
            ...
        ],
    },
    ...
}
scoutbot batch [OPTIONS] [FILEPATHS]...

Options

--config <config>

Which ML models to use for inference

Options:

phase1 | mvp | old | new

--output <output>

Path to output JSON (if unspecified, results are printed to screen)

--wic_thresh <wic_thresh>

Whole Image Classifier (WIC) confidence threshold

--loc_thresh <loc_thresh>

Localizer (LOC) confidence threshold

--loc_nms_thresh <loc_nms_thresh>

Localizer (LOC) non-maximum suppression (NMS) threshold

--agg_thresh <agg_thresh>

Aggregation (AGG) confidence threshold

--agg_nms_thresh <agg_nms_thresh>

Aggregation (AGG) non-maximum suppression (NMS) threshold

Arguments

FILEPATHS

Optional argument(s)

example

Run a test of the pipeline on an example image with the default configuration.

scoutbot example [OPTIONS]

fetch

Fetch the required machine learning ONNX models for the WIC and LOC

scoutbot fetch [OPTIONS]

Options

--config <config>

Which ML models to use for inference

Options:

phase1 | mvp | old | new

pipeline

Run the ScoutBot pipeline on an input image filepath. An example output of the JSON can be seen below.

{
    '/path/to/image.ext': {
        'wic': 0.5,
        'loc': [
            {
                'l': 'elephant',
                'c': 0.9,
                'x': 100,
                'y': 100,
                'w': 50,
                'h': 10
            },
            ...
        ],
    }
}
scoutbot pipeline [OPTIONS] FILEPATH

Options

--config <config>

Which ML models to use for inference

Options:

phase1 | mvp | old | new

--output <output>

Path to output JSON (if unspecified, results are printed to screen)

--wic_thresh <wic_thresh>

Whole Image Classifier (WIC) confidence threshold

--loc_thresh <loc_thresh>

Localizer (LOC) confidence threshold

--loc_nms_thresh <loc_nms_thresh>

Localizer (LOC) non-maximum suppression (NMS) threshold

--agg_thresh <agg_thresh>

Aggregation (AGG) confidence threshold

--agg_nms_thresh <agg_nms_thresh>

Aggregation (AGG) non-maximum suppression (NMS) threshold

Arguments

FILEPATH

Required argument

Environment Variables

The Scoutbot API and CLI have two environment variables (envars) that allow you to configure global settings and configurations.

  • CONFIG (default: mvp)

    The configuration setting for which machine lerning models to use. Must be one of phase1 or mvp, or their respective aliases as old or new.

  • WIC_CONFIG (default: not set)

    The configuration setting for which machine lerning models to use with the WIC. Must be one of phase1 or mvp, or their respective aliases as old or new. Defaults to the value of the CONFIG environment variable.

  • LOC_CONFIG (default: not set)

    The configuration setting for which machine lerning models to use with the LOC. Must be one of phase1 or mvp, or their respective aliases as old or new. Defaults to the value of the CONFIG environment variable.

  • AGG_CONFIG (default: not set)

    The configuration setting for which machine lerning models to use with the AGG. Must be one of phase1 or mvp, or their respective aliases as old or new. Defaults to the value of the CONFIG environment variable.

  • WIC_BATCH_SIZE (default: 256)

    The configuration setting for how many tiles to send to the GPU in a single batch during the WIC prediction (forward inference). The LOC model has a fixed batch size (16 for phase1 and 32 for mvp) and cannot be adjusted. This setting can be used to control how fast the pipeline runs, as a trade-off of faster compute for more memory usage. It is highly suggested to set this value as high as possible to fit into the GPU.

  • FAST (default: not set)

    A flag that can be set to turn off extracting the second grid of tiles. Defaults to “not set”, which translates to the standard process of extracting all tiles for grid1 and grid2. Setting this value to anything will turn off grid2 and results in faster (but less accurate) detections (e.g., FAST=1).

  • VERBOSE (default: not set)

    A verbosity flag that can be set to turn on debug logging. Defaults to “not set”, which translates to no debug logging. Setting this value to anything will turn on debug logging (e.g., VERBOSE=1).