Documentation ¶
Index ¶
- func Load(filePath string, opts LoadOpts) (image.Image, error)
- func ToArray(img image.Image, opts ToTensorOpts) []float32
- func ToTensor(img image.Image, opts ToTensorOpts) tensor.Tensor
- func ToTensorFromDirectory(dirPath string, loadOpts LoadOpts, tensorOpts ToTensorOpts) (tensor.Tensor, error)
- type Augmenter
- type Filter
- func Either(filters ...Filter) Filter
- func WithCrop(x, y, width, height int) Filter
- func WithRandomBoxBlur(probability, minBoxBlur float64, maxBoxBlur float64) Filter
- func WithRandomBrightness(probability, minBrightness float64, maxBrightness float64) Filter
- func WithRandomContrast(probability, minContrast float64, maxContrast float64) Filter
- func WithRandomDilation(probability, minDilation float64, maxDilation float64) Filter
- func WithRandomErosion(probability, minErosion float64, maxErosion float64) Filter
- func WithRandomGamma(probability, minGamma float64, maxGamma float64) Filter
- func WithRandomGaussianBlur(probability, minGaussianBlur float64, maxGaussianBlur float64) Filter
- func WithRandomHue(probability float64, minHue int, maxHue int) Filter
- func WithRandomRotation(probability, fromRadians, toRadians float64) Filter
- func WithRandomSaturation(probability, minSaturation float64, maxSaturation float64) Filter
- func WithRandomShear(probability, fromRadians, toRadians float64) Filter
- func WithResize(width, height int) Filter
- type LoadOpts
- type TensorMode
- type ToTensorOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToArray ¶
func ToArray(img image.Image, opts ToTensorOpts) []float32
ToArray converts the image in a []float32
func ToTensor ¶
func ToTensor(img image.Image, opts ToTensorOpts) tensor.Tensor
ToTensor converts the given image to a tensor
func ToTensorFromDirectory ¶
func ToTensorFromDirectory(dirPath string, loadOpts LoadOpts, tensorOpts ToTensorOpts) (tensor.Tensor, error)
ToTensorFromDirectory loads all images in a directory
Types ¶
type Augmenter ¶
type Augmenter struct {
// contains filtered or unexported fields
}
Augmenter is in charge of augmenting the given images
func NewAugmenter ¶
NewAugmenter builds a new augmenter
type Filter ¶
Filter represents a filter applied to an image
func WithRandomBoxBlur ¶
WithRandomBoxBlur configures the random gaussian blur applied to an image
func WithRandomBrightness ¶
WithRandomBrightness configures the random brightness applied to an image probability is a number between 0 and 1 indicating the probability to apply this filter
func WithRandomContrast ¶
WithRandomContrast configures the random contrast applied to an image probability is a number between 0 and 1 indicating the probability to apply this filter
func WithRandomDilation ¶
WithRandomDilation configures the random dilation applied to an image probability is a number between 0 and 1 indicating the probability to apply this filter
func WithRandomErosion ¶
WithRandomErosion configures the random erosion applied to an image probability is a number between 0 and 1 indicating the probability to apply this filter
func WithRandomGamma ¶
WithRandomGamma configures the random gamma applied to an image probability is a number between 0 and 1 indicating the probability to apply this filter
func WithRandomGaussianBlur ¶
WithRandomGaussianBlur configures the random gaussian blur applied to an image probability is a number between 0 and 1 indicating the probability to apply this filter
func WithRandomHue ¶
WithRandomHue configures the random hue applied to an image probability is a number between 0 and 1 indicating the probability to apply this filter
func WithRandomRotation ¶
WithRandomRotation configures the random rotation applied to an image probability is a number between 0 and 1 indicating the probability to apply this filter
func WithRandomSaturation ¶
WithRandomSaturation configures the random saturation applied to an image
func WithRandomShear ¶
WithRandomShear configures the random shear applied to an image probability is a number between 0 and 1 indicating the probability to apply this filter
func WithResize ¶
WithResize applies the resize operation to the image
type LoadOpts ¶
type LoadOpts struct {
TargetSize []uint
}
LoadOpts contains options to load an image
type TensorMode ¶
type TensorMode string
const ( TensorModeCaffe TensorMode = "caffe" TensorModeTensorFlow TensorMode = "tensorflow" TensorModeTorch TensorMode = "torch" )
type ToTensorOpts ¶
type ToTensorOpts struct { // TensorMode is the mode to weight the pixels. The default one is Caffe TensorMode TensorMode }
ToTensorOpts are the options to convert the image to a tensor