{
template<typename T> struct AsyncInputQueue {
unsigned long frame_number {};
- void *handle {};
- mv_source_h inference_src;
std::vector<std::vector<T> > inputs;
- void *user_data {};
};
template<typename R> class AsyncManager
AsyncInputQueue<unsigned char> dstQueue;
dstQueue.frame_number = inputQueue.frame_number;
- dstQueue.handle = inputQueue.handle;
- dstQueue.inference_src = inputQueue.inference_src;
- dstQueue.user_data = inputQueue.user_data;
for (auto &elms : inputQueue.inputs) {
vector<unsigned char> dst_vector;
AsyncInputQueue<T> dstQueue;
dstQueue.frame_number = inputQueue.frame_number;
- dstQueue.handle = inputQueue.handle;
- dstQueue.inference_src = inputQueue.inference_src;
- dstQueue.user_data = inputQueue.user_data;
for (auto &elms : inputQueue.inputs) {
vector<T> dst_vector;
namespace machine_learning
{
struct ObjectDetectionInput {
- void *handle {};
mv_source_h inference_src;
// TODO.
};
auto context = static_cast<Context *>(handle);
auto task = static_cast<FaceDetectionTask *>(context->__tasks.at("face_detection"));
- ObjectDetectionInput input = { handle, source };
+ ObjectDetectionInput input = { source };
task->performAsync(input);
} catch (const BaseException &e) {
auto context = static_cast<Context *>(handle);
auto task = static_cast<ObjectDetectionTask *>(context->__tasks.at("object_detection"));
- ObjectDetectionInput input = { handle, source };
+ ObjectDetectionInput input = { source };
task->performAsync(input);
} catch (const BaseException &e) {
preprocess<T>(input.inference_src, metaInfo, inputVector);
vector<vector<T> > inputVectors = { inputVector };
- AsyncInputQueue<T> in_queue = { _input_frame_number, input.handle, input.inference_src, inputVectors };
+ AsyncInputQueue<T> in_queue = { _input_frame_number, inputVectors };
_async_manager->pushToInput<T>(in_queue);