Preprocessing

class Preprocessing

The data preprocessing pipeline presented as Kotlin DSL on receivers.

Could be used to handle directory of images or one image file.

Constructors

Preprocessing
Link copied to clipboard
fun Preprocessing()

Functions

getFinalShape
Link copied to clipboard
fun getFinalShape(inputShape: ImageShape = ImageShape()): ImageShape

Returns the final shape of data when image preprocessing is applied to the image with the given shape.

invoke
Link copied to clipboard
operator fun invoke(imagePath: File): Pair<FloatArray, ImageShape>

Applies the preprocessing pipeline to the specific image file.

Properties

imagePreprocessingStage
Link copied to clipboard
lateinit var imagePreprocessingStage: ImagePreprocessing

This stage describes the process of image loading and transformation before converting to tensor.

tensorPreprocessingStage
Link copied to clipboard
lateinit var tensorPreprocessingStage: TensorPreprocessing

This stage describes the process of data transformation after converting to tensor.

Extensions

transformImage
Link copied to clipboard
fun Preprocessing.transformImage(block: ImagePreprocessing.() -> Unit)

Defines preprocessing operations on the image.

transformTensor
Link copied to clipboard
fun Preprocessing.transformTensor(block: TensorPreprocessing.() -> Unit)

Defines preprocessing operations on the tensor.