-
- dr_context->input.dt = DNN_FLOAT;
- dr_context->dnn_module = ff_get_dnn_module(dr_context->backend_type);
- if (!dr_context->dnn_module) {
- av_log(ctx, AV_LOG_ERROR, "could not create DNN module for requested backend\n");
- return AVERROR(ENOMEM);
- }
- if (!dr_context->model_filename) {
- av_log(ctx, AV_LOG_ERROR, "model file for network is not specified\n");
- return AVERROR(EINVAL);
- }
- if (!dr_context->dnn_module->load_model) {
- av_log(ctx, AV_LOG_ERROR, "load_model for network is not specified\n");
- return AVERROR(EINVAL);
- }
-
- dr_context->model = (dr_context->dnn_module->load_model)(dr_context->model_filename, NULL);
- if (!dr_context->model) {
- av_log(ctx, AV_LOG_ERROR, "could not load DNN model\n");
- return AVERROR(EINVAL);
- }
-
- return 0;