C API

Interface Functions

  1. mmind_packInfer_create

    int mmind_packInfer_create(Engine* engine, const char* packPath);
    

    Parse the dlkpack file and create the corresponding inference engine.

    Input parameters:

    • engine: Inference engine information (pointer).

    • packPath: dlkpack file path.

    Returned value:

  2. mmind_packInfer_destroy

    int mmind_packInfer_destroy(Engine engine);
    

    Unregister the inference engine.

    Input parameter:

    • engine: Inference engine information.

    Returned value:

  3. mmind_packInfer_infer

    int mmind_packInfer_infer(Engine engine, Image* img, Image* segMask, Image* insegMask, int& maskNumber, int* h, int* w, int& labelNumber, int* labels, int& bboxNumber, float* bboxes, int& confidenceNumber,  float* confidences);
    

    Let the inference engine perform inference.

    Input parameters:

    • engine: Inference engine information.

    • img: Input image.

    • segMask: Mask result for defect segmentation.

    • insegMask: Mask result for instance segmentation.

    • maskNumber: Number of instance segmentation masks.

    • h: Mask image height for instance segmentation.

    • w: Mask image width for instance segmentation.

    • labelNumber: Number of labels.

    • labels: Inference result labels.

    • bboxNumber: Number of bounding boxes.

    • bboxes: Bounding box coordinates. Each 4 values (upper left X, upper left Y, lower right X, lower right Y) are for one box.

    • confidenceNumber: Number of result confidences.

    • confidences: Result confidences.

    Returned value:

Returned Values of Interface Function Call

Status code returned

Enumeration value

Note

STATUS_OK

1000

No interface call exception.

FILE_NOT_FOUND

1001

File not found.

VALUE_OUTOF_LEFTRANGE

1002

The parameter value exceeds the left limit. Example: If the parameter value range is [0.0, 1.0], it will be generated when the parameter value is less than 0.0.

VALUE_OUTOF_RIGHTRANGE

1003

The parameter value exceeds the right limit. Example: If the parameter value range is [0.0, 1.0], it will be generated when the parameter value is greater than 1.0.

MODELTYPE_ERROR

1004

Model type error.

MODEL_REGISTEXCEEDLIMIT_ERROR

1005

Number of registered models beyond the limit.

MODEL_CREATE_ERROR

1006

Model creation error.

MODEL_DESTROY_ERROR

1007

Model unregistration error.

MODEL_LOAD_ERROR

1008

Model loading error.

MODEL_INIT_ERROR

1009

Model initialization error.

MODEL_INFER_ERROR

1010

Model inference error.

GET_RESULT_ERROR

1011

Error getting model result .

IMGPATH_ERROR

1012

Invalid image file path.

IMGNULL_ERROR

1013

Empty image.

IMGCHANNEL_ERROR

1014

Image channel error.

IMGDEPTH_ERROR

1015

Image bit depth error.

IMGSIZE_ERROR

1016

Image size error.

INCONSISTENT_IMAGEDEPTH_ERROR

1017

Inconsistent bit depths of two images.

INCONSISTENT_IMAGESIZE_ERROR

1018

Inconsistent sizes of two images.

INCONSISTENT_IMAGETYPE_ERROR

1019

Inconsistent types of two images.

IMGROI_ERROR

1020

Incorrect image ROI parameters.

IMGROI_NULL_ERROR

1021

Empty image ROI parameters.

IMG_CONVERTTYPE_ERROR

1022

Incorrect conversion parameters for image color space transformation.

CONFIG_PARAM_ERROR

1023

Configuration parameter error.

INVALID_ENGINE_ID

2000

Invalid inference engine object.

UNKNOWN_ERROR

9000

Unknown error.