image

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package image implements helpers for image models.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PreprocessGraph

func PreprocessGraph[T NodeOrFloats](x *Node, targetHeight, targetWidth int, mean, std T) *Node

PreprocessGraph takes an image tensor of shape [batch, height, width, channels] (or [height, width, channels]), resizes it to targetHeight x targetWidth using bilinear interpolation, converts it to channels-first [batch, channels, targetHeight, targetWidth], and normalizes it with the given mean and std.

The parameters mean and std can be either given as a Node or as a slice of floats (float32 or float64) and should have shape [channels].

Types

type NodeOrFloats

type NodeOrFloats interface{ *Node | []float32 | []float64 }

NodeOrFloat constraints to a *Node or a []float32 or []float64.

Jump to

Keyboard shortcuts

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