History

avfilter/vf_dnn_detect: fix loading anchors when labels file is set

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.

Leandro Santiago committed 1 year ago

Commit 9d9ac8e1 parent 07e54f91 file · +6 −1Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_dnn_detect.c+6−1
@@ -695,8 +695,12 @@ static av_cold int dnn_detect_init(AVFilterContext *context) · 694 unmodified lines
695695 ff_dnn_set_detect_post_proc(&ctx->dnnctx, dnn_detect_post_proc);
696696
697697 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+ }
699702 }
703+
700704 if (ctx->anchors_str) {
701705 ret = dnn_detect_parse_anchors(ctx->anchors_str, &ctx->anchors);
702706 if (!ctx->anchors) {
@@ -705,6 +709,7 @@ static av_cold int dnn_detect_init(AVFilterContext *context) · 2 unmodified lines
705709 }
706710 ctx->nb_anchor = ret;
707711 }
712+
708713 return 0;
709714 }
710715

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t