yolo-helpers
Version:
Helper functions to use models converted from YOLO in browser and Node.js
28 lines (27 loc) • 846 B
TypeScript
export type ImageResult = {
/** class index with highest confidence */
class_index: number;
/** confidence of the class with highest confidence */
confidence: number;
/** confidence of all classes */
all_confidences: number[];
};
/**
* output shape: [batch]
*
* Array of batches, each containing array of confidence for each classes
* */
export type ClassifyResult = ImageResult[];
export type DecodeClassifyArgs = {
/** e.g. `1` for single class */
num_classes: number;
/** batched predict result, e.g. 1x80 */
output: number[][];
};
/**
* tensorflow output: [batch, class_index] -> confidence
* e.g. 1x1000 for 1 batch of 1000 classes
*
* The confidence are already normalized between 0 to 1, and sum up to 1.
*/
export declare function decodeClassify(args: DecodeClassifyArgs): ClassifyResult;