---
title: "Companion"
sidebar_label: "Companion"
description: "Kotlin binding reference: Companion."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../../index.md)/[io.clika.runtime](../../index.md)/[ImageProcessor](../index.md)/[Companion](index.md)

# Companion

[common]\
object [Companion](index.md)

## Functions

| Name | Summary |
|---|---|
| [fromArgs](fromArgs.md) | [common]<br>fun [fromArgs](fromArgs.md)(resize: &lt;Error class: unknown class&gt;&lt;[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)&gt;? = null, crop: &lt;Error class: unknown class&gt;&lt;[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)&gt;? = null, rescale: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null, mean: [FloatArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html)? = null, std: [FloatArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html)? = null, where: [Placement](../../Placement/index.md)? = null): [ImageProcessor](../index.md)<br>Build from the common knobs with no configuration file: [resize](fromArgs.md) to `(height, width)` and [crop](fromArgs.md) to `(height, width)` when given, the pixel [rescale](fromArgs.md) (1 / 255 by default), and per-channel [mean](fromArgs.md) and [std](fromArgs.md) (length 1 or 3, both given to normalize; both null for none). |
| [fromDirectory](fromDirectory.md) | [common]<br>fun [fromDirectory](fromDirectory.md)(path: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), where: [Placement](../../Placement/index.md)? = null, consumedKeys: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)&gt; = emptyList()): [ImageProcessor](../index.md)<br>Load from a model directory, detecting the preprocessor format present. |
| [fromHuggingface](fromHuggingface.md) | [common]<br>fun [fromHuggingface](fromHuggingface.md)(path: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), where: [Placement](../../Placement/index.md)? = null, consumedKeys: [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)&gt; = emptyList()): [ImageProcessor](../index.md)<br>Load a Hugging Face image preprocessor (`preprocessor_config.json` in a model directory, or the file itself). [where](fromHuggingface.md) binds the default placement of [process](../process.md); [consumedKeys](fromHuggingface.md) names the configuration keys your own code reads above the processor, so a clean load logs no unknown-key warning for them. |