Vision Models
4 nodes
On this page 4
Classify Image
FunctionThe 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: Integerstring[] ClassifyImage(
ImageClassifier classifier,
PixelImage image,
int top,
out double[] scores)Parameters
| name | type | default | description |
|---|---|---|---|
| classifier | Image Classifier | — | An image classifier. |
| image | Pixel Image | — | The picture. |
| top | Integer | — | How many labels to give. |
Returns
| Labels | Text Array |
| scores | Number Array |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Vision Models
- Package
- Machine Learning
Classify Image Zero-Shot
FunctionScores 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: Textstring[] ClassifyImageZeroShot(
ZeroShotImageClassifier classifier,
PixelImage image,
string[] labels,
string template,
out double[] scores)Parameters
| name | type | default | description |
|---|---|---|---|
| classifier | Zero Shot Image Classifier | — | A zero-shot image classifier. |
| image | Pixel Image | — | The picture. |
| labels | Text Array | — | The candidate labels, such as "a cat", "a dog", "a car". |
| template | Text | — | The sentence each label is put into before it is compared; {} stands for the label. |
Returns
| Labels | Text Array |
| scores | Number Array |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Vision Models
- Package
- Machine Learning
Load Image Classifier
FunctionLoads an image classifier and its image processor from a Hub repository or a folder.
Signature
LoadImageClassifier -> Image Classifier
model: Text
device: Compute Device
precision: PrecisionImageClassifier LoadImageClassifier(
string model,
ComputeDevice device = ComputeDevice.Auto,
Precision precision = Precision.Auto)Parameters
| name | type | default | description |
|---|---|---|---|
| model | Text | — | A repository id such as google/vit-base-patch16-224, or a folder. |
| device | Compute Device | Auto | Where it runs. |
| precision | Precision | Auto | The number format of its weights. |
Returns
| Classifier | Image 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
FunctionLoads 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: PrecisionZeroShotImageClassifier LoadZeroShotImageClassifier(
string model,
ComputeDevice device = ComputeDevice.Auto,
Precision precision = Precision.Auto)Parameters
| name | type | default | description |
|---|---|---|---|
| model | Text | — | A repository id such as openai/clip-vit-base-patch32 or google/siglip-base-patch16-224, or a folder. |
| device | Compute Device | Auto | Where it runs. |
| precision | Precision | Auto | The number format of its weights. |
Returns
| Classifier | Zero Shot Image Classifier |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Vision Models
- Package
- Machine Learning