Divooka Reference

Vision Models

4 nodes

On this page 4

Classify Image

Function

The labels that best describe a picture, best first, from those the classifier knows.

Signature
ClassifyImage -> (Labels: Text Array, scores: Number Array)
    classifier: Image Classifier
    image: Pixel Image
    top: Integer
string[] ClassifyImage(
    ImageClassifier classifier,
    PixelImage image,
    int top,
    out double[] scores)

Parameters

nametypedefaultdescription
classifierImage Classifier—An image classifier.
imagePixel Image—The picture.
topInteger—How many labels to give.

Returns

LabelsText Array
scoresNumber Array
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vision Models
Package
Machine Learning

Classify Image Zero-Shot

Function

Scores a picture against labels written in words, best first; the scores add up to 1 across the labels given.

Signature
ClassifyImageZeroShot -> (Labels: Text Array, scores: Number Array)
    classifier: Zero Shot Image Classifier
    image: Pixel Image
    labels: Text Array
    template: Text
string[] ClassifyImageZeroShot(
    ZeroShotImageClassifier classifier,
    PixelImage image,
    string[] labels,
    string template,
    out double[] scores)

Parameters

nametypedefaultdescription
classifierZero Shot Image Classifier—A zero-shot image classifier.
imagePixel Image—The picture.
labelsText Array—The candidate labels, such as "a cat", "a dog", "a car".
templateText—The sentence each label is put into before it is compared; {} stands for the label.

Returns

LabelsText Array
scoresNumber Array
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vision Models
Package
Machine Learning

Load Image Classifier

Function

Loads an image classifier and its image processor from a Hub repository or a folder.

Signature
LoadImageClassifier -> Image Classifier
    model: Text
    device: Compute Device
    precision: Precision
ImageClassifier LoadImageClassifier(
    string model,
    ComputeDevice device = ComputeDevice.Auto,
    Precision precision = Precision.Auto)

Parameters

nametypedefaultdescription
modelText—A repository id such as google/vit-base-patch16-224, or a folder.
deviceCompute DeviceAutoWhere it runs.
precisionPrecisionAutoThe number format of its weights.

Returns

ClassifierImage Classifier
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vision Models
Package
Machine Learning

Load Zero-Shot Image Classifier

Function

Loads a zero-shot image classifier (an image and a text model trained together) from a Hub repository or a folder.

Signature
LoadZeroShotImageClassifier -> Zero Shot Image Classifier
    model: Text
    device: Compute Device
    precision: Precision
ZeroShotImageClassifier LoadZeroShotImageClassifier(
    string model,
    ComputeDevice device = ComputeDevice.Auto,
    Precision precision = Precision.Auto)

Parameters

nametypedefaultdescription
modelText—A repository id such as openai/clip-vit-base-patch32 or google/siglip-base-patch16-224, or a folder.
deviceCompute DeviceAutoWhere it runs.
precisionPrecisionAutoThe number format of its weights.

Returns

ClassifierZero Shot Image Classifier
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Vision Models
Package
Machine Learning