Mech-DLK SDK C API 2.0.2
C API reference documentation for secondary development with Mech-DLK
|
Go to the source code of this file.
Functions | |
MMIND_DL_SDK_EXPORT StatusCode | createImage (const char *imagePath, MMindImage *image) |
Create an image from its path. | |
MMIND_DL_SDK_EXPORT void | releaseImage (const MMindImage *image) |
Release the memory of the image. | |
MMIND_DL_SDK_EXPORT StatusCode | showImage (const MMindImage *image, const char *windowName) |
Visualize an image. | |
MMIND_DL_SDK_EXPORT StatusCode | saveImage (const MMindImage *image, const char *path) |
Save the image to a specified directory. | |
MMIND_DL_SDK_EXPORT StatusCode | createPackInferEngine (Engine *engine, const char *packPath, const BackendType backend, const unsigned int deviceId) |
Create an engine for model package inference. | |
MMIND_DL_SDK_EXPORT void | releasePackInferEngine (const Engine *engine) |
Release the memory of the model package inference engine. | |
MMIND_DL_SDK_EXPORT StatusCode | setBatchSizeAndFloatPrecision (const Engine *engine, const unsigned int batchSize, const FloatPrecisionType floatPrecision, const unsigned int moduleIdx) |
Set the batch size and floating-point precision of the inference engine. | |
MMIND_DL_SDK_EXPORT StatusCode | infer (const Engine *engine, const MMindImage *images, const unsigned int imageNum) |
Make image inference using the model package inference engine. | |
MMIND_DL_SDK_EXPORT StatusCode | getDefectSegmentataionResult (const Engine *engine, const unsigned int moduleIdx, DefectAndEdgeResult **results, unsigned int *resultNum) |
Get the defect segmentation result. | |
MMIND_DL_SDK_EXPORT void | releaseDefectSegmentationResult (DefectAndEdgeResult **results, unsigned int resultNum) |
Release the memory of the defect segmentation result. | |
MMIND_DL_SDK_EXPORT StatusCode | getObjectAndInstanceResult (const Engine *engine, const unsigned int moduleIdx, ObjectAndInsResult **results, unsigned int *resultNum) |
Get the object detection or instance segmentation result. | |
MMIND_DL_SDK_EXPORT void | releaseObjectAndInstanceResult (ObjectAndInsResult **results, unsigned int resultNum) |
Release the memory of the object detection or instance segmentation result. *. | |
MMIND_DL_SDK_EXPORT StatusCode | getClassificationResult (const Engine *engine, const unsigned int moduleIdx, ClassificationResult **results, unsigned int *resultNum) |
Get the classification result. | |
MMIND_DL_SDK_EXPORT void | releaseClassificationResult (ClassificationResult **results, unsigned int resultNum) |
Release the memory of the classification result. | |
MMIND_DL_SDK_EXPORT StatusCode | getFastPositioningResult (const Engine *engine, const unsigned int moduleIdx, FastPositioningResult **results, unsigned int *resultNum) |
Get the fast positioning result. | |
MMIND_DL_SDK_EXPORT void | releaseFastPositioningResult (FastPositioningResult **results, unsigned int resultNum) |
Release the memory of the fast positioning result. | |
MMIND_DL_SDK_EXPORT StatusCode | moduleResultVisualization (const Engine *engine, const MMindImage *images, const unsigned int moduleIdx, const unsigned int imageNum) |
Draw the model results of the specified index onto the images. | |
MMIND_DL_SDK_EXPORT StatusCode | resultVisualization (const Engine *engine, const MMindImage *images, const unsigned int imageNum) |
Draw all the model results onto the images. | |
MMIND_DL_SDK_EXPORT StatusCode createImage | ( | const char * | imagePath, |
MMindImage * | image | ||
) |
Create an image from its path.
[in] | imagePath | Image storage path. |
[out] | image | See MMindImage for details. |
MMIND_DL_SDK_EXPORT StatusCode createPackInferEngine | ( | Engine * | engine, |
const char * | packPath, | ||
const BackendType | backend, | ||
const unsigned int | deviceId | ||
) |
Create an engine for model package inference.
[out] | engine | Identifier of the created engine. See Engine for details. |
[in] | packPath | The path to the model package exported from Mech-DLK. |
[in] | backend | See BackendType for details. |
[in] | deviceId | The index of the specified GPU during model inference. |
backend
is set to CPU, the setting of deviceId
is invalid; when the backend
is set to GpuOptimization, it takes 1-5 minutes to optimize the model. MMIND_DL_SDK_EXPORT StatusCode getClassificationResult | ( | const Engine * | engine, |
const unsigned int | moduleIdx, | ||
ClassificationResult ** | results, | ||
unsigned int * | resultNum | ||
) |
Get the classification result.
[in] | engine | See Engine for details. |
[in] | moduleIdx | Specified model index in the model package. |
[out] | results | See ClassificationResult for details. |
[out] | resultNum | The number of inference results. |
MMIND_DL_SDK_EXPORT StatusCode getDefectSegmentataionResult | ( | const Engine * | engine, |
const unsigned int | moduleIdx, | ||
DefectAndEdgeResult ** | results, | ||
unsigned int * | resultNum | ||
) |
Get the defect segmentation result.
[in] | engine | See Engine for details. |
[in] | moduleIdx | Specified model index in the model package. |
[out] | results | See DefectAndEdgeResult for details. |
[out] | resultNum | The number of inference results. |
MMIND_DL_SDK_EXPORT StatusCode getFastPositioningResult | ( | const Engine * | engine, |
const unsigned int | moduleIdx, | ||
FastPositioningResult ** | results, | ||
unsigned int * | resultNum | ||
) |
Get the fast positioning result.
[in] | engine | See Engine for details. |
[in] | moduleIdx | Specified model index in the model package. |
[out] | results | See FastPositioningResult for details. |
[out] | resultNum | The number of inference results. |
MMIND_DL_SDK_EXPORT StatusCode getObjectAndInstanceResult | ( | const Engine * | engine, |
const unsigned int | moduleIdx, | ||
ObjectAndInsResult ** | results, | ||
unsigned int * | resultNum | ||
) |
Get the object detection or instance segmentation result.
[in] | engine | See Engine for details. |
[in] | moduleIdx | Specified model index in the model package. |
[out] | results | See ObjectAndInsResult for details. |
[out] | resultNum | The number of inference results. |
MMIND_DL_SDK_EXPORT StatusCode infer | ( | const Engine * | engine, |
const MMindImage * | images, | ||
const unsigned int | imageNum | ||
) |
Make image inference using the model package inference engine.
[in] | engine | See Engine for details. |
[in] | image | See MMindImage for details. |
[in] | imageNum | The number of images that need to be inferred. |
imageNum
must be less than or equal to the number of elements in the images
array. Otherwise, the program may crash due to the out-of-bounds array index. MMIND_DL_SDK_EXPORT StatusCode moduleResultVisualization | ( | const Engine * | engine, |
const MMindImage * | images, | ||
const unsigned int | moduleIdx, | ||
const unsigned int | imageNum | ||
) |
Draw the model results of the specified index onto the images.
[in] | engine | See Engine for details. |
[in] | MMindImage | See MMindImage for details. |
[in] | moduleIdx | Specified model index in the model package. |
[in] | imageNum | The number of images that need to be drawn. |
imageNum
must be less than or equal to the number of elements in the images
array. Otherwise, the program may crash due to the out-of-bounds array index. MMIND_DL_SDK_EXPORT void releaseClassificationResult | ( | ClassificationResult ** | results, |
unsigned int | resultNum | ||
) |
Release the memory of the classification result.
[in] | results | See ClassificationResult for details. |
[in] | resultNum | The number of inference results. |
MMIND_DL_SDK_EXPORT void releaseDefectSegmentationResult | ( | DefectAndEdgeResult ** | results, |
unsigned int | resultNum | ||
) |
Release the memory of the defect segmentation result.
[in] | results | See DefectAndEdgeResult for details. |
[in] | resultNum | The number of inference results. |
MMIND_DL_SDK_EXPORT void releaseFastPositioningResult | ( | FastPositioningResult ** | results, |
unsigned int | resultNum | ||
) |
Release the memory of the fast positioning result.
[in] | results | See FastPositioningResult for details. |
[in] | resultNum | The number of inference results. * |
MMIND_DL_SDK_EXPORT void releaseImage | ( | const MMindImage * | image | ) |
Release the memory of the image.
[in] | image | See MMindImage for details. |
MMIND_DL_SDK_EXPORT void releaseObjectAndInstanceResult | ( | ObjectAndInsResult ** | results, |
unsigned int | resultNum | ||
) |
Release the memory of the object detection or instance segmentation result. *.
*
[in] | results | See DefectAndEdgeResult for details. |
[in] | resultNum | The number of inference results. * |
MMIND_DL_SDK_EXPORT void releasePackInferEngine | ( | const Engine * | engine | ) |
Release the memory of the model package inference engine.
[in] | engine | See Engine for details. |
MMIND_DL_SDK_EXPORT StatusCode resultVisualization | ( | const Engine * | engine, |
const MMindImage * | images, | ||
const unsigned int | imageNum | ||
) |
Draw all the model results onto the images.
[in] | engine | See Engine for details. |
[in] | MMindImage | See MMindImage for details. |
[in] | imageNum | The number of images that need to be drawn. |
imageNum
must be less than or equal to the number of elements in the images
array. Otherwise, the program may crash due to the out-of-bounds array index. MMIND_DL_SDK_EXPORT StatusCode saveImage | ( | const MMindImage * | image, |
const char * | path | ||
) |
Save the image to a specified directory.
[in] | image | See MMindImage for details. |
[in] | path | The path to save the image. |
MMIND_DL_SDK_EXPORT StatusCode setBatchSizeAndFloatPrecision | ( | const Engine * | engine, |
const unsigned int | batchSize, | ||
const FloatPrecisionType | floatPrecision, | ||
const unsigned int | moduleIdx | ||
) |
Set the batch size and floating-point precision of the inference engine.
[in] | engine | See Engine for details. |
[in] | batchSize | The batch size of the model package. |
[in] | floatPrecision | See FloatPrecisionType for details. |
[in] | moduleIdx | Specified model index in the model package. |
floatPrecision
only takes effect when BackendType is set to GpuOptimization; for the model package of instance segmentation, batchSize
can only be 1. MMIND_DL_SDK_EXPORT StatusCode showImage | ( | const MMindImage * | image, |
const char * | windowName | ||
) |
Visualize an image.
[in] | image | See MMindImage for details. |
[in] | windowName | The window name for visualizing an image. |