After profiling I am getting following results:
SYSTEM 1
ID name count thr min max median avg *self* IPP % OpenCL %
t-min t-max t-median t-avg total t-IPP % t-OpenCL %
1 cv::dnn::dnn4_v20220524::Net::forward#net.cpp:93 241 1 34.539 1569.779 35.574 43.279 10430.354 0.000 0 0.000 0
34.539 1569.779 35.574 43.279 10430.354 0.000 0 0.000 0
2 cv::dnn::dnn4_v20220524::blobFromImage#dnn_utils.cpp:27 241 1 2.027 8.872 2.661 3.036 731.583 0.000 0 0.000 0
2.027 8.872 2.661 3.036 731.583 0.000 0 0.000 0
3 cv::VideoWriter::operator<<(const cv::Mat&)#cap.cpp:682 241 1 1.586 3.697 1.953 2.009 484.226 0.000 0 0.000 0
1.586 3.697 1.953 2.009 484.226 0.000 0 0.000 0
4 cv::VideoCapture::read#cap.cpp:372 242 1 0.086 14.356 1.393 1.514 366.407 0.000 0 0.000 0
0.086 14.356 1.393 1.514 366.407 0.000 0 0.000 0
5 cv::dnn::dnn4_v20220524::Net::setInput#net.cpp:176 241 1 0.361 0.714 0.396 0.415 100.053 0.000 0 0.000 0
0.361 0.714 0.396 0.415 100.053 0.000 0 0.000 0
6 cv::blur#box_filter.dispatch.cpp:495 641 1 0.011 0.172 0.037 0.037 23.691 0.000 0 0.000 0
0.011 0.172 0.037 0.037 23.691 0.000 0 0.000 0
7 cv::Mat::copyTo#copy.cpp:307 192 1 0.000 3.063 0.003 0.111 21.254 0.000 0 0.000 0
0.000 3.063 0.003 0.111 21.254 0.000 0 0.000 0
8 cv::minMaxLoc#minmax.cpp:1566 24783 1 0.000 0.377 0.000 0.001 16.377 0.000 0 0.000 0
0.000 0.377 0.000 0.001 16.377 0.000 0 0.000 0
9 cv::VideoWriter::open#cap.cpp:541 1 1 7.886 7.886 7.886 7.886 7.886 0.000 0 0.000 0
7.886 7.886 7.886 7.886 7.886 0.000 0 0.000 0
10 cv::VideoCapture::VideoCapture#cap.cpp:74 1 1 1.620 1.620 1.620 1.620 1.620 0.000 0 0.000 0
1.620 1.620 1.620 1.620 1.620 0.000 0 0.000 0
SYSTEM 2
ID name count thr min max median avg *self* IPP % OpenCL %
t-min t-max t-median t-avg total t-IPP % t-OpenCL %
1 cv::dnn::dnn4_v20220524::Net::forward#net.cpp:93 241 1 58.370 1596.572 60.892 67.375 16237.484 0.000 0 0.000 0
58.370 1596.572 60.892 67.375 16237.484 0.000 0 0.000 0
2 cv::dnn::dnn4_v20220524::blobFromImage#dnn_utils.cpp:27 241 1 2.127 8.301 2.901 3.201 771.325 0.000 0 0.000 0
2.127 8.301 2.901 3.201 771.325 0.000 0 0.000 0
3 cv::VideoWriter::operator<<(const cv::Mat&)#cap.cpp:682 241 1 1.597 3.186 1.991 2.042 492.145 0.000 0 0.000 0
1.597 3.186 1.991 2.042 492.145 0.000 0 0.000 0
4 cv::VideoCapture::read#cap.cpp:372 242 1 0.128 21.976 1.357 1.522 368.270 0.000 0 0.000 0
0.128 21.976 1.357 1.522 368.270 0.000 0 0.000 0
5 cv::dnn::dnn4_v20220524::Net::setInput#net.cpp:176 241 1 0.359 0.872 0.397 0.429 103.314 0.000 0 0.000 0
0.359 0.872 0.397 0.429 103.314 0.000 0 0.000 0
6 cv::blur#box_filter.dispatch.cpp:495 641 1 0.013 0.196 0.038 0.038 24.677 0.000 0 0.000 0
0.013 0.196 0.038 0.038 24.677 0.000 0 0.000 0
7 cv::Mat::copyTo#copy.cpp:307 192 1 0.000 2.679 0.003 0.116 22.244 0.000 0 0.000 0
0.000 2.679 0.003 0.116 22.244 0.000 0 0.000 0
8 cv::minMaxLoc#minmax.cpp:1566 24783 1 0.000 0.229 0.000 0.001 16.185 0.000 0 0.000 0
0.000 0.229 0.000 0.001 16.185 0.000 0 0.000 0
9 cv::VideoWriter::open#cap.cpp:541 1 1 7.511 7.511 7.511 7.511 7.511 0.000 0 0.000 0
7.511 7.511 7.511 7.511 7.511 0.000 0 0.000 0
10 cv::VideoCapture::VideoCapture#cap.cpp:74 1 1 2.522 2.522 2.522 2.522 2.522 0.000 0 0.000 0
2.522 2.522 2.522 2.522 2.522 0.000 0 0.000 0
So problem lies in cv::dnn::dnn4_v20220524::Net::forward but how to debug it further?