summaryrefslogtreecommitdiff
path: root/libavfilter/vf_dnn_processing.c
diff options
context:
space:
mode:
authorGuo, Yejun <yejun.guo@intel.com>2020-08-13 16:19:48 +0800
committerGuo, Yejun <yejun.guo@intel.com>2020-08-25 09:02:59 +0800
commit0f7a99e37ae52f9ecdc4c81195c14b03f5be3dfd (patch)
tree00b5828f4f284ec9e363708ed89d4b2294e62a52 /libavfilter/vf_dnn_processing.c
parentb61376bdee61c08732105fa331eb076497eface9 (diff)
dnn: move output name from DNNModel.set_input_output to DNNModule.execute_model
currently, output is set both at DNNModel.set_input_output and DNNModule.execute_model, it makes sense that the output name is provided at model inference time so all the output info is set at a single place. and so DNNModel.set_input_output is renamed to DNNModel.set_input Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Diffstat (limited to 'libavfilter/vf_dnn_processing.c')
-rw-r--r--libavfilter/vf_dnn_processing.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavfilter/vf_dnn_processing.c b/libavfilter/vf_dnn_processing.c
index b6dfc4e697..f78800f7c0 100644
--- a/libavfilter/vf_dnn_processing.c
+++ b/libavfilter/vf_dnn_processing.c
@@ -218,9 +218,8 @@ static int config_input(AVFilterLink *inlink)
ctx->input.channels = model_input.channels;
ctx->input.dt = model_input.dt;
- result = (ctx->model->set_input_output)(ctx->model->model,
- &ctx->input, ctx->model_inputname,
- (const char **)&ctx->model_outputname, 1);
+ result = (ctx->model->set_input)(ctx->model->model,
+ &ctx->input, ctx->model_inputname);
if (result != DNN_SUCCESS) {
av_log(ctx, AV_LOG_ERROR, "could not set input and output for the model\n");
return AVERROR(EIO);
@@ -309,7 +308,7 @@ static int config_output(AVFilterLink *outlink)
DNNReturnType result;
// have a try run in case that the dnn model resize the frame
- result = (ctx->dnn_module->execute_model)(ctx->model, &ctx->output, 1);
+ result = (ctx->dnn_module->execute_model)(ctx->model, &ctx->output, (const char **)&ctx->model_outputname, 1);
if (result != DNN_SUCCESS){
av_log(ctx, AV_LOG_ERROR, "failed to execute model\n");
return AVERROR(EIO);
@@ -456,7 +455,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
copy_from_frame_to_dnn(ctx, in);
- dnn_result = (ctx->dnn_module->execute_model)(ctx->model, &ctx->output, 1);
+ dnn_result = (ctx->dnn_module->execute_model)(ctx->model, &ctx->output, (const char **)&ctx->model_outputname, 1);
if (dnn_result != DNN_SUCCESS){
av_log(ctx, AV_LOG_ERROR, "failed to execute model\n");
av_frame_free(&in);