Mech-DLK SDK C API 2.0.2
C API reference documentation for secondary development with Mech-DLK
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Pages
dl_packInfer.h
Go to the documentation of this file.
1/*******************************************************************************
2 *BSD 3-Clause License
3 *
4 *Copyright (c) 2016-2023, Mech-Mind Robotics
5 *All rights reserved.
6 *
7 *Redistribution and use in source and binary forms, with or without
8 *modification, are permitted provided that the following conditions are met:
9 *
10 *1. Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 *2. Redistributions in binary form must reproduce the above copyright notice,
14 * this list of conditions and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
16 *
17 *3. Neither the name of the copyright holder nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 *THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 *AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 *IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 *DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 *DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 *SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 *CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 *OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 *OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 ******************************************************************************/
32
33#ifndef DL_PACKINFER
34#define DL_PACKINFER
35#include "common/Export.h"
36#include "dl_definition.h"
37#include "dl_result.h"
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
52MMIND_DL_SDK_EXPORT StatusCode createImage(const char* imagePath, MMindImage* image);
53
61MMIND_DL_SDK_EXPORT void releaseImage(const MMindImage* image);
62
70MMIND_DL_SDK_EXPORT StatusCode showImage(const MMindImage* image, const char* windowName);
71
78MMIND_DL_SDK_EXPORT StatusCode saveImage(const MMindImage* image, const char* path);
79
90MMIND_DL_SDK_EXPORT StatusCode createPackInferEngine(Engine* engine, const char* packPath,
91 const BackendType backend,
92 const unsigned int deviceId);
93
101MMIND_DL_SDK_EXPORT void releasePackInferEngine(const Engine* engine);
102
115 const Engine* engine, const unsigned int batchSize, const FloatPrecisionType floatPrecision,
116 const unsigned int moduleIdx);
117
127MMIND_DL_SDK_EXPORT StatusCode infer(const Engine* engine, const MMindImage* images,
128 const unsigned int imageNum);
129
138MMIND_DL_SDK_EXPORT StatusCode getDefectSegmentataionResult(const Engine* engine,
139 const unsigned int moduleIdx,
140 DefectAndEdgeResult** results,
141 unsigned int* resultNum);
142
151MMIND_DL_SDK_EXPORT void releaseDefectSegmentationResult(DefectAndEdgeResult** results,
152 unsigned int resultNum);
153
162MMIND_DL_SDK_EXPORT StatusCode getObjectAndInstanceResult(const Engine* engine,
163 const unsigned int moduleIdx,
164 ObjectAndInsResult** results,
165 unsigned int* resultNum);
166
175MMIND_DL_SDK_EXPORT void releaseObjectAndInstanceResult(ObjectAndInsResult** results,
176 unsigned int resultNum);
177
186MMIND_DL_SDK_EXPORT StatusCode getClassificationResult(const Engine* engine,
187 const unsigned int moduleIdx,
188 ClassificationResult** results,
189 unsigned int* resultNum);
190
199MMIND_DL_SDK_EXPORT void releaseClassificationResult(ClassificationResult** results,
200 unsigned int resultNum);
201
210MMIND_DL_SDK_EXPORT StatusCode getFastPositioningResult(const Engine* engine,
211 const unsigned int moduleIdx,
212 FastPositioningResult** results,
213 unsigned int* resultNum);
214
223MMIND_DL_SDK_EXPORT void releaseFastPositioningResult(FastPositioningResult** results,
224 unsigned int resultNum);
225
236MMIND_DL_SDK_EXPORT StatusCode moduleResultVisualization(const Engine* engine,
237 const MMindImage* images,
238 const unsigned int moduleIdx,
239 const unsigned int imageNum);
240
250MMIND_DL_SDK_EXPORT StatusCode resultVisualization(const Engine* engine, const MMindImage* images,
251 const unsigned int imageNum);
252
253#ifdef __cplusplus
254}
255#endif
256
257#endif
FloatPrecisionType
This enumeration defines the floating-point format.
Definition dl_definition.h:87
BackendType
This enumeration defines the backend type.
Definition dl_definition.h:77
StatusCode
This enumeration defines the codes of status.
Definition dl_definition.h:43
MMIND_DL_SDK_EXPORT StatusCode saveImage(const MMindImage *image, const char *path)
Save the image to a specified directory.
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 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 resultVisualization(const Engine *engine, const MMindImage *images, const unsigned int imageNum)
Draw all the model results onto the images.
MMIND_DL_SDK_EXPORT void releaseDefectSegmentationResult(DefectAndEdgeResult **results, unsigned int resultNum)
Release the memory of the defect segmentation result.
MMIND_DL_SDK_EXPORT void releaseClassificationResult(ClassificationResult **results, unsigned int resultNum)
Release the memory of the classification result.
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 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 showImage(const MMindImage *image, const char *windowName)
Visualize an image.
MMIND_DL_SDK_EXPORT void releaseImage(const MMindImage *image)
Release the memory of the image.
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 createImage(const char *imagePath, MMindImage *image)
Create an image from its path.
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 StatusCode getClassificationResult(const Engine *engine, const unsigned int moduleIdx, ClassificationResult **results, unsigned int *resultNum)
Get the classification 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 getFastPositioningResult(const Engine *engine, const unsigned int moduleIdx, FastPositioningResult **results, unsigned int *resultNum)
Get the fast positioning result.
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.
This struct defines the classification result.
Definition dl_result.h:101
This struct defines the defect segmentation and edge detection result.
Definition dl_result.h:111
This struct defines Engine.
Definition dl_definition.h:118
This struct defines the fast positioning result.
Definition dl_result.h:131
This struct defines Image.
Definition dl_definition.h:106
This struct defines the object detection and instance segmentation result.
Definition dl_result.h:121