[FFmpeg-devel] [PATCH v2] libavfi/dnn: add LibTorch as one of DNN backend

Jean-Baptiste Kempf jb at videolan.org
Wed Feb 14 00:48:38 EET 2024


Hello,

On Fri, 2 Feb 2024, at 08:26, wenbin.chen-at-intel.com at ffmpeg.org wrote:
> +static void infer_completion_callback(void *args) {
> +    THRequestItem *request = (THRequestItem*)args;
> +    LastLevelTaskItem *lltask = request->lltask;
> +    TaskItem *task = lltask->task;
> +    DNNData outputs = { 0 };
> +    THInferRequest *infer_request = request->infer_request;
> +    THModel *th_model = (THModel *)task->model;
> +    torch::Tensor *output = infer_request->output;
> +
> +    c10::IntArrayRef sizes = output->sizes();
> +    assert(sizes.size == 5);

Why 5?

> +    outputs.order = DCO_RGB;
> +    outputs.layout = DL_NCHW;
> +    outputs.dims[2] = sizes.at(3);
> +    outputs.dims[3] = sizes.at(4);
> +    outputs.dt = DNN_FLOAT;
> +    outputs.dims[1] = 3;

Why 3?


-- 
Jean-Baptiste Kempf -  President
+33 672 704 734


More information about the ffmpeg-devel mailing list