Documentation
¶
Index ¶
- func LoadImagesFromPaths(ctx context.Context, paths []string) ([]image.Image, error)
- func ResizeRGB(img image.Image, width, height, resample int) (image.Image, error)
- type CenterCropPreprocessor
- type NormalizationStep
- type PixelNormalizationPreprocessor
- type PreprocessStep
- type RescalePreprocessor
- type ResizePreprocessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadImagesFromPaths ¶
Types ¶
type CenterCropPreprocessor ¶
type CenterCropPreprocessor struct {
// contains filtered or unexported fields
}
func CenterCropStep ¶
func CenterCropStep(targetWidth, targetHeight int) *CenterCropPreprocessor
type NormalizationStep ¶
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
type RescalePreprocessor ¶
type RescalePreprocessor struct{}
func RescaleStep ¶
func RescaleStep() *RescalePreprocessor
type ResizePreprocessor ¶
type ResizePreprocessor struct {
// contains filtered or unexported fields
}
func ResizeBicubicStep ¶ added in v0.8.3
func ResizeBicubicStep(targetSize int) *ResizePreprocessor
ResizeBicubicStep resizes the shortest edge using Pillow bicubic (resample 3). CLIP's processor uses this before the center crop.
func ResizeBilinearStep ¶ added in v0.8.2
func ResizeBilinearStep(targetSize int) *ResizePreprocessor
ResizeBilinearStep resizes the shortest edge using antialiased bilinear interpolation. ResizeStep retains its original nearest-neighbor behavior.
func ResizeStep ¶
func ResizeStep(targetSize int) *ResizePreprocessor