FastDeploy  latest
Fast & Easy to Deploy!
result.h
Go to the documentation of this file.
1 // Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
19 
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 typedef struct FD_C_ClassifyResult {
32  FD_C_ResultType type;
34 
35 typedef struct FD_C_OneDimClassifyResult {
36  size_t size;
39 
40 typedef struct FD_C_Mask {
43  FD_C_ResultType type;
44 } FD_C_Mask;
45 
46 typedef struct FD_C_OneDimMask {
47  size_t size;
49 } FD_C_OneDimMask; // std::vector<FD_C_Mask>
50 
51 typedef struct FD_C_DetectionResult {
57  FD_C_ResultType type;
59 
61  size_t size;
64 
65 
66 typedef struct FD_C_OCRResult {
72  FD_C_ResultType type;
74 
75 typedef struct FD_C_OneDimOCRResult {
76  size_t size;
79 
80 typedef struct FD_C_SegmentationResult {
85  FD_C_ResultType type;
87 
89  size_t size;
92 
93 
94 // Classification Results
95 
103 
110  __fd_take FD_C_ClassifyResultWrapper* fd_c_classify_result_wrapper);
111 
117 FASTDEPLOY_CAPI_EXPORT extern void
119 
127  __fd_keep FD_C_ClassifyResultWrapper* fd_c_classify_result_wrapper,
128  __fd_keep FD_C_ClassifyResult* fd_c_classify_result);
129 
130 
139  __fd_keep FD_C_ClassifyResult* fd_c_classify_result);
140 
149  __fd_keep FD_C_ClassifyResult* fd_c_classify_result, char* str_buffer);
150 
151 
152 // Detection Results
153 
161 
168  __fd_take FD_C_DetectionResultWrapper* fd_c_detection_result_wrapper);
169 
176  __fd_take FD_C_DetectionResult* fd_c_detection_result);
177 
185  __fd_keep FD_C_DetectionResultWrapper* fd_c_detection_result_wrapper,
186  __fd_keep FD_C_DetectionResult* fd_c_detection_result);
187 
196  __fd_keep FD_C_DetectionResult* fd_c_detection_result);
197 
198 
205 FASTDEPLOY_CAPI_EXPORT extern void
207  __fd_keep FD_C_DetectionResult* fd_c_detection_result, char* str_buffer);
208 
209 
210 // OCR Results
211 
219 
227 
235 
245 
255 
262 FASTDEPLOY_CAPI_EXPORT extern void
264  __fd_keep FD_C_OCRResult* fd_c_ocr_result, char* str_buffer);
265 
266 
267 // Segmentation Results
268 
276 
283  __fd_take FD_C_SegmentationResultWrapper* fd_c_segmentation_result_wrapper);
284 
291  __fd_take FD_C_SegmentationResult* fd_c_segmentation_result);
292 
300  __fd_keep FD_C_SegmentationResultWrapper* fd_c_segmentation_result_wrapper,
301  __fd_keep FD_C_SegmentationResult* fd_c_segmentation_result);
302 
311  __fd_keep FD_C_SegmentationResult* fd_c_segmentation_result);
312 
321  __fd_keep FD_C_SegmentationResult* fd_c_segmentation_result, char* str_buffer);
322 
323 
324 
325 #ifdef __cplusplus
326 } // extern "C"
327 #endif
FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_DetectionResultWrapper * FD_C_CreateDetectionResultWrapper()
Create a new FD_C_DetectionResultWrapper object.
Definition: result.cc:106
FD_C_OneDimArrayInt64 shape
Definition: result.h:83
FD_C_OneDimArrayFloat cls_scores
Definition: result.h:70
FD_C_OneDimArrayFloat scores
Definition: result.h:31
FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_OCRResultWrapper * FD_C_CreateOCRResultWrapper()
Create a new FD_C_OCRResultWrapper object.
Definition: result.cc:265
size_t size
Definition: result.h:61
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyOCRResult(__fd_take FD_C_OCRResult *fd_c_ocr_result)
Destroy a FD_C_OCRResult object.
Definition: result.cc:278
FD_C_OneDimArrayInt32 cls_labels
Definition: result.h:71
FD_C_OneDimArrayInt32 label_ids
Definition: result.h:30
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyClassifyResult(__fd_take FD_C_ClassifyResult *fd_c_classify_result)
Destroy a FD_C_ClassifyResult object.
Definition: result.cc:40
int8_t FD_C_Bool
Definition: fd_common.h:58
#define FASTDEPLOY_CAPI_EXPORT
Definition: fd_common.h:27
struct FD_C_Mask FD_C_Mask
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroySegmentationResult(__fd_take FD_C_SegmentationResult *fd_c_segmentation_result)
Destroy a FD_C_SegmentationResult object.
Definition: result.cc:421
FASTDEPLOY_CAPI_EXPORT __fd_give void FD_C_OCRResultWrapperToCResult(__fd_keep FD_C_OCRResultWrapper *fd_c_ocr_result_wrapper, __fd_keep FD_C_OCRResult *fd_c_ocr_result)
Get a FD_C_OCRResult object from FD_C_OCRResultWrapper object.
Definition: result.cc:298
struct FD_C_OCRResult FD_C_OCRResult
struct FD_C_DetectionResultWrapper FD_C_DetectionResultWrapper
Definition: result.h:21
Definition: result.h:51
FD_C_TwoDimArrayInt32 boxes
Definition: result.h:67
FD_C_SegmentationResult * data
Definition: result.h:90
Definition: result.h:66
FD_C_DetectionResult * data
Definition: result.h:62
FD_C_Bool contain_score_map
Definition: result.h:84
FASTDEPLOY_CAPI_EXPORT void FD_C_DetectionResultStr(__fd_keep FD_C_DetectionResult *fd_c_detection_result, char *str_buffer)
Print DetectionResult formated information.
FASTDEPLOY_CAPI_EXPORT __fd_give void FD_C_SegmentationResultStr(__fd_keep FD_C_SegmentationResult *fd_c_segmentation_result, char *str_buffer)
Print SegmentationResult formated information.
FD_C_ResultType type
Definition: result.h:57
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyOCRResultWrapper(__fd_take FD_C_OCRResultWrapper *fd_c_ocr_result_wrapper)
Destroy a FD_C_OCRResultWrapper object.
Definition: result.cc:273
FD_C_Mat FD_C_OCRResult * fd_c_ocr_result
Definition: model.cc:346
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyDetectionResult(__fd_take FD_C_DetectionResult *fd_c_detection_result)
Destroy a FD_C_DetectionResult object.
Definition: result.cc:120
struct FD_C_ClassifyResult FD_C_ClassifyResult
FD_C_Bool contain_masks
Definition: result.h:56
FD_C_OneDimArrayFloat score_map
Definition: result.h:82
Definition: fd_type.h:43
FD_C_TwoDimArrayFloat boxes
Definition: result.h:52
FD_C_OneDimArrayInt64 shape
Definition: result.h:42
Definition: result.h:75
struct FD_C_ClassifyResultWrapper FD_C_ClassifyResultWrapper
Definition: result.h:20
struct FD_C_OneDimClassifyResult FD_C_OneDimClassifyResult
Definition: fd_type.h:48
Definition: result.h:60
FD_C_OCRResultWrapper * fd_c_ocr_result_wrapper
Definition: model.cc:349
Definition: result.h:46
struct FD_C_SegmentationResultWrapper FD_C_SegmentationResultWrapper
Definition: result.h:23
FD_C_ResultType type
Definition: result.h:32
FD_C_OneDimArrayFloat rec_scores
Definition: result.h:69
FD_C_Mask * data
Definition: result.h:48
size_t size
Definition: result.h:47
FD_C_OneDimArrayUint8 data
Definition: result.h:41
FASTDEPLOY_CAPI_EXPORT __fd_give void FD_C_ClassifyResultWrapperToCResult(__fd_keep FD_C_ClassifyResultWrapper *fd_c_classify_result_wrapper, __fd_keep FD_C_ClassifyResult *fd_c_classify_result)
Get a FD_C_ClassifyResult object from FD_C_ClassifyResultWrapper object.
Definition: result.cc:49
FD_C_ResultType type
Definition: result.h:85
Definition: result.h:29
FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_ClassifyResultWrapper * FD_C_CreateClassifyResultWrapperFromCResult(__fd_keep FD_C_ClassifyResult *fd_c_classify_result)
Create a new FD_C_ClassifyResultWrapper object from FD_C_ClassifyResult object.
Definition: result.cc:72
FD_C_ClassifyResult * data
Definition: result.h:37
FD_C_OneDimArrayInt32 label_ids
Definition: result.h:54
FASTDEPLOY_CAPI_EXPORT void FD_C_OCRResultStr(__fd_keep FD_C_OCRResult *fd_c_ocr_result, char *str_buffer)
Print OCRResult formated information.
FD_C_ResultType type
Definition: result.h:72
struct FD_C_OneDimDetectionResult FD_C_OneDimDetectionResult
Definition: result.h:35
size_t size
Definition: result.h:76
FD_C_OCRResult * data
Definition: result.h:77
struct FD_C_OneDimSegmentationResult FD_C_OneDimSegmentationResult
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroySegmentationResultWrapper(__fd_take FD_C_SegmentationResultWrapper *fd_c_segmentation_result_wrapper)
Destroy a FD_C_SegmentationResultWrapper object.
Definition: result.cc:415
struct FD_C_OneDimMask FD_C_OneDimMask
FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_SegmentationResultWrapper * FD_C_CreateSegmentationResultWrapper()
Create a new FD_C_SegmentationResultWrapper object.
Definition: result.cc:406
FD_C_OneDimMask masks
Definition: result.h:55
struct FD_C_OneDimOCRResult FD_C_OneDimOCRResult
#define __fd_keep
Definition: fd_common.h:55
FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_SegmentationResultWrapper * FD_C_CreateSegmentationResultWrapperFromCResult(__fd_keep FD_C_SegmentationResult *fd_c_segmentation_result)
Create a new FD_C_SegmentationResultWrapper object from FD_C_SegmentationResult object.
Definition: result.cc:470
Definition: result.h:80
FD_C_OneDimArrayUint8 label_map
Definition: result.h:81
FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_OCRResultWrapper * FD_C_CreateOCRResultWrapperFromCResult(__fd_keep FD_C_OCRResult *fd_c_ocr_result)
Create a new FD_C_OCRResultWrapper object from FD_C_OCRResult object.
Definition: result.cc:349
FD_C_OneDimArrayCstr text
Definition: result.h:68
struct FD_C_OCRResultWrapper FD_C_OCRResultWrapper
Definition: result.h:22
#define __fd_take
Definition: fd_common.h:46
Definition: fd_type.h:23
size_t size
Definition: result.h:89
Definition: result.h:88
FASTDEPLOY_CAPI_EXPORT __fd_give void FD_C_ClassifyResultStr(__fd_keep FD_C_ClassifyResult *fd_c_classify_result, char *str_buffer)
Print ClassifyResult formated information.
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyDetectionResultWrapper(__fd_take FD_C_DetectionResultWrapper *fd_c_detection_result_wrapper)
Destroy a FD_C_DetectionResultWrapper object.
Definition: result.cc:115
#define __fd_give
Definition: fd_common.h:37
size_t size
Definition: result.h:36
FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_ClassifyResultWrapper * FD_C_CreateClassifyResultWrapper()
Create a new FD_C_ClassifyResultWrapper object.
Definition: result.cc:26
Definition: fd_type.h:73
FASTDEPLOY_CAPI_EXPORT void FD_C_DestroyClassifyResultWrapper(__fd_take FD_C_ClassifyResultWrapper *fd_c_classify_result_wrapper)
Destroy a FD_C_ClassifyResultWrapper object.
Definition: result.cc:35
FASTDEPLOY_CAPI_EXPORT __fd_give void FD_C_DetectionResultWrapperToCResult(__fd_keep FD_C_DetectionResultWrapper *fd_c_detection_result_wrapper, __fd_keep FD_C_DetectionResult *fd_c_detection_result)
Get a FD_C_DetectionResult object from FD_C_DetectionResultWrapper object.
Definition: result.cc:139
FD_C_ResultType type
Definition: result.h:43
struct FD_C_SegmentationResult FD_C_SegmentationResult
FASTDEPLOY_CAPI_EXPORT __fd_give void FD_C_SegmentationResultWrapperToCResult(__fd_keep FD_C_SegmentationResultWrapper *fd_c_segmentation_result_wrapper, __fd_keep FD_C_SegmentationResult *fd_c_segmentation_result)
Get a FD_C_SegmentationResult object from FD_C_SegmentationResultWrapper object.
Definition: result.cc:432
FASTDEPLOY_CAPI_EXPORT __fd_give FD_C_DetectionResultWrapper * FD_C_CreateDetectionResultWrapperFromCResult(__fd_keep FD_C_DetectionResult *fd_c_detection_result)
Create a new FD_C_DetectionResultWrapper object from FD_C_DetectionResult object. ...
Definition: result.cc:200
FD_C_OneDimArrayFloat scores
Definition: result.h:53
struct FD_C_DetectionResult FD_C_DetectionResult
Definition: fd_type.h:58
Definition: result.h:40
Definition: fd_type.h:33
Definition: fd_type.h:83