summaryrefslogtreecommitdiff
path: root/libavfilter/dnn
Commit message (Collapse)AuthorAgeFilesLines
* lavfi/dnn: Remove DNN native backendTing Fu2023-04-2822-3037/+3
| | | | | | | | | | According to discussion in https://etherpad.mit.edu/p/FF_dev_meeting_20221202 and the proposal in http://ffmpeg.org/pipermail/ffmpeg-devel/2022-December/304534.html, the DNN native backend should be removed at first step. All the DNN native backend related codes are deleted. Signed-off-by: Ting Fu <ting.fu@intel.com>
* lavfi/dnn: modify dnn interface for removing native backendTing Fu2023-04-281-9/+1
| | | | | | | Native backend will be removed in following commits, so change the dnn interface and modify the error message in it first. Signed-off-by: Ting Fu <ting.fu@intel.com>
* lavfi/dnn: add error info for TF backend filling task failureTing Fu2023-03-261-0/+1
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* lavfi/dnn: fix mem leak in TF backend error handleTing Fu2023-03-261-0/+5
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* lavfi/dnn: fix corruption when TF backend infer failedTing Fu2023-03-261-14/+1
| | | | Signed-off-by: Ting Fu <ting.fu@intel.com>
* libavfilter/dnn: fix openvino async modeSaliev, Rafik F2022-12-171-1/+1
| | | | | | | | | | Bugfix: The OpenVino DNN backend in the 'async' mode sets 'task->inference_done' to 'complete' prior to data copy from OpenVino output buffer to task's output frame. This order causes task destroy in ff_dnn_get_result_common() prior to model output processing. Signed-off-by: Rafik Saliev <rafik.f.saliev@intel.com>
* lavf/dnn: dump OpenVINO model input/output names to OVMdel struct.Ting Fu2022-07-241-18/+48
| | | | | | | Dump all input/output names to OVModel struct. In case other funcs use them for reporting errors or locating issues. Signed-off-by: Ting Fu <ting.fu@intel.com>
* libavfilter: Remove DNNReturnType from DNN ModuleShubhanshu Saxena2022-03-1210-81/+81
| | | | | | | | | | This patch removes all occurences of DNNReturnType from the DNN module. This commit replaces DNN_SUCCESS by 0 (essentially the same), so the functions with DNNReturnType now return 0 in case of success, the negative values otherwise. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com> Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_common: Return specific error codesShubhanshu Saxena2022-03-122-30/+27
| | | | | | | Switch to returning specific error codes or DNN_GENERIC_ERROR when an error is encountered in the common DNN backend functions. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_native: Return Specific Error CodesShubhanshu Saxena2022-03-122-41/+45
| | | | | | | Switch to returning specific error codes or DNN_GENERIC_ERROR when an error is encountered. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_tf: Return Specific Error CodesShubhanshu Saxena2022-03-122-67/+85
| | | | | | | | Switch to returning specific error codes or DNN_GENERIC_ERROR when an error is encountered. For TensorFlow C API errors, currently DNN_GENERIC_ERROR is returned. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_openvino: Return Specific Error CodesShubhanshu Saxena2022-03-122-58/+84
| | | | | | | | Switch to returning specific error codes or DNN_GENERIC_ERROR when an error is encountered. For OpenVINO API errors, currently DNN_GENERIC_ERROR is returned. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_io_proc: Return Specific Error CodesShubhanshu Saxena2022-03-122-26/+30
| | | | | | | This commit returns specific error codes from the functions in the dnn_io_proc instead of DNN_ERROR. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: Error Specificity in Native Backend LayersShubhanshu Saxena2022-03-1213-30/+37
| | | | | | | This commit returns specific error codes from the execution functions in the Native Backend layers instead of DNN_ERROR. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt2021-09-201-1/+1
| | | | | | | They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavfi/dnn: Rename InferenceItem to LastLevelTaskItemShubhanshu Saxena2021-08-285-125/+125
| | | | | | | | | | | | | | | This patch renames the InferenceItem to LastLevelTaskItem in the three backends to avoid confusion among the meanings of these structs. The following are the renames done in this patch: 1. extract_inference_from_task -> extract_lltask_from_task 2. InferenceItem -> LastLevelTaskItem 3. inference_queue -> lltask_queue 4. inference -> lltask 5. inference_count -> lltask_count Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* libavfilter: Remove Async Flag from DNN Filter SideShubhanshu Saxena2021-08-281-0/+7
| | | | | | | Remove async flag from filter's perspective after the unification of async and sync modes in the DNN backend. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* libavfilter: Unify Execution Modes in DNN FiltersShubhanshu Saxena2021-08-289-109/+115
| | | | | | | | | | | | | | | | | | | | | | | This commit unifies the async and sync mode from the DNN filters' perspective. As of this commit, the Native backend only supports synchronous execution mode. Now the user can switch between async and sync mode by using the 'async' option in the backend_configs. The values can be 1 for async and 0 for sync mode of execution. This commit affects the following filters: 1. vf_dnn_classify 2. vf_dnn_detect 3. vf_dnn_processing 4. vf_sr 5. vf_derain This commit also updates the filters vf_dnn_detect and vf_dnn_classify to send only the input frame and send NULL as output frame instead of input frame to the DNN backends. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: Task-based Inference in Native BackendShubhanshu Saxena2021-08-282-57/+121
| | | | | | | This commit rearranges the code in Native Backend to use the TaskItem for inference. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: DNNAsyncExecModule Execution Failure HandlingShubhanshu Saxena2021-08-102-5/+28
| | | | | | | | | This commit adds the case handling if the asynchronous execution of a request fails by checking the exit status of the thread when joining before starting another execution. On failure, it does the cleanup as well. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_tf: Error Handling for tf_create_inference_requestShubhanshu Saxena2021-08-101-0/+3
| | | | | | | This commit includes the check for the case when the newly created TFInferRequest is NULL. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: Extract Common Parts from get_output functionsShubhanshu Saxena2021-08-104-63/+72
| | | | | | | | The frame allocation and filling the TaskItem with execution parameters is common in the three backends. This commit shifts this logic to dnn_backend_common. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_tf: Add TF_Status to TFRequestItemShubhanshu Saxena2021-08-101-3/+6
| | | | | | | | | Since requests are running in parallel, there is inconsistency in the status of the execution. To resolve it, we avoid using mutex as it would result in single TF_Session running at a time. So add TF_Status to the TFRequestItem Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_tf: Error Handling for execute_model_tfShubhanshu Saxena2021-08-101-16/+36
| | | | | | | | This patch adds error handling for cases where the execute_model_tf fails, clears the used memory in the TFRequestItem and finally pushes it back to the request queue. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: Async Support for TensorFlow BackendShubhanshu Saxena2021-08-103-18/+109
| | | | | | | | | | | | | | | | | | | 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>
* lavfi/dnn_backend_tf: TFInferRequest Execution and DocumentationShubhanshu Saxena2021-08-101-0/+45
| | | | | | | This commit adds a function for execution of TFInferRequest and documentation for functions related to TFInferRequest. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: Common Function to Get Async Result in DNN BackendsShubhanshu Saxena2021-08-104-17/+37
| | | | | | | This commits refactors the get async result function for common use in all three backends. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: Add Async Execution Mechanism and DocumentationShubhanshu Saxena2021-08-102-0/+109
| | | | | | | | | This commit adds an async execution mechanism for common use in the TensorFlow and Native backends. This commit also adds the documentation of typedefs and functions in the async module for common use in DNN backends. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* avfilter/internal: Don't include libavcodec/(avcodec|internal).hAndreas Rheinhardt2021-08-051-0/+1
| | | | | | | | | The reasons for including them don't exist any longer: ff_tlog() has been moved to libavutil/internal.h and FF_QSCALE_TYPE_* has been moved to qp_table.h. Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Remove unnecessary avassert.h inclusionsAndreas Rheinhardt2021-07-225-5/+0
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/avcodec: Don't include cpu.hAndreas Rheinhardt2021-07-222-0/+2
| | | | | | | It is not used here at all; instead, add it where it is used without including it or any of the arch-specific CPU headers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavfi/dnn_backend_ov: Rename RequestItem to OVRequestItemShubhanshu Saxena2021-07-221-12/+12
| | | | | | | Rename RequestItem to OVRequestItem in the OpenVINO backend to avoid confusion. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_openvino.c: Fix Memory Leak in execute_model_ovShubhanshu Saxena2021-07-221-2/+4
| | | | | | | | In cases where the execution inside the function execute_model_ov fails, the OVRequestItem must be pushed back to the request_queue before returning the error. In case pushing back fails, release the allocated memory. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_tf: Error HandlingShubhanshu Saxena2021-07-111-20/+60
| | | | | | | This commit adds handling for cases where an error may occur, clearing the allocated memory resources. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_tf: Separate function for Completion CallbackShubhanshu Saxena2021-07-111-48/+61
| | | | | | | This commit rearranges the existing code to create a separate function for the completion callback in execute_model_tf. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_tf: Separate function for filling RequestItemShubhanshu Saxena2021-07-111-57/+80
| | | | | | | This commit rearranges the existing code to create separate function for filling request with execution data. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_tf: Request-based ExecutionShubhanshu Saxena2021-07-113-70/+91
| | | | | | | | This commit uses TFRequestItem and the existing sync execution mechanism to use request-based execution. It will help in adding async functionality to the TensorFlow backend later. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_tf: Add TFInferRequest and TFRequestItemShubhanshu Saxena2021-07-111-0/+49
| | | | | | | | This commit introduces a typedef TFInferRequest to store execution parameters for a single call to the TensorFlow C API. This typedef is used in the TFRequestItem. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_tf: TaskItem Based InferenceShubhanshu Saxena2021-07-111-40/+94
| | | | | | | This commit uses the common TaskItem and InferenceItem typedefs for execution in TensorFlow backend. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_openvino.c: Fix Memory Leak in execute_model_ovShubhanshu Saxena2021-07-041-3/+9
| | | | | | | | In cases where the execution inside the function execute_model_ov fails, push the RequestItem back to the request_queue before returning the error. In case pushing back fails, release the allocated memory. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn_backend_openvino.c: fix crash when target is not specifiedGuo Yejun2021-06-191-2/+4
|
* lavfi/dnn_backend_openvino.c: Fix Memory Leak for RequestItemShubhanshu Saxena2021-06-181-0/+2
| | | | | | | Fix memory leak for RequestItem upon error while pushing to the request_queue in the completion callback. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: Fill Task using Common FunctionShubhanshu Saxena2021-06-123-16/+42
| | | | | | | This commit adds a common function for filling the TaskItems in all three backends. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: Use uint8_t for async and do_ioproc in TaskItemsShubhanshu Saxena2021-06-121-2/+2
| | | | | | | These properties have values either 0 or 1, so using uint8_t is a better option as compared to int. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: Add nb_output to TaskItemShubhanshu Saxena2021-06-122-0/+4
| | | | | | | Add nb_output property to TaskItem for use in TensorFlow backend and Native backend. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: Convert output_name to char** in TaskItemShubhanshu Saxena2021-06-122-6/+6
| | | | | | | Convert output_name to char **output_names in TaskItem and use it as a pointer to array of output names in the DNN backend. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: Extract TaskItem and InferenceItem from OpenVino BackendShubhanshu Saxena2021-06-122-37/+40
| | | | | | | Extract TaskItem and InferenceItem from OpenVino backend and convert ov_model to void in TaskItem. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn/dnn_io_proc.c: fix CID 1484955Guo Yejun2021-06-051-1/+1
| | | | CID 1484955: Memory - corruptions (ARRAY_VS_SINGLETON)
* lavfi/dnn_backend_openvino.c: Correct Pointer Type while FreeingShubhanshu Saxena2021-05-281-1/+1
| | | | | | | This commit corrects the type of pointer of elements from the inference queue in ff_dnn_free_model_ov. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
* lavfi/dnn: refine code to separate processing and detection in backendsGuo, Yejun2021-05-245-25/+24
|