forked from hybridgroup/gocv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasyncarray.cpp
More file actions
38 lines (32 loc) · 850 Bytes
/
asyncarray.cpp
File metadata and controls
38 lines (32 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// +build openvino
#include <string.h>
#include "asyncarray.h"
// AsyncArray_New creates a new empty AsyncArray
AsyncArray AsyncArray_New() {
try {
return new cv::AsyncArray();
} catch(const cv::Exception& e){
setExceptionInfo(e.code, e.what());
return NULL;
}
}
// AsyncArray_Close deletes an existing AsyncArray
void AsyncArray_Close(AsyncArray a) {
delete a;
}
const char* AsyncArray_GetAsync(AsyncArray async_out,Mat out) {
try {
async_out->get(*out);
} catch(const cv::Exception& ex) {
return ex.what();
}
return "";
}
AsyncArray Net_forwardAsync(Net net, const char* outputName) {
try {
return new cv::AsyncArray(net->forwardAsync(outputName));
} catch(const cv::Exception& e){
setExceptionInfo(e.code, e.what());
return NULL;
}
}