title: "Image"
lang: "en-US"
draft: false
description: "Learn about how to set up a VDP Image component https://github.com/instill-ai/instill-core"
The Image component is an operator component that allows users to manipulate image files.
It can carry out the following tasks:
Release Stage
Alpha
Configuration
The component definition and tasks are defined in the definition.json and tasks.json files respectively.
Supported Tasks
Concat
Concatenate images horizontally or vertically. All images must have the same width and height. If grid-width
and grid-height
are not provided, the images will be concatenated to a square grid.
Input | ID | Type | Description |
---|
Task ID (required) | task | string | TASK_CONCAT |
Images (required) | images | array | Input images |
Grid Width | grid-width | integer | Grid width. If grid-width is provided, grid-height will be ignored. |
Grid Height | grid-height | integer | Grid height. If grid-height is provided, grid-width will be ignored. |
Padding | padding | integer | Padding between images. If padding is provided, it will be applied to all four sides of the image. |
Output | ID | Type | Description |
---|
Image | image | string | Output image |
Crop
Crop image to the specified size.
Input | ID | Type | Description |
---|
Task ID (required) | task | string | TASK_CROP |
Image (required) | image | string | Input image |
Corner Radius | corner-radius | integer | Radius from the corner of the image to crop the image. If corner-radius is provided, circle-radius will be ignored. If the corner-radius is larger than half of min(width, height), the min(width, height) will be applied to corner-radius . |
Circle Radius | circle-radius | integer | Radius from the center of the circle to crop the image. If circle-radius is provided, corner-radius will be ignored. If the circle-radius is larger than half of min(width, height), the min(width, height) will be applied to circle-radius . |
Top Offset | top-offset | integer | Top offset of the crop |
Right Offset | right-offset | integer | Right offset of the crop |
Bottom Offset | bottom-offset | integer | Bottom offset of the crop |
Left Offset | left-offset | integer | Left offset of the crop |
Output | ID | Type | Description |
---|
Image | image | string | Output image |
Resize
Resize image to the specified size.
Input | ID | Type | Description |
---|
Task ID (required) | task | string | TASK_RESIZE |
Image (required) | image | string | Input image |
Ratio | ratio | number | Resize ratio (e.g., 0.5 for half size, 2 for double size) to resize the image. If ratio is provided, width and height will be ignored. |
Width | width | integer | Width of the output image. |
Height | height | integer | Height of the output image. |
Output | ID | Type | Description |
---|
Image | image | string | Output image |
Draw Classification
Draw classification result on the image.
Input | ID | Type | Description |
---|
Task ID (required) | task | string | TASK_DRAW_CLASSIFICATION |
Category (required) | category | string | The predicted category of the input. |
Image (required) | image | string | Input image |
Show Score | show-score | boolean | Show model confidence score on each instance |
Score (required) | score | number | The confidence score of the predicted category of the input. |
Output | ID | Type | Description |
---|
Image | image | string | Output image |
Draw Detection
Draw detection result on the image.
Input | ID | Type | Description |
---|
Task ID (required) | task | string | TASK_DRAW_DETECTION |
Image (required) | image | string | Input image |
Objects (required) | objects | array[object] | A list of detected objects. |
Show Score | show-score | boolean | Show model confidence score on each instance |
Input Objects in Draw Detection
Objects
A list of detected objects.
Field | Field ID | Type | Note |
---|
Bounding box | bounding-box | object | The detected bounding box in (left, top, width, height) format. |
Category | category | string | The predicted category of the bounding box. |
Score | score | number | The confidence score of the predicted category of the bounding box. |
Bounding Box
The detected bounding box in (left, top, width, height) format.
Field | Field ID | Type | Note |
---|
Height | height | number | Bounding box height value |
Left | left | number | Bounding box left x-axis value |
Top | top | number | Bounding box top y-axis value |
Width | width | number | Bounding box width value |
Output | ID | Type | Description |
---|
Image | image | string | Output image |
Draw Keypoint
Draw keypoint result on the image.
Input | ID | Type | Description |
---|
Task ID (required) | task | string | TASK_DRAW_KEYPOINT |
Image (required) | image | string | Input image |
Objects (required) | objects | array[object] | A list of keypoint objects, a keypoint object includes all the pre-defined keypoints of a detected object. |
Show Score | show-score | boolean | Show model confidence score on each instance |
Input Objects in Draw Keypoint
Objects
A list of keypoint objects, a keypoint object includes all the pre-defined keypoints of a detected object.
Field | Field ID | Type | Note |
---|
Bounding Box | bounding-box | object | The detected bounding box in (left, top, width, height) format. |
Keypoints | keypoints | array | A keypoint group is composed of a list of pre-defined keypoints of a detected object. |
Score | score | number | The confidence score of the predicted object. |
Keypoints
A keypoint group is composed of a list of pre-defined keypoints of a detected object.
Field | Field ID | Type | Note |
---|
Visibility Score | v | number | visibility score of the keypoint. |
X Coordinate | x | number | x coordinate of the keypoint. |
Y Coordinate | y | number | y coordinate of the keypoint. |
Bounding Box
The detected bounding box in (left, top, width, height) format.
Field | Field ID | Type | Note |
---|
Height | height | number | Bounding box height value |
Left | left | number | Bounding box left x-axis value |
Top | top | number | Bounding box top y-axis value |
Width | width | number | Bounding box width value |
Output | ID | Type | Description |
---|
Image | image | string | Output image |
Draw OCR
Draw OCR result on the image.
Input | ID | Type | Description |
---|
Task ID (required) | task | string | TASK_DRAW_OCR |
Image (required) | image | string | Input image |
Objects (required) | objects | array[object] | A list of detected bounding boxes. |
Show Score | show-score | boolean | Show model confidence score on each instance |
Input Objects in Draw OCR
Objects
A list of detected bounding boxes.
Field | Field ID | Type | Note |
---|
Bounding Box | bounding-box | object | The detected bounding box in (left, top, width, height) format. |
Score | score | number | The confidence score of the predicted object. |
Text | text | string | Text string recognised per bounding box. |
Bounding Box
The detected bounding box in (left, top, width, height) format.
Field | Field ID | Type | Note |
---|
Height | height | number | Bounding box height value |
Left | left | number | Bounding box left x-axis value |
Top | top | number | Bounding box top y-axis value |
Width | width | number | Bounding box width value |
Output | ID | Type | Description |
---|
Image | image | string | Output image |
Draw Instance Segmentation
Draw instance segmentation result on the image.
Input | ID | Type | Description |
---|
Task ID (required) | task | string | TASK_DRAW_INSTANCE_SEGMENTATION |
Image (required) | image | string | Input image |
Objects (required) | objects | array[object] | A list of detected instance bounding boxes. |
Show Score | show-score | boolean | Show model confidence score on each instance |
Input Objects in Draw Instance Segmentation
Objects
A list of detected instance bounding boxes.
Field | Field ID | Type | Note |
---|
Bounding Box | bounding-box | object | The detected bounding box in (left, top, width, height) format. |
Category | category | string | The predicted category of the bounding box. |
RLE | rle | string | Run Length Encoding (RLE) of instance mask within the bounding box. |
Score | score | number | The confidence score of the predicted instance object. |
Bounding Box
The detected bounding box in (left, top, width, height) format.
Field | Field ID | Type | Note |
---|
Height | height | number | Bounding box height value |
Left | left | number | Bounding box left x-axis value |
Top | top | number | Bounding box top y-axis value |
Width | width | number | Bounding box width value |
Output | ID | Type | Description |
---|
Image | image | string | Output image |
Draw Semantic Segmentation
Draw semantic segmentation result on the image.
Input | ID | Type | Description |
---|
Task ID (required) | task | string | TASK_DRAW_SEMANTIC_SEGMENTATION |
Image (required) | image | string | Input image |
Stuffs (required) | stuffs | array[object] | A list of RLE binary masks. |
Input Objects in Draw Semantic Segmentation
Stuffs
A list of RLE binary masks.
Field | Field ID | Type | Note |
---|
Category | category | string | Category text string corresponding to each stuff mask. |
RLE | rle | string | Run Length Encoding (RLE) of each stuff mask within the image. |
Output | ID | Type | Description |
---|
Image | image | string | Output image |