Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImageData ¶
ImageData represents preprocessed image data ready for model inference
func ProcessImage ¶
func ProcessImage(img image.Image, opts ProcessImageOptions) (*ImageData, error)
ProcessImage preprocesses an image according to the specified options
type ProcessImageOptions ¶
type ProcessImageOptions struct { Width int Height int MinEdge int MaxEdge int Mode ResizeMode Mean [3]float32 StdDev [3]float32 CenterCrop bool }
ProcessImageOptions contains all preprocessing configuration
type ResizeMode ¶
type ResizeMode int
ResizeMode defines how to handle image resizing
const ( // ResizeFixed resizes to exact dimensions ResizeFixed ResizeMode = iota // ResizeAspectFill maintains aspect ratio, fills target size ResizeAspectFill // ResizeAspectFit maintains aspect ratio, fits within target size ResizeAspectFit // ResizeWithEdges maintains aspect ratio with min/max edge constraints ResizeWithEdges )
Click to show internal directories.
Click to hide internal directories.