import { ImageProcessingResult } from "./interfaces.js"; import { BaseImageModel } from "./base.js"; /** * Class predicted by the model. * * @param class - class name. * @param confidence - how confident the model is in the prediction. Value in range [0,1]. */ export type ClassificationPrediction = { class: string; confidence: number; }; /** * Output of the classification model. * * @param results - array of `ClassificationPrediction` values. * @param elapsed - time taken to process the input, in seconds. */ export type ClassificationResult = ImageProcessingResult & { results: ClassificationPrediction[] | ClassificationPrediction[][]; }; /** * Model for classifying images. * * @implements IImageModel * * @remarks * The model is initialized via `init()` function. The model cannot be used if it is not initialized. * * @param metadata - information about the model. * @param initialized - flag indicating if the model was initialized. */ export declare class ClassificationModel extends BaseImageModel { /** * Processes the image and generates the classification predictions. * * @param input - either URL to the image or Buffer with the image. * @param num - maximum number of predictions to generate. * * @returns classification predictions. */ process: (inputs: string | ArrayBuffer | string[] | ArrayBuffer[], num?: number) => Promise; private runInference; }