References https://trac.ffmpeg.org/ticket/11387 Defining anchors is needed, even when a filename with the labels is set. The issue was identified when using yolov4-tiny model using openvino. More information about how to reproduce the bug can be found on the trac issue referenced by this commit.
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -695,8 +695,12 @@ static av_cold int dnn_detect_init(AVFilterContext *context) · 694 unmodified lines | |||
| 695 | ff_dnn_set_detect_post_proc(&ctx->dnnctx, dnn_detect_post_proc); | 695 | ff_dnn_set_detect_post_proc(&ctx->dnnctx, dnn_detect_post_proc); |
| 696 | 696 | ||
| 697 | if (ctx->labels_filename) { | 697 | if (ctx->labels_filename) { |
| 698 | return read_detect_label_file(context); | 698 | ret = read_detect_label_file(context); |
| 699 | if (ret) { | ||
| 700 | return ret; | ||
| 701 | } | ||
| 699 | } | 702 | } |
| 703 | |||
| 700 | if (ctx->anchors_str) { | 704 | if (ctx->anchors_str) { |
| 701 | ret = dnn_detect_parse_anchors(ctx->anchors_str, &ctx->anchors); | 705 | ret = dnn_detect_parse_anchors(ctx->anchors_str, &ctx->anchors); |
| 702 | if (!ctx->anchors) { | 706 | if (!ctx->anchors) { |
| @@ -705,6 +709,7 @@ static av_cold int dnn_detect_init(AVFilterContext *context) · 2 unmodified lines | |||
| 705 | } | 709 | } |
| 706 | ctx->nb_anchor = ret; | 710 | ctx->nb_anchor = ret; |
| 707 | } | 711 | } |
| 712 | |||
| 708 | return 0; | 713 | return 0; |
| 709 | } | 714 | } |
| 710 | 715 | ||