class

GS::Utils::Image

Inherits Reference < Object

Image class for loaded images

Constructors

new(width : Int32, height : Int32, channels : Int32, data : Array(UInt8))
Source

Instance methods

channels
Source
data
Source
height
Source
to_tensor(device : Tensor::Device = Tensor::Device::CPU) : Tensor

Convert to tensor [height, width, channels] normalized to 0-1

Source
to_tensor_bchw(device : Tensor::Device = Tensor::Device::CPU) : Tensor

Convert to tensor with batch dimension [1, channels, height, width]

Source
to_tensor_chw(device : Tensor::Device = Tensor::Device::CPU) : Tensor

Convert to tensor [channels, height, width] (CHW format) normalized to 0-1

Source
width
Source