This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new e13b2e00e8 avfilter/dnn: fix object detection of openvino backend
e13b2e00e8 is described below

commit e13b2e00e89dc8cdbb05cca7c22ebbbf8d9fd171
Author:     Guo Yejun <[email protected]>
AuthorDate: Tue Jul 28 22:41:41 2026 +0800
Commit:     Guo Yejun <[email protected]>
CommitDate: Wed Aug 5 21:11:34 2026 +0800

    avfilter/dnn: fix object detection of openvino backend
    
    update ctx->ov_option.layout to the explict value which will be
    used in function init_model_ov.
    
    also move the code before input_resizable which uses the layout
---
 libavfilter/dnn/dnn_backend_openvino.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_openvino.c 
b/libavfilter/dnn/dnn_backend_openvino.c
index 8df1f346ab..0df4d585e8 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -1088,16 +1088,20 @@ static int get_input_ov(DNNModel *model, DNNData 
*input, const char *input_name)
     }
     for (int i = 0; i < 4; i++)
         input->dims[i] = input_shape.dims[i];
+
+    if (ctx->ov_option.layout == DL_NONE) {
+        if (input_shape.dims[1] <= 3)
+            ctx->ov_option.layout = DL_NCHW;
+        else
+            ctx->ov_option.layout = DL_NHWC;
+    }
+    input->layout = ctx->ov_option.layout;
+
     if (input_resizable) {
         input->dims[dnn_get_width_idx_by_layout(input->layout)] = -1;
         input->dims[dnn_get_height_idx_by_layout(input->layout)] = -1;
     }
 
-    if (input_shape.dims[1] <= 3) // NCHW
-        input->layout = DL_NCHW;
-    else // NHWC
-        input->layout = DL_NHWC;
-
     input->dt       = precision_to_datatype(precision);
     ov_shape_free(&input_shape);
     return 0;

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to