imgaug

package module
v0.0.0-...-4225931 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: MIT Imports: 5 Imported by: 0

README

imgaug

Documentation

Index

Constants

View Source
const (
	L Side = 1 << iota
	T
	R
	B
	LR  = L | R
	TB  = T | B
	All = LR | TB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

func NewConfig

func NewConfig(r *rand.Rand, bboxMinArea int, bboxMinVisibility float64) *Config

type CropFunc

type CropFunc func(cfg *Config, bnds image.Point) image.Rectangle

func FixedCrop

func FixedCrop(r image.Rectangle) CropFunc

func PercentCrop

func PercentCrop(sides map[Side]FloatRange) CropFunc

func PixelCrop

func PixelCrop(sides map[Side]IntRange) CropFunc

type FloatRange

type FloatRange struct {
	Min float64
	Max float64
}

func (FloatRange) Float

func (fr FloatRange) Float(r *rand.Rand) float64

type IntRange

type IntRange struct {
	Min int
	Max int
}

func (IntRange) Int

func (ir IntRange) Int(r *rand.Rand) int

type Labels

type Labels struct {
	BBoxes    []image.Rectangle
	Polygons  [][]image.Point
	Keypoints [][]image.Point
	Masks     []image.Image
}

type PadFunc

type PadFunc func(cfg *Config, bnds image.Point) map[Side]int

func PercentPad

func PercentPad(sides map[Side]FloatRange) PadFunc

func PixelPad

func PixelPad(sides map[Side]IntRange) PadFunc

type ResizeAlg

type ResizeAlg int
const (
	NearestNeighbor ResizeAlg = iota
	Box
	Linear
	Hermite
	MitchellNetravali
	CatmullRom
	BSpline
	Gaussian
	Bartlett
	Lanczos
	Hann
	Hamming
	Blackman
	Welch
	Cosine
)

type ResizeFunc

type ResizeFunc func(cfg *Config, bnds image.Point) image.Point

func FixedResize

func FixedResize(w, h int) ResizeFunc

func PercentResize

func PercentResize(w FloatRange, h FloatRange) ResizeFunc

func PixelResize

func PixelResize(w IntRange, h IntRange) ResizeFunc

type Side

type Side uint8

type Transformer

type Transformer interface {
	Transform(cfg *Config, img image.Image, labels Labels) (image.Image, Labels)
}

func Crop

func Crop(fn CropFunc) Transformer

func FlipLR

func FlipLR() Transformer

func FlipUD

func FlipUD() Transformer

func Noop

func Noop() Transformer

func OneOf

func OneOf(ts ...Transformer) Transformer

func Pad

func Pad(fn PadFunc) Transformer

func Resize

func Resize(fn ResizeFunc, algs ...ResizeAlg) Transformer

func Sequential

func Sequential(ts ...Transformer) Transformer

func SomeOf

func SomeOf(r IntRange, ts ...Transformer) Transformer

func Sometimes

func Sometimes(p float64, t Transformer) Transformer

type TransformerFunc

type TransformerFunc func(cfg *Config, img image.Image, labels Labels) (image.Image, Labels)

func (TransformerFunc) Transform

func (fn TransformerFunc) Transform(cfg *Config, img image.Image, labels Labels) (image.Image, Labels)

Jump to

Keyboard shortcuts

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