ImageTensor

class ImageTensor<T : DType, V>(builder: TensorBuilder<T, V>)(source)

Creates image tensors in BCHW (Batch, Channel, Height, Width) format

Constructors

Link copied to clipboard
constructor(builder: TensorBuilder<T, V>)

Functions

Link copied to clipboard
fun bchw(batchSize: Int, channels: Int, height: Int, width: Int): ShapeBuilder<T, V>

Creates a 4D tensor for image batch in BCHW format

Link copied to clipboard
fun chw(channels: Int, height: Int, width: Int): ShapeBuilder<T, V>

Creates a single image tensor in CHW format

Link copied to clipboard
fun grayscale(height: Int, width: Int): ShapeBuilder<T, V>

Creates a grayscale image tensor (single channel)

Link copied to clipboard
fun rgb(height: Int, width: Int): ShapeBuilder<T, V>

Creates an RGB image tensor (3 channels)

Link copied to clipboard
fun rgba(height: Int, width: Int): ShapeBuilder<T, V>

Creates an RGBA image tensor (4 channels)