import type { InferenceModel, Tensor } from '@tensorflow/tfjs';
export declare function getModelInputShape(model: InferenceModel): {
    height: number;
    width: number;
};
export declare function getImageSize(input: Tensor): {
    height: number | undefined;
    width: number | undefined;
};
/** normalize color and resize/expand into shape: [batch, height, width, channels] */
export declare function preprocessInput(
/**
 * input shape: [height, width, channels] or [batch, height, width, channels]
 *
 * the pixel values should be in the range of [0, 255]
 */
input: Tensor, input_shape: {
    height: number;
    width: number;
}): Tensor<import("@tensorflow/tfjs").Rank>;
export type ModelMetadata = {
    task?: 'detect' | 'pose' | 'segment' | string;
    class_names?: string[];
    keypoints?: number;
    visibility?: boolean;
};
/**
 * example of segmentation model:
 * ```
 * version: 8.3.83
 * task: segment
 * batch: 1
 * imgsz:
 * - 640
 * - 640
 * names:
 *   0: person
 *   1: bicycle
 *   2: car
 * args:
 *   batch: 1
 *   half: false
 *   int8: false
 *   nms: false
 * ```
 *
 * example of pose model:
 * ```
 * task: pose
 * kpt_shape:
 * - 17
 * - 3
 * ```
 */
export declare function parseMetadataYaml(text: string): ModelMetadata;
export type ModelWithMetadata<T extends InferenceModel> = T & ModelMetadata;
export declare function combineModelAndMetadata<T extends InferenceModel>(model: T, metadata: ModelMetadata): ModelWithMetadata<T>;
export declare function loadTextFromUrl(url: string): Promise<string>;
export declare function calculateNumOfOutputBoxes(width: number, height: number): number;
