import Jimp from "jimp"; import { PreprocessorConfig } from "./preprocessorConfig.js"; import * as ort from "onnxruntime-common"; export interface PreprocessorResult { tensor: ort.Tensor; newWidth: number; newHeight: number; } export declare class Preprocessor { config: PreprocessorConfig; constructor(config: PreprocessorConfig); process: (image: Jimp) => PreprocessorResult; /** * imageDataToTensor converts Jimp image to ORT tensor * @param image instance of Jimp image * @param dims target dimensions of the tensor * @returns ORT tensor */ imageDataToTensor: (image: Jimp) => ort.Tensor; getValue: (value: number, colorIdx: number) => number; } export default Preprocessor;