History

lavfi/dnn_backend_openvino.c: move the logic for batch mode earlier

Guo, Yejun committed 5 years ago

Commit 7eb9acc1 parent e37cc721 file · +5 −7Browse files

Unified · Split

libavfilter/dnn/dnn_backend_openvino.c+5−7
@@ -432,13 +432,6 @@ static DNNReturnType execute_model_ov(RequestItem *request, Queue *inferenceq) · 431 unmodified lines
432432 ctx = &task->ov_model->ctx;
433433
434434 if (task->async) {
435− if (ff_queue_size(inferenceq) < ctx->options.batch_size) {
436− if (ff_safe_queue_push_front(task->ov_model->request_queue, request) < 0) {
437− av_log(ctx, AV_LOG_ERROR, "Failed to push back request_queue.\n");
438− return DNN_ERROR;
439− }
440− return DNN_SUCCESS;
441− }
442435 ret = fill_model_input_ov(task->ov_model, request);
443436 if (ret != DNN_SUCCESS) {
444437 return ret;
@@ -793,6 +786,11 @@ DNNReturnType ff_dnn_execute_model_async_ov(const DNNModel *model, const char *i · 348 unmodified lines
793786 return DNN_ERROR;
794787 }
795788
789+ if (ff_queue_size(ov_model->inference_queue) < ctx->options.batch_size) {
790+ // not enough inference items queued for a batch
791+ return DNN_SUCCESS;
792+ }
793+
796794 request = ff_safe_queue_pop_front(ov_model->request_queue);
797795 if (!request) {
798796 av_log(ctx, AV_LOG_ERROR, "unable to get infer request.\n");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t