ppu-yolo-onnx-inference
Version:
Use your YOLO onnx object detection model in Typescript Bun environment easily.
30 lines (29 loc) • 1.02 kB
TypeScript
import { BaseYoloDetectionInference } from "../core/base-yolo-inference.js";
import type { CoreCanvas } from "../core/platform.js";
import type { YoloDetectionOptions } from "../interface.js";
/**
* YOLOv11 Object Detection Inference Engine for Node.js / Bun.
*
* @example
* ```ts
* import { YoloDetectionInference } from "ppu-yolo-onnx-inference";
*
* const detector = new YoloDetectionInference({
* model: { onnx: modelBuffer, classNames: ["person", "car"] },
* thresholds: { confidence: 0.5 },
* });
*
* await detector.init();
* const detections = await detector.detect(imageBuffer);
* await detector.destroy();
* ```
*/
export declare class YoloDetectionInference extends BaseYoloDetectionInference {
constructor(options: YoloDetectionOptions);
/**
* Convert an ArrayBuffer to a Canvas.
* @param buffer - The input image as ArrayBuffer.
* @returns A canvas containing the decoded image.
*/
static convertBufferToCanvas(buffer: ArrayBuffer): Promise<CoreCanvas>;
}