Skip to main content

//clika-runtime/io.clika.runtime/ImageProcessor/Companion

Companion

[common]
object Companion

Functions​

NameSummary
fromArgs[common]
fun fromArgs(resize: <Error class: unknown class><Long, Long>? = null, crop: <Error class: unknown class><Long, Long>? = null, rescale: Double? = null, mean: FloatArray? = null, std: FloatArray? = null, where: Placement? = null): ImageProcessor
Build from the common knobs with no configuration file: resize to (height, width) and crop to (height, width) when given, the pixel rescale (1 / 255 by default), and per-channel mean and std (length 1 or 3, both given to normalize; both null for none).
fromDirectory[common]
fun fromDirectory(path: String, where: Placement? = null, consumedKeys: List<String> = emptyList()): ImageProcessor
Load from a model directory, detecting the preprocessor format present.
fromHuggingface[common]
fun fromHuggingface(path: String, where: Placement? = null, consumedKeys: List<String> = emptyList()): ImageProcessor
Load a Hugging Face image preprocessor (preprocessor_config.json in a model directory, or the file itself). where binds the default placement of process; consumedKeys names the configuration keys your own code reads above the processor, so a clean load logs no unknown-key warning for them.