UNPKG

yolo-helpers

Version:

Helper functions to use models converted from YOLO in browser and Node.js

25 lines (24 loc) 850 B
import * as tf from '@tensorflow/tfjs-node'; import { ImageInput } from '../tensorflow/node'; import { DecodeClassifyArgs } from './common'; export * from './common'; export type ClassifyArgs = { model: tf.InferenceModel; /** used for image resize when necessary, auto inferred from model shape */ input_shape?: { width: number; height: number; }; } & Omit<DecodeClassifyArgs, 'output'> & ImageInput; /** * image features: * - confidence of all classes * - highest confidence, class_index * * The confidence are already normalized between 0 to 1, and sum up to 1. */ export declare function classifyImage(args: ClassifyArgs): Promise<import("./common").ClassifyResult>; /** * Sync version of `detectBox`. */ export declare function classifyImageSync(args: ClassifyArgs): import("./common").ClassifyResult;