imageutil

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadImagesFromPaths

func LoadImagesFromPaths(paths []string) ([]image.Image, error)

Types

type CenterCropPreprocessor

type CenterCropPreprocessor struct {
	// contains filtered or unexported fields
}

func CenterCropStep

func CenterCropStep(targetWidth, targetHeight int) *CenterCropPreprocessor

func (*CenterCropPreprocessor) Apply

type NormalizationStep

type NormalizationStep interface {
	Apply(r, g, b float32) (float32, float32, float32)
}

type PixelNormalizationPreprocessor

type PixelNormalizationPreprocessor struct {
	// contains filtered or unexported fields
}

func CLIPPixelNormalizationStep added in v0.6.0

func CLIPPixelNormalizationStep() *PixelNormalizationPreprocessor

CLIPPixelNormalizationStep returns CLIP's normalization values. Use after RescaleStep() to normalize to 0-1 range first.

func ImagenetPixelNormalizationStep

func ImagenetPixelNormalizationStep() *PixelNormalizationPreprocessor

func PixelNormalizationStep

func PixelNormalizationStep(mean, std [3]float32) *PixelNormalizationPreprocessor

func (*PixelNormalizationPreprocessor) Apply

type PreprocessStep

type PreprocessStep interface {
	Apply(img image.Image) (image.Image, error)
}

type RescalePreprocessor

type RescalePreprocessor struct{}

func RescaleStep

func RescaleStep() *RescalePreprocessor

func (*RescalePreprocessor) Apply

func (s *RescalePreprocessor) Apply(r, g, b float32) (float32, float32, float32)

type ResizePreprocessor

type ResizePreprocessor struct {
	// contains filtered or unexported fields
}

func ResizeStep

func ResizeStep(targetSize int) *ResizePreprocessor

func (*ResizePreprocessor) Apply

func (s *ResizePreprocessor) Apply(img image.Image) (image.Image, error)

Jump to

Keyboard shortcuts

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