tjbot-ce - v3.0.0
    Preparing search index...

    Interface VisionEngineAbstract

    Abstract Vision Engine Base Class

    Defines the interface for Vision backends (ONNX, Google Cloud Vision, Azure Vision, etc.) All implementations must extend this class and implement the required methods.

    interface VisionEngine {
        classifyImage(
            image: string | Buffer<ArrayBufferLike>,
        ): Promise<ImageClassificationResult[]>;
        cleanup?(): Promise<void>;
        describeImage(
            image: string | Buffer<ArrayBufferLike>,
        ): Promise<ImageDescriptionResult>;
        detectFaces(
            image: string | Buffer<ArrayBufferLike>,
        ): Promise<FaceDetectionResult>;
        detectObjects(
            image: string | Buffer<ArrayBufferLike>,
        ): Promise<ObjectDetectionResult[]>;
        initialize(): Promise<void>;
    }
    Index

    Methods

    • Classify an image.

      Parameters

      • image: string | Buffer<ArrayBufferLike>

        Image buffer or file path

      Returns Promise<ImageClassificationResult[]>

      Array of classification results with labels and confidence scores, sorted by confidence descending

      if classification fails

    • Clean up resources used by the Vision engine. Optional method for backends that need to release resources.

      Returns Promise<void>

    • Describe an image with natural language caption. Note: This method is only supported by Azure Vision backend.

      Parameters

      • image: string | Buffer<ArrayBufferLike>

        Image buffer or file path

      Returns Promise<ImageDescriptionResult>

      Image description with confidence score

      if description fails or backend does not support this operation

    • Detect faces in an image.

      Parameters

      • image: string | Buffer<ArrayBufferLike>

        Image buffer or file path

      Returns Promise<FaceDetectionResult>

      Response object with boolean flag indicating if faces were detected and array of face metadata

      if detection fails

    • Detect objects in an image.

      Parameters

      • image: string | Buffer<ArrayBufferLike>

        Image buffer or file path

      Returns Promise<ObjectDetectionResult[]>

      Array of detected objects with labels, confidence scores, and bounding boxes

      if detection fails

    • Initialize the Vision engine. This method may perform setup tasks such as loading models or authenticating with services. Should be called before the first call to detectObjects(), classifyImage(), or segmentImage().

      Returns Promise<void>

      if initialization fails