[FFmpeg-devel] [PATCH v2 FFmpeg 11/20] libavfilter/dnn_filter_common: dnn execute functions for CLIP and CLAP

Guo, Yejun yejun.guo at intel.com
Mon May 12 13:11:37 EEST 2025



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> m.kaindl0208 at gmail.com
> Sent: Tuesday, March 11, 2025 3:54 AM
> To: ffmpeg-devel at ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH v2 FFmpeg 11/20]
> libavfilter/dnn_filter_common: dnn execute functions for CLIP and CLAP
> 
> Signed-off-by: MaximilianKaindl <m.kaindl0208 at gmail.com>
> ---
>  libavfilter/dnn_filter_common.c | 81 +++++++++++++++++++++++----------
>  libavfilter/dnn_filter_common.h | 34 +++++++-------
>  2 files changed, 76 insertions(+), 39 deletions(-)
> 
> diff --git a/libavfilter/dnn_filter_common.c b/libavfilter/dnn_filter_common.c
> index 899e869cca..f3117748ae 100644
> --- a/libavfilter/dnn_filter_common.c
> +++ b/libavfilter/dnn_filter_common.c
> +int ff_dnn_execute_model_clip(DnnContext *ctx, AVFrame *in_frame,
> AVFrame *out_frame, const char **labels, int label_count, const char*
> tokenizer_path, char *target)
> +{
> +    DNNExecZeroShotClassificationParams class_params = {
> +        {
> +            .input_name     = ctx->model_inputname,
> +            .output_names   = (const char **)ctx->model_outputnames,
> +            .nb_output      = ctx->nb_outputs,
> +            .in_frame       = in_frame,
> +            .out_frame      = out_frame,
> +        },
> +        .labels = labels,
> +        .label_count = label_count,
> +        .tokenizer_path = tokenizer_path,

Why we need tokenizer_path to execute model since it is already initialized in load_model_with_tokenizer from patch 10.

> +        .target = target,
> +    };
> +    return (ctx->dnn_module->execute_model)(ctx->model,
> &class_params.base);
> +}
> +



More information about the ffmpeg-devel mailing list