image

package
v0.15.0-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 19 Imported by: 0

README

---
title: "Image"
lang: "en-US"
draft: false
description: "Learn about how to set up a VDP Image operator https://github.com/instill-ai/instill-core"
---

The Image component is an operator that allows users to manipulate image files.
It can carry out the following tasks:

- [Draw Classification](#draw-classification)
- [Draw Detection](#draw-detection)
- [Draw Keypoint](#draw-keypoint)
- [Draw Ocr](#draw-ocr)
- [Draw Instance Segmentation](#draw-instance-segmentation)
- [Draw Semantic Segmentation](#draw-semantic-segmentation)

## Release Stage

`Alpha`

## Configuration

The component configuration is defined and maintained [here](https://github.com/instill-ai/component/blob/main/pkg/operator/image/v0/config/definition.json).

## Supported Tasks

### 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 | `showScore` | 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 | `showScore` | boolean | Show model confidence score on each instance |

| 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 | `showScore` | boolean | Show model confidence score on each instance |

| 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 | `showScore` | boolean | Show model confidence score on each instance |

| 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 | `showScore` | boolean | Show model confidence score on each instance |

| 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 |
| Show Score | `showScore` | boolean | Show model confidence score on each instance |
| Stuffs (required) | `stuffs` | array[object] | A list of RLE binary masks. |

| Output | ID | Type | Description |
| :--- | :--- | :--- | :--- |
| Image | `image` | string | Output image |

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IBMPlexSansRegular = []byte{} /* 175232 elements not displayed */

IBMPlexSansRegular is the font byte array

Functions

func Init

func Init(l *zap.Logger, u base.UsageHandler) *operator

Init initializes the operator

Types

type BoundingBox

type BoundingBox struct {
	Top    int
	Left   int
	Width  int
	Height int
}

BoundingBox holds the coordinates of a bounding box.

func (*BoundingBox) Size

func (b *BoundingBox) Size() int

Size returns the area of the bounding box.

type Keypoint

type Keypoint struct {
	// contains filtered or unexported fields
}

Keypoint holds the coordinates of a keypoint.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL