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_definition.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_DEFINITION
34#define DL_DEFINITION
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
43typedef enum StatusCode {
44 SUCCESS = 0,
73
77typedef enum BackendType {
81 CPU
83
87typedef enum FloatPrecisionType {
89 FP32
91
92typedef enum DLAlgoType {
101
105typedef struct MMindImage
106{
107 int width;
108 int height;
110 int depth;
111 unsigned char* data;
113
117typedef struct Engine
118{
119 int type;
120 int id;
122
123#ifdef __cplusplus
124}
125#endif
126
127#endif
DLAlgoType
Definition dl_definition.h:92
@ FastLocating
Definition dl_definition.h:98
@ Unknown
Definition dl_definition.h:93
@ Classification
Definition dl_definition.h:94
@ DefectSegmentation
Definition dl_definition.h:97
@ ObjectDetection
<Classification
Definition dl_definition.h:95
@ InstanceSegmentation
Definition dl_definition.h:96
@ EdgeDetection
Definition dl_definition.h:99
FloatPrecisionType
This enumeration defines the floating-point format.
Definition dl_definition.h:87
@ FP32
Single-precision floating-point format.
Definition dl_definition.h:89
@ FP16
Half-precision floating-point format.
Definition dl_definition.h:88
BackendType
This enumeration defines the backend type.
Definition dl_definition.h:77
@ CPU
CPU mode. Used when a GPU is not available.
Definition dl_definition.h:81
@ GpuDefault
GPU default mode.
Definition dl_definition.h:78
@ GpuOptimization
Definition dl_definition.h:79
StatusCode
This enumeration defines the codes of status.
Definition dl_definition.h:43
@ E_INVALID_MODEL_PACK
Error: invalid model package.
Definition dl_definition.h:48
@ E_INIT_FAILED
Error: engine initialization failed.
Definition dl_definition.h:46
@ E_UNKNOWN
Unknown status.
Definition dl_definition.h:45
@ E_MODEL_REGISTEXCEEDLIMIT
Definition dl_definition.h:65
@ E_INVALID_ENGINE
Error: engine creation failed.
Definition dl_definition.h:70
@ E_INVALID_BACKEND_TYPE
Error: invalid backend type.
Definition dl_definition.h:71
@ E_UNSUPPORTED_BACKEND
Error: unsupported inference backend.
Definition dl_definition.h:53
@ E_LOAD_FAILED
Error: model loading failed.
Definition dl_definition.h:55
@ E_CONVERT_FAILED
Error: model conversion failed.
Definition dl_definition.h:51
@ E_SET_GPUID_ERROR
Error: incorrect GPU ID setting.
Definition dl_definition.h:69
@ I_LOADING
Status: model is being loaded.
Definition dl_definition.h:54
@ E_INVALID_MODEL_PATH
Error: invalid model package path.
Definition dl_definition.h:47
@ E_CONVERT_WITHOUT_INIT
Error: model uninitialized before conversion.
Definition dl_definition.h:52
@ E_LOAD_WITHOUT_CONVERT
Error: model unconverted before loading.
Definition dl_definition.h:56
@ E_MODULE_TYPE_ERROR
Error: the function of an incorrect model type was called.
Definition dl_definition.h:68
@ E_LOAD_WITHOUT_INIT
Error: uninitialized before loading.
Definition dl_definition.h:57
@ E_OUT_OF_DEVICE_MEMORY
Error: out of video memory.
Definition dl_definition.h:60
@ E_UNZIP_ERROR
Error: unable to unzip the model package.
Definition dl_definition.h:63
@ E_MODULE_INDEX_ERROR
Error: module index out of range.
Definition dl_definition.h:67
@ E_INVALID_MODEL_VERSION
Error: invalid model package version.
Definition dl_definition.h:49
@ E_OUT_OF_HOST_MEMORY
Error: out of memory.
Definition dl_definition.h:59
@ SUCCESS
Success status.
Definition dl_definition.h:44
@ E_INVALID_IMAGE_PATH
Error: invalid image path.
Definition dl_definition.h:62
@ E_INFER_FAILED
Error: inference failed.
Definition dl_definition.h:61
@ E_INFER_WITHOUT_LOAD
Error: model unloaded before inference.
Definition dl_definition.h:58
@ I_CONVERTING
Status: model is being converted.
Definition dl_definition.h:50
@ E_INVALID_IMAGE_NULLPTR
Error: invalid image pointer.
Definition dl_definition.h:64
This struct defines Engine.
Definition dl_definition.h:118
int id
The ID of the engine.
Definition dl_definition.h:120
int type
The type of algorithm corresponding to the engine.
Definition dl_definition.h:119
This struct defines Image.
Definition dl_definition.h:106
int depth
The depth of the image.
Definition dl_definition.h:110
unsigned char * data
The pointer of the image data.
Definition dl_definition.h:111
int channel
The number of channels in the image.
Definition dl_definition.h:109
int width
The width of the image.
Definition dl_definition.h:107
int height
The height of the image.
Definition dl_definition.h:108