Add dummy buffer to inference_engine_tensor_buffers for output buffers
authorTae-Young Chung <ty83.chung@samsung.com>
Wed, 8 Apr 2020 04:17:10 +0000 (13:17 +0900)
committerInki Dae <inki.dae@samsung.com>
Mon, 20 Apr 2020 00:51:05 +0000 (09:51 +0900)
In case of object detection, mobilenet-ssd, its output may be null and
it causes the memory allocation at inference-engine-interface
not from opencv itself.
To handle that case, temporally add dummy buffer.

Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
src/inference_engine_opencv.cpp

index 80ce922fd4d4d14bef7a441f6dc2fac381af5fe9..1e04003c4b055a14cdb710a34823d7aa27126da6 100644 (file)
@@ -150,6 +150,12 @@ int InferenceOpenCV::GetOutputTensorBuffers(std::vector<inference_engine_tensor_
         buffers.push_back(buffer);
     }
 
+    if (buffers.empty()) {
+        LOGI("buff empty");
+        inference_engine_tensor_buffer buffer = { nullptr, TENSOR_DATA_TYPE_FLOAT32, 0, 1};
+        buffers.push_back(buffer);
+    }
+
     LOGI("LEAVE");
 
     return INFERENCE_ENGINE_ERROR_NONE;