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 ¶
NodeOrFloat constraints to a *Node or a []float32 or []float64.
Click to show internal directories.
Click to hide internal directories.