ITransform
Image transform that maps a tensor to a tensor.
Instance members
| Name | Description |
|---|---|
this.apply arg1 |
Compose
Compose multiple transforms into a single pipeline.
| Function | Description |
|---|---|
apply transforms x | Apply transforms sequentially. |
apply
apply transforms x
Apply transforms sequentially.
Parameters
transforms:ITransform listx:Tensor
Returns Tensor
Normalize
Channel-wise normalization: . Input: or .
Record fields
| Name | Description |
|---|---|
Mean | |
Std |
Instance members
| Name | Description |
|---|---|
this.apply x |
Normalize module
| Function | Description |
|---|---|
imageNet | ImageNet normalization preset. |
imageNet
imageNet
ImageNet normalization preset.
Returns Normalize
Resize
Resize to the target spatial size using bilinear interpolation. Input: or .
Record fields
| Name | Description |
|---|---|
Height | |
Width |
Instance members
| Name | Description |
|---|---|
this.apply x |
Resize module
| Function | Description |
|---|---|
create height width |
create
create height width
Parameters
height:intwidth:int
Returns Resize
RandomHorizontalFlip
Randomly flip the image horizontally with probability p. Input: or .
Record fields
| Name | Description |
|---|---|
P |
Instance members
| Name | Description |
|---|---|
this.apply x |
RandomHorizontalFlip module
| Function | Description |
|---|---|
create p | |
defaultFlip |
create
create p
Parameters
p:float
Returns RandomHorizontalFlip
defaultFlip
defaultFlip
Returns RandomHorizontalFlip
RandomVerticalFlip
Randomly flip the image vertically with probability p. Input: or .
Record fields
| Name | Description |
|---|---|
P |
Instance members
| Name | Description |
|---|---|
this.apply x |
RandomVerticalFlip module
| Function | Description |
|---|---|
create p | |
defaultFlip |
create
create p
Parameters
p:float
Returns RandomVerticalFlip
defaultFlip
defaultFlip
Returns RandomVerticalFlip
RandomCrop
Randomly crop the image to the given size. Input: or .
Record fields
| Name | Description |
|---|---|
Height | |
Width |
Instance members
| Name | Description |
|---|---|
this.apply x |
RandomCrop module
| Function | Description |
|---|---|
create height width |
create
create height width
Parameters
height:intwidth:int
Returns RandomCrop
CenterCrop
Crop the center region of the image. Input: or .
Record fields
| Name | Description |
|---|---|
Height | |
Width |
Instance members
| Name | Description |
|---|---|
this.apply x |
CenterCrop module
| Function | Description |
|---|---|
create height width |
create
create height width
Parameters
height:intwidth:int
Returns CenterCrop
ToGrayscale
Convert an RGB image to grayscale using ITU-R BT.601 weights. Input: or .
Record fields
| Name | Description |
|---|---|
NumOutputChannels |
Instance members
| Name | Description |
|---|---|
this.apply x |
ToGrayscale module
| Function | Description |
|---|---|
create numOutputChannels | |
single | |
triple |
create
create numOutputChannels
Parameters
numOutputChannels:int
Returns ToGrayscale
single
single
Returns ToGrayscale
triple
triple
Returns ToGrayscale
ConvertImageDType
Convert image tensor dtype, scaling between [0, 255] int and [0.0, 1.0] float ranges. Input: any image tensor.
Record fields
| Name | Description |
|---|---|
TargetDType |
Instance members
| Name | Description |
|---|---|
this.apply x |
ConvertImageDType module
| Function | Description |
|---|---|
create dtype |
create
create dtype
Parameters
dtype:ScalarType
Returns ConvertImageDType