From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ffmpeg-devel-bounces@ffmpeg.org>
Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100])
	by master.gitmailbox.com (Postfix) with ESMTPS id 27B874B0ED
	for <ffmpegdev@gitmailbox.com>; Tue, 25 Mar 2025 11:40:28 +0000 (UTC)
Received: from [127.0.1.1] (localhost [127.0.0.1])
	by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C2ADF687B95;
	Tue, 25 Mar 2025 13:40:26 +0200 (EET)
Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com
 [209.85.128.43])
 by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 35367687B47
 for <ffmpeg-devel@ffmpeg.org>; Tue, 25 Mar 2025 13:40:20 +0200 (EET)
Received: by mail-wm1-f43.google.com with SMTP id
 5b1f17b1804b1-43ce71582e9so37589305e9.1
 for <ffmpeg-devel@ffmpeg.org>; Tue, 25 Mar 2025 04:40:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1742902819; x=1743507619; darn=ffmpeg.org;
 h=content-language:thread-index:mime-version:message-id:date:subject
 :to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=eAoF2hNK4m79/P+t4X7NHHKejlqDsnXZe5bWEWU8Gwo=;
 b=HvEQT3kajpLS/vGfD1w+h0YS1vAUo1j4+oWYL/bxvQYMeDNWdzYtTP/2e1yKVkQktO
 F0FoglsgQ8LN9uUHhK7KYFeu1z/FcL1dfHZnW+Y3n0W5vKh4xpDcNNywY1XkvCS7AbQk
 ciI0Rgw8sIb7FlkwsoMONumn6UFxfFxPgnJ7yOrChGpo9TFCzyXD/O+cQb6kKCjKa9K6
 vF6qQIN4St7u/ubFPh7Z70VpsQDdGgfC8FWrxm6a56Lr1CBXDF5LfscLu+amRRgA5qBs
 DMRsuJ6/9l3A8X8PO5HTV1MMjKHo2+1T8GagvjqXlu8Ow8yZjMfMKeWiZuOPgxvWQHry
 x5Dw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1742902819; x=1743507619;
 h=content-language:thread-index:mime-version:message-id:date:subject
 :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=eAoF2hNK4m79/P+t4X7NHHKejlqDsnXZe5bWEWU8Gwo=;
 b=GewRZrM3iNzNGiCvgRUCnPjoUp2efeFnyDjMG9KJdf/UtI5EWPbK3XzS0CrD+E/oZb
 D6FyUxWm+mufFSD391Rj3iBVnY2VOGQD4x/QVv+upWhUCG9zzr1wzSKxbXKy1YuIDc00
 JTHTFxH5XCQG9iNqoTK6CNELMFUJMcq6cu5tJNwCqGvu776vOWHJ1EPGzZ0adXmAJg+Q
 Kr6SjDQu7NlujEKo39cLIMySwTPobDIrMkrkE/ajgQYAk/RmWu2DIWP5kxlkkqQwa/Y3
 Dv2yIgkrQo/+oOnW/w3ZBNEbrEjqyjwMDBkdjTrgxRczqwYrQkEVixvADFH0lggQ/0fI
 6Cvw==
X-Gm-Message-State: AOJu0YyqU+LgBmFtg+yuoJLiecfDIDI0dHZaPMH34n0sSpmspscyraEV
 HXiNMAYLpAmlJCY54Dl1GNq2pgok+rdlqxNqHNenipCh4JbJY3f6Y/cngg==
X-Gm-Gg: ASbGnctWQ9m9iFHiVw3Kp7VxXnIcExGW6oCj6PWKDNLEjUCOzkdlw29UE/LIHOdrUgD
 yNxUUT758RYqU+eEKuJmhI5yGDFW5IDInOoaZ3v72G2itZYS78SfnUr2v1Qv/LTnM2ay+EYXI92
 S6XK8PaPBvRWFj8wGpQBkUvGGSY8QljknsvWR4/Ok5tCPn85kTU3uoUP9Phj6HkbaybMmPMvm5c
 4Dww8ubdtkhsKiu0uyXAPb8UNVoKEGjNhsZ2uKUUa0q2lh77jQ2rCAqNyq7BcuP8hx9FHuBxU1y
 Alw1mDPdOwP1rFC+06wnkaqtJ36cFuzu10/SzuW6sCZa9XnNEF3kxg0Sc+2bNygNBaOed7FCUNS
 +pZhAfDAfsusQMsFm
X-Google-Smtp-Source: AGHT+IGoZnBQOjG3+IXrEYojoRa5RqC5KP4/RSMffTavpj7JdM9k986FMxoNynMf7i0gKmCyGQFbPg==
X-Received: by 2002:a05:600c:b88:b0:43d:683:8caa with SMTP id
 5b1f17b1804b1-43d509f643cmr170095765e9.15.1742902818558; 
 Tue, 25 Mar 2025 04:40:18 -0700 (PDT)
Received: from MK2 (80-108-16-220.cable.dynamic.surfer.at. [80.108.16.220])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-43d4fd27980sm150732265e9.21.2025.03.25.04.40.17
 for <ffmpeg-devel@ffmpeg.org>
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 25 Mar 2025 04:40:18 -0700 (PDT)
From: <m.kaindl0208@gmail.com>
To: <ffmpeg-devel@ffmpeg.org>
Date: Tue, 25 Mar 2025 12:40:19 +0100
Message-ID: <027101db9d7a$b004d800$100e8800$@gmail.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="----=_NextPart_000_0272_01DB9D83.11C96710"
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AduddrpV0Sd6rW4hSfS2+dGIqNChRg==
Content-Language: en-at
X-Content-Filtered-By: Mailman/MimeDel 2.1.29
Subject: [FFmpeg-devel] Integration of CLIP/ CLAP Functionallity
X-BeenThere: ffmpeg-devel@ffmpeg.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: FFmpeg development discussions and patches <ffmpeg-devel.ffmpeg.org>
List-Unsubscribe: <https://ffmpeg.org/mailman/options/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=unsubscribe>
List-Archive: <https://ffmpeg.org/pipermail/ffmpeg-devel>
List-Post: <mailto:ffmpeg-devel@ffmpeg.org>
List-Help: <mailto:ffmpeg-devel-request@ffmpeg.org?subject=help>
List-Subscribe: <https://ffmpeg.org/mailman/listinfo/ffmpeg-devel>,
 <mailto:ffmpeg-devel-request@ffmpeg.org?subject=subscribe>
Reply-To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Errors-To: ffmpeg-devel-bounces@ffmpeg.org
Sender: "ffmpeg-devel" <ffmpeg-devel-bounces@ffmpeg.org>
Archived-At: <https://master.gitmailbox.com/ffmpegdev/027101db9d7a$b004d800$100e8800$@gmail.com/>
List-Archive: <https://master.gitmailbox.com/ffmpegdev/>
List-Post: <mailto:ffmpegdev@gitmailbox.com>

This is a multipart message in MIME format.

------=_NextPart_000_0272_01DB9D83.11C96710
Content-Type: text/plain;
	charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Hi,

=20

I have been working on this feature =
<https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=3D14066>  and =
have completed my project already a while ago. I believe this could be a =
valuable addition to the FFmpeg project and would like to ask whether =
the community is interested in it.

=20

If there is interest, I would appreciate it if someone could co-author =
the submission with me. If the feature is not desired, I will not =
continue working on it.

=20

Furthermore, I would like to know the best approach to add this patch to =
my series. Should I create a new version, or is there a way to link it =
to my commit number 17?

=20

Thanks!


------=_NextPart_000_0272_01DB9D83.11C96710
Content-Type: application/octet-stream;
	name="0021-libavfilter-classify-fix-category-post_processing-wi.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="0021-libavfilter-classify-fix-category-post_processing-wi.patch"

>From 499de7be409ba7668defac9214a8343344bd21ee Mon Sep 17 00:00:00 2001=0A=
From: MaximilianKaindl <m.kaindl0208@gmail.com>=0A=
Date: Wed, 12 Mar 2025 10:10:58 +0100=0A=
Subject: [PATCH v2 FFmpeg 21/20] libavfilter: classify fix category =
post_processing=0A=
 with very low temperature=0A=
To: ffmpeg-devel@ffmpeg.org=0A=
=0A=
Signed-off-by: MaximilianKaindl <m.kaindl0208@gmail.com>=0A=
---=0A=
 libavfilter/avf_dnn_classify.c | 24 ++++++++++++++----------=0A=
 1 file changed, 14 insertions(+), 10 deletions(-)=0A=
=0A=
diff --git a/libavfilter/avf_dnn_classify.c =
b/libavfilter/avf_dnn_classify.c=0A=
index 7b469e3af0..ade55858ad 100644=0A=
--- a/libavfilter/avf_dnn_classify.c=0A=
+++ b/libavfilter/avf_dnn_classify.c=0A=
@@ -34,6 +34,7 @@=0A=
 #include "libavutil/opt.h"=0A=
 #include "libavutil/time.h"=0A=
 #include "video.h"=0A=
+#include <float.h>=0A=
=0A=
 /*=0A=
     Labels that are being used to classify the image=0A=
@@ -579,7 +580,7 @@ static int =
get_category_total_label_count(CategoryClassifcationContext *cat_ctx,=0A=
 static CategoryContext *get_best_category(CategoriesContext =
*categories_ctx, float *probabilities)=0A=
 {=0A=
     CategoryContext *best_category =3D NULL;=0A=
-    float best_probability =3D -1.0f;=0A=
+    float best_probability =3D FLT_MIN;=0A=
     int prob_offset =3D 0;=0A=
=0A=
     // Calculate total probability for each category=0A=
@@ -592,7 +593,7 @@ static CategoryContext =
*get_best_category(CategoriesContext *categories_ctx, flo=0A=
             category->total_probability +=3D probabilities[prob_offset =
+ label_idx];=0A=
         }=0A=
=0A=
-        if (category->total_probability > best_probability) {=0A=
+        if (category->total_probability > best_probability && =
category->total_probability > 0.0f) {=0A=
             best_probability =3D category->total_probability;=0A=
             best_category =3D category;=0A=
         }=0A=
@@ -761,7 +762,8 @@ static int post_proc_clxp_categories(AVFrame *frame, =
DNNData *output, uint32_t b=0A=
         av_freep(&ctx_labels);=0A=
         return AVERROR(ENOMEM);=0A=
     }=0A=
-=0A=
+=0A=
+    int category_count =3D 0;=0A=
     // Process each context=0A=
     for (int ctx_idx =3D 0; ctx_idx < cat_class_ctx->num_contexts; =
ctx_idx++) {=0A=
         CategoriesContext *categories_ctx =3D =
cat_class_ctx->category_units[ctx_idx];=0A=
@@ -773,20 +775,22 @@ static int post_proc_clxp_categories(AVFrame =
*frame, DNNData *output, uint32_t b=0A=
         // Find best category in context=0A=
         best_category =3D get_best_category(categories_ctx, =
probabilities + prob_offset);=0A=
         if (!best_category || !best_category->name) {=0A=
-            av_log(filter_ctx, AV_LOG_ERROR, "Invalid best category at =
context %d\n", ctx_idx);=0A=
+            // No category classification found=0A=
             continue;=0A=
         }=0A=
=0A=
         // Copy category name instead of assigning pointer=0A=
-        av_strlcpy(ctx_labels[ctx_idx], best_category->name, =
AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE);=0A=
-        ctx_probabilities[ctx_idx] =3D best_category->total_probability;=0A=
+        av_strlcpy(ctx_labels[category_count], best_category->name, =
AV_DETECTION_BBOX_LABEL_NAME_MAX_SIZE);=0A=
+        ctx_probabilities[category_count] =3D =
best_category->total_probability;=0A=
=0A=
         prob_offset +=3D categories_ctx->label_count;=0A=
+        category_count++;=0A=
+    }=0A=
+    if(category_count > 0){=0A=
+        // Fill bbox with best categories=0A=
+        ret =3D fill_detection_bbox_with_best_labels(ctx_labels, =
ctx_probabilities, cat_class_ctx->num_contexts, bbox,=0A=
+            AV_NUM_DETECTION_BBOX_CLASSIFY, ctx->confidence);=0A=
     }=0A=
-=0A=
-    // Fill bbox with best labels=0A=
-    ret =3D fill_detection_bbox_with_best_labels(ctx_labels, =
ctx_probabilities, cat_class_ctx->num_contexts, bbox,=0A=
-                                                =
AV_NUM_DETECTION_BBOX_CLASSIFY, ctx->confidence);=0A=
=0A=
     // Clean up=0A=
     for (int i =3D 0; i < cat_class_ctx->num_contexts; i++) {=0A=
-- =0A=
2.34.1=0A=
=0A=

------=_NextPart_000_0272_01DB9D83.11C96710
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
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".

------=_NextPart_000_0272_01DB9D83.11C96710--