Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CenterCropTransformer ¶
type CenterCropTransformer struct {
// contains filtered or unexported fields
}
CenterCropTransformer crops the center of the image into some size.
func CenterCrop ¶
func CenterCrop(height int, width ...int) *CenterCropTransformer
CenterCrop returns the CenterCropTransformer.
type ComposeTransformer ¶
type ComposeTransformer struct {
// Transform function should implement a `Run` method that does the real computation.
Transforms []interface{}
}
ComposeTransformer composes transforms together
func Compose ¶
func Compose(transforms ...interface{}) *ComposeTransformer
Compose returns a ComposeTransformer
func (*ComposeTransformer) Run ¶
func (t *ComposeTransformer) Run(inputs ...interface{}) interface{}
Run executes the transformers sequentially
type NormalizeTransformer ¶
type NormalizeTransformer struct {
// contains filtered or unexported fields
}
NormalizeTransformer corresponds to torchvision.transforms.html#Normalize. It implements Go interface gotorch/data.Transform.
func Normalize ¶
func Normalize(mean []float32, stddev []float32) *NormalizeTransformer
Normalize returns normalize transformer
type RandomCropTransformer ¶
type RandomCropTransformer struct {
// contains filtered or unexported fields
}
RandomCropTransformer randomly crops a image into some size.
func RandomCrop ¶
func RandomCrop(height int, width ...int) *RandomCropTransformer
RandomCrop returns the RandomCropTransformer.
type RandomHorizontalFlipTransformer ¶
type RandomHorizontalFlipTransformer struct {
// contains filtered or unexported fields
}
RandomHorizontalFlipTransformer randomly flips an image.
func RandomHorizontalFlip ¶
func RandomHorizontalFlip(p float32) *RandomHorizontalFlipTransformer
RandomHorizontalFlip returns the RandomHorizontalFlipTransformer.
type RandomResizedCropTransformer ¶
type RandomResizedCropTransformer struct {
// contains filtered or unexported fields
}
RandomResizedCropTransformer randomly crops a image into some size.
func RandomResizedCrop ¶
func RandomResizedCrop(height int, width ...int) *RandomResizedCropTransformer
RandomResizedCrop returns the RandomResizedCropTransformer.
func RandomResizedCropD ¶
func RandomResizedCropD(height, width int, scale0, scale1, ratio0, ratio1 float64, interpolation gocv.InterpolationFlags) *RandomResizedCropTransformer
RandomResizedCropD returns a RandomResizedCropTransformer with detailed params.
type RandomVerticalFlipTransformer ¶
type RandomVerticalFlipTransformer struct {
// contains filtered or unexported fields
}
RandomVerticalFlipTransformer randomly flips an image.
func RandomVerticalFlip ¶
func RandomVerticalFlip(p float32) *RandomVerticalFlipTransformer
RandomVerticalFlip returns the RandomVerticalFlipTransformer
type ResizeTransformer ¶
type ResizeTransformer struct {
// contains filtered or unexported fields
}
ResizeTransformer resizes the given image.
func Resize ¶
func Resize(height int, width ...int) *ResizeTransformer
Resize returns a ResizeTransformer.
type ToTensorTransformer ¶
type ToTensorTransformer struct{}
ToTensorTransformer transforms an image or an interger into a Tensor. If the image is of type image.Gray, the tensor has one channle; otherwise, the tensor has three channels (RGB).
func (ToTensorTransformer) Run ¶
func (t ToTensorTransformer) Run(obj interface{}) torch.Tensor
Run executes the ToTensorTransformer and returns a Tensor