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 list
x : Tensor
Returns Tensor
Normalize
Channel-wise normalization: (x−μ)/σ.
Input: [C,H,W] or [B,C,H,W].
Record fields
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: [C,H,W] or [B,C,H,W].
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
Returns Resize
RandomHorizontalFlip
Randomly flip the image horizontally with probability p.
Input: [C,H,W] or [B,C,H,W].
Record fields
Instance members
| Name | Description |
|---|
this.apply x | |
RandomHorizontalFlip module
| Function | Description |
|---|
create p | |
defaultFlip | |
create
create p
Parameters
Returns RandomHorizontalFlip
defaultFlip
defaultFlip
Returns RandomHorizontalFlip
RandomVerticalFlip
Randomly flip the image vertically with probability p.
Input: [C,H,W] or [B,C,H,W].
Record fields
Instance members
| Name | Description |
|---|
this.apply x | |
RandomVerticalFlip module
| Function | Description |
|---|
create p | |
defaultFlip | |
create
create p
Parameters
Returns RandomVerticalFlip
defaultFlip
defaultFlip
Returns RandomVerticalFlip
RandomCrop
Randomly crop the image to the given size.
Input: [C,H,W] or [B,C,H,W].
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
Returns RandomCrop
CenterCrop
Crop the center region of the image.
Input: [C,H,W] or [B,C,H,W].
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
Returns CenterCrop
ToGrayscale
Convert an RGB image to grayscale using ITU-R BT.601 weights.
Input: [3,H,W] or [B,3,H,W].
Record fields
| Name | Description |
|---|
NumOutputChannels | |
Instance members
| Name | Description |
|---|
this.apply x | |
ToGrayscale module
| Function | Description |
|---|
create numOutputChannels | |
single | |
triple | |
create
create numOutputChannels
Parameters
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
Returns ConvertImageDType