Unified · Split
| @@ -225,6 +225,7 @@ static int fill_model_input_ov(OVModel *ov_model, OVRequestItem *request) · 224 unmodified lines | |||
| 225 | status = ov_port_get_element_type(ov_model->input_port, &precision); | 225 | status = ov_port_get_element_type(ov_model->input_port, &precision); |
| 226 | if (status != OK) { | 226 | if (status != OK) { |
| 227 | av_log(ctx, AV_LOG_ERROR, "Failed to get input port data type.\n"); | 227 | av_log(ctx, AV_LOG_ERROR, "Failed to get input port data type.\n"); |
| 228 | ov_shape_free(&input_shape); | ||
| 228 | return ov2_map_error(status, NULL); | 229 | return ov2_map_error(status, NULL); |
| 229 | } | 230 | } |
| 230 | } else { | 231 | } else { |
| @@ -236,8 +237,10 @@ static int fill_model_input_ov(OVModel *ov_model, OVRequestItem *request) · 5 unmodified lines | |||
| 236 | input.channels = dims[1]; | 237 | input.channels = dims[1]; |
| 237 | input.dt = precision_to_datatype(precision); | 238 | input.dt = precision_to_datatype(precision); |
| 238 | input.data = av_malloc(input.height * input.width * input.channels * get_datatype_size(input.dt)); | 239 | input.data = av_malloc(input.height * input.width * input.channels * get_datatype_size(input.dt)); |
| 239 | if (!input.data) | 240 | if (!input.data) { |
| 241 | ov_shape_free(&input_shape); | ||
| 240 | return AVERROR(ENOMEM); | 242 | return AVERROR(ENOMEM); |
| 243 | } | ||
| 241 | input_data_ptr = input.data; | 244 | input_data_ptr = input.data; |
| 242 | #else | 245 | #else |
| 243 | status = ie_infer_request_get_blob(request->infer_request, task->input_name, &input_blob); | 246 | status = ie_infer_request_get_blob(request->infer_request, task->input_name, &input_blob); |
| @@ -300,6 +303,7 @@ static int fill_model_input_ov(OVModel *ov_model, OVRequestItem *request) · 56 unmodified lines | |||
| 300 | } | 303 | } |
| 301 | #if HAVE_OPENVINO2 | 304 | #if HAVE_OPENVINO2 |
| 302 | status = ov_tensor_create_from_host_ptr(precision, input_shape, input.data, &tensor); | 305 | status = ov_tensor_create_from_host_ptr(precision, input_shape, input.data, &tensor); |
| 306 | ov_shape_free(&input_shape); | ||
| 303 | if (status != OK) { | 307 | if (status != OK) { |
| 304 | av_log(ctx, AV_LOG_ERROR, "Failed to create tensor from host prt.\n"); | 308 | av_log(ctx, AV_LOG_ERROR, "Failed to create tensor from host prt.\n"); |
| 305 | return ov2_map_error(status, NULL); | 309 | return ov2_map_error(status, NULL); |
| @@ -362,12 +366,14 @@ static void infer_completion_callback(void *args) · 56 unmodified lines | |||
| 362 | status = ov_port_get_element_type(ov_model->output_port, &precision); | 366 | status = ov_port_get_element_type(ov_model->output_port, &precision); |
| 363 | if (status != OK) { | 367 | if (status != OK) { |
| 364 | av_log(ctx, AV_LOG_ERROR, "Failed to get output port data type.\n"); | 368 | av_log(ctx, AV_LOG_ERROR, "Failed to get output port data type.\n"); |
| 369 | ov_shape_free(&output_shape); | ||
| 365 | return; | 370 | return; |
| 366 | } | 371 | } |
| 367 | output.channels = dims[1]; | 372 | output.channels = dims[1]; |
| 368 | output.height = dims[2]; | 373 | output.height = dims[2]; |
| 369 | output.width = dims[3]; | 374 | output.width = dims[3]; |
| 370 | av_assert0(request->lltask_count <= dims[0]); | 375 | av_assert0(request->lltask_count <= dims[0]); |
| 376 | ov_shape_free(&output_shape); | ||
| 371 | #else | 377 | #else |
| 372 | IEStatusCode status; | 378 | IEStatusCode status; |
| 373 | dimensions_t dims; | 379 | dimensions_t dims; |