/** flush inference **/
status = bm_mem_flush_device_mem(bm_handle_, &input_tensor_.device_mem);
/** ssd inference **/
bool ret = bmrt_launch_tensor_ex(p_bmrt_, net_names_[0], &input_tensor_,
1, &output_tensor_, 1, true, false);
/** sync, wait for finishing inference **/
status = bm_thread_sync(bm_handle_);
/** free device memory **/
status = bm_mem_invalidate_device_mem(bm_handle_,
&output_tensor_.device_mem);
/** get the number of the elements with shape **/
int output_count = bmrt_shape_count(&output_shape);
/** parse the output tensor with elements**/
for (int i = 0; i < output_count; i += 7) {
...
/** output_ is a system global memory for output tensor**/
float *proposal = &output_[i];
detection.class_id = proposal[1];
detection.score = proposal[2];
detection.x1 = proposal[3] * image.cols;
detection.y1 = proposal[4] * image.rows;
detection.x2 = proposal[5] * image.cols;
detection.y2 = proposal[6] * image.rows;
}