From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 398AB486BE for ; Wed, 17 Jan 2024 07:22:24 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 845A668D058; Wed, 17 Jan 2024 09:22:13 +0200 (EET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4E19F68D041 for ; Wed, 17 Jan 2024 09:22:05 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705476131; x=1737012131; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=oRdKpEeZB2/dGtMtFlPlGKholIVdh+7a6AL/XjZyRLk=; b=ntba49rW6Xrjxskriz19bn2JfkTV5fKbJU2BdYte15eao7w3sZQVGBs1 mOpW6jJRf8orO8l8LHgTYXCzEiRI9KpIUXPouWGlul0lksqMKa9D/WfRO jXBiihdgRl9yqDGKxljjPzivt7obpP4YxbmqWtvr71C+s7vVBcCSERhb8 XYjRD1YS20AFXNgzTLlHbs/o7UxW4YtKgj5M4dgjmdrIz1REMKz7uInwg 4mpjIWSka++CkPQYR3zARi2cVYQe4EjamLlknB639nktyz/2mhr+B0lTS UAa/7lgVVdXak/aZk+OHDpa9HzMFsVySaP6ol9Ag9nd4MLb3zabvXDzac g==; X-IronPort-AV: E=McAfee;i="6600,9927,10955"; a="6850317" X-IronPort-AV: E=Sophos;i="6.05,200,1701158400"; d="scan'208";a="6850317" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2024 23:21:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10955"; a="1031256787" X-IronPort-AV: E=Sophos;i="6.05,200,1701158400"; d="scan'208";a="1031256787" Received: from wenbin-z390-aorus-ultra.sh.intel.com ([10.239.156.43]) by fmsmga006.fm.intel.com with ESMTP; 16 Jan 2024 23:21:55 -0800 From: wenbin.chen-at-intel.com@ffmpeg.org To: ffmpeg-devel@ffmpeg.org Date: Wed, 17 Jan 2024 15:21:51 +0800 Message-Id: <20240117072151.2155795-3-wenbin.chen@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240117072151.2155795-1-wenbin.chen@intel.com> References: <20240117072151.2155795-1-wenbin.chen@intel.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] libavfilter/vf_dnn_detect: Use class confidence to filt boxes X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Wenbin Chen Use class confidence instead of box_score to filt boxes, which is more accurate. Class confidence is obtained by multiplying class probability distribution and box_score. Signed-off-by: Wenbin Chen --- libavfilter/vf_dnn_detect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_dnn_detect.c b/libavfilter/vf_dnn_detect.c index caccbf7a12..2bf5ed7476 100644 --- a/libavfilter/vf_dnn_detect.c +++ b/libavfilter/vf_dnn_detect.c @@ -236,9 +236,6 @@ static int dnn_detect_parse_yolo_output(AVFrame *frame, DNNData *output, int out conf = post_process_raw_data( detection_boxes_data[cy * cell_w + cx + 4 * cell_w * cell_h]); } - if (conf < conf_threshold) { - continue; - } if (is_NHWC) { x = post_process_raw_data(detection_boxes_data[0]); @@ -257,6 +254,9 @@ static int dnn_detect_parse_yolo_output(AVFrame *frame, DNNData *output, int out conf = conf * post_process_raw_data( detection_boxes_data[cy * cell_w + cx + (label_id + 5) * cell_w * cell_h]); } + if (conf < conf_threshold) { + continue; + } bbox = av_mallocz(sizeof(*bbox)); if (!bbox) -- 2.34.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".