diff options
author | Shubhanshu Saxena <shubhanshu.e01@gmail.com> | 2021-08-08 16:25:34 +0530 |
---|---|---|
committer | Guo Yejun <yejun.guo@intel.com> | 2021-08-10 22:27:27 +0800 |
commit | 0985e9283ca2fe85dd0744f97c869bf24fbf14b5 (patch) | |
tree | 38ac76448a122669ade0fc1aa7bc33f5f083d502 /libavfilter/dnn/dnn_interface.c | |
parent | e6ae8fc18e579e1ca750ed392da2df3474b88976 (diff) | |
download | ffmpeg-0985e9283ca2fe85dd0744f97c869bf24fbf14b5.tar.gz |
lavfi/dnn: Async Support for TensorFlow Backend
This commit enables async execution in the TensorFlow backend
and adds function to flush extra frames.
The async execution mechanism executes the TFInferRequests on
a separate thread which is joined before the next execution of
same TFRequestItem/while freeing the model.
The following is the comparison of this mechanism with the existing
sync mechanism on TensorFlow C API 2.5 CPU variant.
Async Mode: 4m32.846s
Sync Mode: 5m17.582s
The above was performed on super resolution filter using SRCNN model.
Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
Diffstat (limited to 'libavfilter/dnn/dnn_interface.c')
-rw-r--r-- | libavfilter/dnn/dnn_interface.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavfilter/dnn/dnn_interface.c b/libavfilter/dnn/dnn_interface.c index 02e532fc1b..81af934dd5 100644 --- a/libavfilter/dnn/dnn_interface.c +++ b/libavfilter/dnn/dnn_interface.c @@ -48,6 +48,9 @@ DNNModule *ff_get_dnn_module(DNNBackendType backend_type) #if (CONFIG_LIBTENSORFLOW == 1) dnn_module->load_model = &ff_dnn_load_model_tf; dnn_module->execute_model = &ff_dnn_execute_model_tf; + dnn_module->execute_model_async = &ff_dnn_execute_model_async_tf; + dnn_module->get_async_result = &ff_dnn_get_async_result_tf; + dnn_module->flush = &ff_dnn_flush_tf; dnn_module->free_model = &ff_dnn_free_model_tf; #else av_freep(&dnn_module); |