class

TensorflowLite::Image::Segmentation

Inherits TensorflowLite::Image::Common < Reference < Object

Constants

OPACITY = UInt16::MAX // 2
TRANSPARENT_PIXEL = StumpyCore::RGBA.new(0_u16, 0_u16, 0_u16, 0_u16)

Class methods

pascal_label_colormap

A Colormap for visualizing segmentation results.

The colormap is an array with 256 elements, each of which is a 3-element array representing an RGB color.

Source

Instance methods

build_image_mask(detection : Detection)

creates a multi-coloured mask of all the detections in the image

Source
process(image : Canvas) : Tuple(Canvas, Detection)

attempts to classify the object, assumes the image has already been prepared

Source
scale_image_mask(image : Canvas, mask : Canvas, left_offset : Int32 = 0, top_offset : Int32 = 0, resize_method : StumpyResize::InterpolationMethod = :bilinear)

scales the mask to fit on the image provided

Source
scale_image_mask(target_width : Int32, target_height : Int32, mask : Canvas, left_offset : Int32 = 0, top_offset : Int32 = 0, resize_method : StumpyResize::InterpolationMethod = :bilinear)

scales the mask to fit the target width and height

Source

Nested types