Image

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.

InputIDTypeDescription
Task ID (required)taskstringTASK_CONCAT
Images (required)imagesarrayInput images
Grid Widthgrid-widthintegerGrid width. If grid-width is provided, grid-height will be ignored.
Grid Heightgrid-heightintegerGrid height. If grid-height is provided, grid-width will be ignored.
PaddingpaddingintegerPadding between images. If padding is provided, it will be applied to all four sides of the image.
OutputIDTypeDescription
ImageimagestringOutput image

#Crop

Crop image to the specified size.

InputIDTypeDescription
Task ID (required)taskstringTASK_CROP
Image (required)imagestringInput image
Corner Radiuscorner-radiusintegerRadius 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 Radiuscircle-radiusintegerRadius 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 Offsettop-offsetintegerTop offset of the crop
Right Offsetright-offsetintegerRight offset of the crop
Bottom Offsetbottom-offsetintegerBottom offset of the crop
Left Offsetleft-offsetintegerLeft offset of the crop
OutputIDTypeDescription
ImageimagestringOutput image

#Resize

Resize image to the specified size.

InputIDTypeDescription
Task ID (required)taskstringTASK_RESIZE
Image (required)imagestringInput image
RatiorationumberResize 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.
WidthwidthintegerWidth of the output image.
HeightheightintegerHeight of the output image.
OutputIDTypeDescription
ImageimagestringOutput image

#Draw Classification

Draw classification result on the image.

InputIDTypeDescription
Task ID (required)taskstringTASK_DRAW_CLASSIFICATION
Category (required)categorystringThe predicted category of the input.
Image (required)imagestringInput image
Show Scoreshow-scorebooleanShow model confidence score on each instance
Score (required)scorenumberThe confidence score of the predicted category of the input.
OutputIDTypeDescription
ImageimagestringOutput image

#Draw Detection

Draw detection result on the image.

InputIDTypeDescription
Task ID (required)taskstringTASK_DRAW_DETECTION
Image (required)imagestringInput image
Objects (required)objectsarray[object]A list of detected objects.
Show Scoreshow-scorebooleanShow model confidence score on each instance
Input Objects in Draw Detection

Objects

A list of detected objects.

FieldField IDTypeNote
Bounding boxbounding-boxobjectThe detected bounding box in (left, top, width, height) format.
CategorycategorystringThe predicted category of the bounding box.
ScorescorenumberThe confidence score of the predicted category of the bounding box.

Bounding Box

The detected bounding box in (left, top, width, height) format.

FieldField IDTypeNote
HeightheightnumberBounding box height value
LeftleftnumberBounding box left x-axis value
ToptopnumberBounding box top y-axis value
WidthwidthnumberBounding box width value
OutputIDTypeDescription
ImageimagestringOutput image

#Draw Keypoint

Draw keypoint result on the image.

InputIDTypeDescription
Task ID (required)taskstringTASK_DRAW_KEYPOINT
Image (required)imagestringInput image
Objects (required)objectsarray[object]A list of keypoint objects, a keypoint object includes all the pre-defined keypoints of a detected object.
Show Scoreshow-scorebooleanShow 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.

FieldField IDTypeNote
Bounding Boxbounding-boxobjectThe detected bounding box in (left, top, width, height) format.
KeypointskeypointsarrayA keypoint group is composed of a list of pre-defined keypoints of a detected object.
ScorescorenumberThe confidence score of the predicted object.

Keypoints

A keypoint group is composed of a list of pre-defined keypoints of a detected object.

FieldField IDTypeNote
Visibility Scorevnumbervisibility score of the keypoint.
X Coordinatexnumberx coordinate of the keypoint.
Y Coordinateynumbery coordinate of the keypoint.

Bounding Box

The detected bounding box in (left, top, width, height) format.

FieldField IDTypeNote
HeightheightnumberBounding box height value
LeftleftnumberBounding box left x-axis value
ToptopnumberBounding box top y-axis value
WidthwidthnumberBounding box width value
OutputIDTypeDescription
ImageimagestringOutput image

#Draw OCR

Draw OCR result on the image.

InputIDTypeDescription
Task ID (required)taskstringTASK_DRAW_OCR
Image (required)imagestringInput image
Objects (required)objectsarray[object]A list of detected bounding boxes.
Show Scoreshow-scorebooleanShow model confidence score on each instance
Input Objects in Draw OCR

Objects

A list of detected bounding boxes.

FieldField IDTypeNote
Bounding Boxbounding-boxobjectThe detected bounding box in (left, top, width, height) format.
ScorescorenumberThe confidence score of the predicted object.
TexttextstringText string recognised per bounding box.

Bounding Box

The detected bounding box in (left, top, width, height) format.

FieldField IDTypeNote
HeightheightnumberBounding box height value
LeftleftnumberBounding box left x-axis value
ToptopnumberBounding box top y-axis value
WidthwidthnumberBounding box width value
OutputIDTypeDescription
ImageimagestringOutput image

#Draw Instance Segmentation

Draw instance segmentation result on the image.

InputIDTypeDescription
Task ID (required)taskstringTASK_DRAW_INSTANCE_SEGMENTATION
Image (required)imagestringInput image
Objects (required)objectsarray[object]A list of detected instance bounding boxes.
Show Scoreshow-scorebooleanShow model confidence score on each instance
Input Objects in Draw Instance Segmentation

Objects

A list of detected instance bounding boxes.

FieldField IDTypeNote
Bounding Boxbounding-boxobjectThe detected bounding box in (left, top, width, height) format.
CategorycategorystringThe predicted category of the bounding box.
RLErlestringRun Length Encoding (RLE) of instance mask within the bounding box.
ScorescorenumberThe confidence score of the predicted instance object.

Bounding Box

The detected bounding box in (left, top, width, height) format.

FieldField IDTypeNote
HeightheightnumberBounding box height value
LeftleftnumberBounding box left x-axis value
ToptopnumberBounding box top y-axis value
WidthwidthnumberBounding box width value
OutputIDTypeDescription
ImageimagestringOutput image

#Draw Semantic Segmentation

Draw semantic segmentation result on the image.

InputIDTypeDescription
Task ID (required)taskstringTASK_DRAW_SEMANTIC_SEGMENTATION
Image (required)imagestringInput image
Stuffs (required)stuffsarray[object]A list of RLE binary masks.
Input Objects in Draw Semantic Segmentation

Stuffs

A list of RLE binary masks.

FieldField IDTypeNote
CategorycategorystringCategory text string corresponding to each stuff mask.
RLErlestringRun Length Encoding (RLE) of each stuff mask within the image.
OutputIDTypeDescription
ImageimagestringOutput image