opencv/modules/dnn/perf/perf_net.cpp

385 lines
14 KiB
C++
Raw Normal View History

2017-09-22 20:15:57 +08:00
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2017, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
#include "perf_precomp.hpp"
#include "opencv2/core/ocl.hpp"
#include "opencv2/dnn/shape_utils.hpp"
#include "../test/test_common.hpp"
namespace opencv_test {
2017-09-22 20:15:57 +08:00
class DNNTestNetwork : public ::perf::TestBaseWithParam< tuple<Backend, Target> >
2017-09-22 20:15:57 +08:00
{
public:
dnn::Backend backend;
dnn::Target target;
dnn::Net net;
DNNTestNetwork()
2017-09-22 20:15:57 +08:00
{
backend = (dnn::Backend)(int)get<0>(GetParam());
target = (dnn::Target)(int)get<1>(GetParam());
}
2017-09-22 20:15:57 +08:00
2023-10-17 02:25:56 +08:00
void processNet(std::string weights, std::string proto,
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
const std::vector<std::tuple<Mat, std::string>>& inputs, const std::string& outputLayer = ""){
2017-09-22 20:15:57 +08:00
weights = findDataFile(weights, false);
if (!proto.empty())
proto = findDataFile(proto);
net = readNet(weights, proto);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
// Set multiple inputs
for(auto &inp: inputs){
net.setInput(std::get<0>(inp), std::get<1>(inp));
}
2017-09-22 20:15:57 +08:00
net.setPreferableBackend(backend);
net.setPreferableTarget(target);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
// Calculate multiple inputs memory consumption
std::vector<MatShape> netMatShapes;
for(auto &inp: inputs){
netMatShapes.push_back(shape(std::get<0>(inp)));
}
Merge pull request #24411 from alexlyulkov:al/dnn-type-inference Added int32, int64 support and type inference to dnn #24411 **Added a type inference to dnn similar to the shape inference, added int32 and int64 support.** - Added getTypes method for layers that calculates layer outputs types and internals types from inputs types (Similar to getMemoryShapes). By default outputs and internals types = input[0] type - Added type inference pipeline similar to shape inference pipeline. LayersShapes struct (that is used in shape inference pipeline) now contains both shapes and types - All layers output blobs are now allocated using the calculated types from the type inference. - Inputs and constants with int32 and int64 types are not automatically converted into float32 now. - Added int32 and int64 support for all the layers with indexing and for all the layers required in tests. Added int32 and int64 support for CUDA: - Added host<->device data moving for int32 and int64 - Added int32 and int64 support for several layers (just slightly modified CUDA C++ templates) Passed all the accuracy tests on CPU, OCL, OCL_FP16, CUDA, CUDA_FP16. (except RAFT model) **CURRENT PROBLEMS**: - ONNX parser always converts int64 constants and layers attributes to int32, so some models with int64 constants doesn't work (e.g. RAFT). The solution is to disable int64->int32 conversion and fix attributes reading in a lot of ONNX layers parsers (https://github.com/opencv/opencv/issues/25102) - I didn't add type inference and int support to VULCAN, so it doesn't work at all now. - Some layers don't support int yet, so some unknown models may not work. **CURRENT WORKAROUNDS**: - CPU arg_layer indides are implemented in int32 followed by a int32->int64 conversion (the master branch has the same workaround with int32->float conversion) - CPU and OCL pooling_layer indices are implemented in float followed by a float->int64 conversion - CPU gather_layer indices are implemented in int32, so int64 indices are converted to int32 (the master branch has the same workaround with float->int32 conversion) **DISABLED TESTS**: - RAFT model **REMOVED TESTS**: - Greater_input_dtype_int64 (because it doesn't fit ONNX rules, the whole test is just comparing float tensor with int constant) **TODO IN NEXT PULL REQUESTS**: - Add int64 support for ONNX parser - Add int support for more layers - Add int support for OCL (currently int layers just run on CPU) - Add int tests - Add int support for other backends
2024-03-01 22:07:38 +08:00
bool fp16 = false;
#ifdef HAVE_OPENCL
fp16 = ocl::Device::getDefault().isExtensionSupported("cl_khr_fp16");
#endif
std::vector<cv::dnn::MatType> netMatTypes;
for (auto& inp : inputs) {
cv::dnn::MatType t = std::get<0>(inp).depth();
if (t == CV_32F && fp16 && target == DNN_TARGET_OPENCL_FP16)
t = CV_16F;
netMatTypes.push_back(t);
}
2017-09-22 20:15:57 +08:00
net.forward(outputLayer); // warmup
Merge pull request #24411 from alexlyulkov:al/dnn-type-inference Added int32, int64 support and type inference to dnn #24411 **Added a type inference to dnn similar to the shape inference, added int32 and int64 support.** - Added getTypes method for layers that calculates layer outputs types and internals types from inputs types (Similar to getMemoryShapes). By default outputs and internals types = input[0] type - Added type inference pipeline similar to shape inference pipeline. LayersShapes struct (that is used in shape inference pipeline) now contains both shapes and types - All layers output blobs are now allocated using the calculated types from the type inference. - Inputs and constants with int32 and int64 types are not automatically converted into float32 now. - Added int32 and int64 support for all the layers with indexing and for all the layers required in tests. Added int32 and int64 support for CUDA: - Added host<->device data moving for int32 and int64 - Added int32 and int64 support for several layers (just slightly modified CUDA C++ templates) Passed all the accuracy tests on CPU, OCL, OCL_FP16, CUDA, CUDA_FP16. (except RAFT model) **CURRENT PROBLEMS**: - ONNX parser always converts int64 constants and layers attributes to int32, so some models with int64 constants doesn't work (e.g. RAFT). The solution is to disable int64->int32 conversion and fix attributes reading in a lot of ONNX layers parsers (https://github.com/opencv/opencv/issues/25102) - I didn't add type inference and int support to VULCAN, so it doesn't work at all now. - Some layers don't support int yet, so some unknown models may not work. **CURRENT WORKAROUNDS**: - CPU arg_layer indides are implemented in int32 followed by a int32->int64 conversion (the master branch has the same workaround with int32->float conversion) - CPU and OCL pooling_layer indices are implemented in float followed by a float->int64 conversion - CPU gather_layer indices are implemented in int32, so int64 indices are converted to int32 (the master branch has the same workaround with float->int32 conversion) **DISABLED TESTS**: - RAFT model **REMOVED TESTS**: - Greater_input_dtype_int64 (because it doesn't fit ONNX rules, the whole test is just comparing float tensor with int constant) **TODO IN NEXT PULL REQUESTS**: - Add int64 support for ONNX parser - Add int support for more layers - Add int support for OCL (currently int layers just run on CPU) - Add int tests - Add int support for other backends
2024-03-01 22:07:38 +08:00
size_t weightsMemory = 0, blobsMemory = 0;
net.getMemoryConsumption(netMatShapes, netMatTypes, weightsMemory, blobsMemory);
int64 flops = net.getFLOPS(netMatShapes, netMatTypes);
Merge pull request #26056 from vpisarev:new_dnn_engine New dnn engine #26056 This is the 1st PR with the new engine; CI is green and PR is ready to be merged, I think. Merge together with https://github.com/opencv/opencv_contrib/pull/3794 --- **Known limitations:** * [solved] OpenVINO is temporarily disabled, but is probably easy to restore (it's not a deal breaker to merge this PR, I guess) * The new engine does not support any backends nor any targets except for the default CPU implementation. But it's possible to choose the old engine when loading a model, then all the functionality is available. * [Caffe patch is here: #26208] The new engine only supports ONNX. When a model is constructed manually or is loaded from a file of different format (.tf, .tflite, .caffe, .darknet), the old engine is used. * Even in the case of ONNX some layers are not supported by the new engine, such as all quantized layers (including DequantizeLinear, QuantizeLinear, QLinearConv etc.), LSTM, GRU, .... It's planned, of course, to have full support for ONNX by OpenCV 5.0 gold release. When a loaded model contains unsupported layers, we switch to the old engine automatically (at ONNX parsing time, not at `forward()` time). * Some layers , e.g. Expat, are only partially supported by the new engine. In the case of unsupported flavours it switches to the old engine automatically (at ONNX parsing time, not at `forward()` time). * 'Concat' graph optimization is disabled. The optimization eliminates Concat layer and instead makes the layers that generate tensors to be concatenated to write the outputs to the final destination. Of course, it's only possible when `axis=0` or `axis=N=1`. The optimization is not compatible with dynamic shapes since we need to know in advance where to store the tensors. Because some of the layer implementations have been modified to become more compatible with the new engine, the feature appears to be broken even when the old engine is used. * Some `dnn::Net` API is not available with the new engine. Also, shape inference may return false if some of the output or intermediate tensors' shapes cannot be inferred without running the model. Probably this can be fixed by a dummy run of the model with zero inputs. * Some overloads of `dnn::Net::getFLOPs()` and `dnn::Net::getMemoryConsumption()` are not exposed any longer in wrapper generators; but the most useful overloads are exposed (and checked by Java tests). * [in progress] A few Einsum tests related to empty shapes have been disabled due to crashes in the tests and in Einsum implementations. The code and the tests need to be repaired. * OpenCL implementation of Deconvolution is disabled. It's very bad and very slow anyway; need to be completely revised. * Deconvolution3D test is now skipped, because it was only supported by CUDA and OpenVINO backends, both of which are not supported by the new engine. * Some tests, such as FastNeuralStyle, checked that the in the case of CUDA backend there is no fallback to CPU. Currently all layers in the new engine are processed on CPU, so there are many fallbacks. The checks, therefore, have been temporarily disabled. --- - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
2024-10-16 20:28:19 +08:00
// [TODO] implement getFLOPS in the new engine
// Issue: https://github.com/opencv/opencv/issues/26199
CV_Assert(flops > 0 || net.getMainGraph());
2017-09-22 20:15:57 +08:00
std::cout << "Memory consumption:" << std::endl;
std::cout << " Weights(parameters): " << divUp(weightsMemory, 1u<<20) << " Mb" << std::endl;
std::cout << " Blobs: " << divUp(blobsMemory, 1u<<20) << " Mb" << std::endl;
std::cout << "Calculation complexity: " << flops * 1e-9 << " GFlops" << std::endl;
PERF_SAMPLE_BEGIN()
net.forward();
PERF_SAMPLE_END()
SANITY_CHECK_NOTHING();
}
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
2023-10-17 02:25:56 +08:00
void processNet(std::string weights, std::string proto,
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
Mat &input, const std::string& outputLayer = "")
{
2023-10-17 02:25:56 +08:00
processNet(weights, proto, {std::make_tuple(input, "")}, outputLayer);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
2023-10-17 02:25:56 +08:00
void processNet(std::string weights, std::string proto,
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
Size inpSize, const std::string& outputLayer = "")
{
Mat input_data(inpSize, CV_32FC3);
randu(input_data, 0.0f, 1.0f);
Mat input = blobFromImage(input_data, 1.0, Size(), Scalar(), false);
2023-10-17 02:25:56 +08:00
processNet(weights, proto, input, outputLayer);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
2017-09-22 20:15:57 +08:00
};
PERF_TEST_P_(DNNTestNetwork, AlexNet)
{
2023-10-17 02:25:56 +08:00
processNet("dnn/bvlc_alexnet.caffemodel", "dnn/bvlc_alexnet.prototxt", cv::Size(227, 227));
2017-09-22 20:15:57 +08:00
}
PERF_TEST_P_(DNNTestNetwork, GoogLeNet)
{
2023-10-17 02:25:56 +08:00
processNet("dnn/bvlc_googlenet.caffemodel", "dnn/bvlc_googlenet.prototxt", cv::Size(224, 224));
2017-09-22 20:15:57 +08:00
}
PERF_TEST_P_(DNNTestNetwork, ResNet_50)
2017-09-22 20:15:57 +08:00
{
2023-10-17 02:25:56 +08:00
processNet("dnn/ResNet-50-model.caffemodel", "dnn/ResNet-50-deploy.prototxt", cv::Size(224, 224));
2017-09-22 20:15:57 +08:00
}
PERF_TEST_P_(DNNTestNetwork, SqueezeNet_v1_1)
{
2023-10-17 02:25:56 +08:00
processNet("dnn/squeezenet_v1.1.caffemodel", "dnn/squeezenet_v1.1.prototxt", cv::Size(227, 227));
2017-09-22 20:15:57 +08:00
}
PERF_TEST_P_(DNNTestNetwork, Inception_5h)
{
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019) throw SkipTestException("");
2023-10-17 02:25:56 +08:00
processNet("dnn/tensorflow_inception_graph.pb", "", cv::Size(224, 224), "softmax2");
2017-09-22 20:15:57 +08:00
}
2017-12-06 19:51:05 +08:00
PERF_TEST_P_(DNNTestNetwork, SSD)
{
applyTestTag(CV_TEST_TAG_DEBUG_VERYLONG);
2023-10-17 02:25:56 +08:00
processNet("dnn/VGG_ILSVRC2016_SSD_300x300_iter_440000.caffemodel", "dnn/ssd_vgg16.prototxt", cv::Size(300, 300));
2017-12-06 19:51:05 +08:00
}
2017-09-22 20:15:57 +08:00
2017-12-18 22:22:57 +08:00
PERF_TEST_P_(DNNTestNetwork, MobileNet_SSD_Caffe)
{
2023-10-17 02:25:56 +08:00
processNet("dnn/MobileNetSSD_deploy_19e3ec3.caffemodel", "dnn/MobileNetSSD_deploy_19e3ec3.prototxt", cv::Size(300, 300));
2017-12-18 22:22:57 +08:00
}
PERF_TEST_P_(DNNTestNetwork, MobileNet_SSD_v1_TensorFlow)
2017-12-18 22:22:57 +08:00
{
2023-10-17 02:25:56 +08:00
processNet("dnn/ssd_mobilenet_v1_coco_2017_11_17.pb", "ssd_mobilenet_v1_coco_2017_11_17.pbtxt", cv::Size(300, 300));
}
PERF_TEST_P_(DNNTestNetwork, MobileNet_SSD_v2_TensorFlow)
{
2023-10-17 02:25:56 +08:00
processNet("dnn/ssd_mobilenet_v2_coco_2018_03_29.pb", "ssd_mobilenet_v2_coco_2018_03_29.pbtxt", cv::Size(300, 300));
2017-12-18 22:22:57 +08:00
}
PERF_TEST_P_(DNNTestNetwork, DenseNet_121)
{
2023-10-17 02:25:56 +08:00
processNet("dnn/DenseNet_121.caffemodel", "dnn/DenseNet_121.prototxt", cv::Size(224, 224));
}
PERF_TEST_P_(DNNTestNetwork, OpenPose_pose_mpi_faster_4_stages)
{
applyTestTag(CV_TEST_TAG_DEBUG_VERYLONG);
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019 && (target == DNN_TARGET_MYRIAD || target == DNN_TARGET_HDDL))
throw SkipTestException("");
// The same .caffemodel but modified .prototxt
// See https://github.com/CMU-Perceptual-Computing-Lab/openpose/blob/master/src/openpose/pose/poseParameters.cpp
2023-10-17 02:25:56 +08:00
processNet("dnn/openpose_pose_mpi.caffemodel", "dnn/openpose_pose_mpi_faster_4_stages.prototxt", cv::Size(368, 368));
}
PERF_TEST_P_(DNNTestNetwork, Inception_v2_SSD_TensorFlow)
{
applyTestTag(CV_TEST_TAG_DEBUG_VERYLONG);
2023-10-17 02:25:56 +08:00
processNet("dnn/ssd_inception_v2_coco_2017_11_17.pb", "ssd_inception_v2_coco_2017_11_17.pbtxt", cv::Size(300, 300));
}
2018-04-13 23:53:12 +08:00
PERF_TEST_P_(DNNTestNetwork, YOLOv3)
{
applyTestTag(
CV_TEST_TAG_MEMORY_2GB,
CV_TEST_TAG_DEBUG_VERYLONG
);
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2020040000) // nGraph compilation failure
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target == DNN_TARGET_OPENCL)
throw SkipTestException("Test is disabled in OpenVINO 2020.4");
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target == DNN_TARGET_OPENCL_FP16)
throw SkipTestException("Test is disabled in OpenVINO 2020.4");
#endif
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_GE(2021010000) // nGraph compilation failure
if (target == DNN_TARGET_MYRIAD)
throw SkipTestException("");
#endif
Mat sample = imread(findDataFile("dnn/dog416.png"));
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
Mat inp = blobFromImage(sample, 1.0 / 255.0, Size(), Scalar(), true);
processNet("dnn/yolov3.weights", "dnn/yolov3.cfg", inp);
2020-05-27 00:20:32 +08:00
}
PERF_TEST_P_(DNNTestNetwork, YOLOv4)
{
applyTestTag(
CV_TEST_TAG_MEMORY_2GB,
CV_TEST_TAG_DEBUG_VERYLONG
);
if (target == DNN_TARGET_MYRIAD) // not enough resources
2020-05-27 00:20:32 +08:00
throw SkipTestException("");
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2020040000) // nGraph compilation failure
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target == DNN_TARGET_OPENCL)
throw SkipTestException("Test is disabled in OpenVINO 2020.4");
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH && target == DNN_TARGET_OPENCL_FP16)
throw SkipTestException("Test is disabled in OpenVINO 2020.4");
#endif
2020-05-27 00:20:32 +08:00
Mat sample = imread(findDataFile("dnn/dog416.png"));
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
Mat inp = blobFromImage(sample, 1.0 / 255.0, Size(), Scalar(), true);
processNet("dnn/yolov4.weights", "dnn/yolov4.cfg", inp);
2018-04-13 23:53:12 +08:00
}
2020-07-04 03:14:05 +08:00
PERF_TEST_P_(DNNTestNetwork, YOLOv4_tiny)
{
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_GE(2021010000) // nGraph compilation failure
if (target == DNN_TARGET_MYRIAD)
throw SkipTestException("");
#endif
2020-07-04 03:14:05 +08:00
Mat sample = imread(findDataFile("dnn/dog416.png"));
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
Mat inp = blobFromImage(sample, 1.0 / 255.0, Size(), Scalar(), true);
processNet("dnn/yolov4-tiny-2020-12.weights", "dnn/yolov4-tiny-2020-12.cfg", inp);
2020-07-04 03:14:05 +08:00
}
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
PERF_TEST_P_(DNNTestNetwork, YOLOv5) {
applyTestTag(CV_TEST_TAG_MEMORY_512MB);
Mat sample = imread(findDataFile("dnn/dog416.png"));
Mat inp = blobFromImage(sample, 1.0 / 255.0, Size(640, 640), Scalar(), true);
2024-02-12 19:20:35 +08:00
processNet("dnn/yolov5n.onnx", "", inp);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
PERF_TEST_P_(DNNTestNetwork, YOLOv8)
{
applyTestTag(
CV_TEST_TAG_MEMORY_512MB,
CV_TEST_TAG_DEBUG_LONG
);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
Mat sample = imread(findDataFile("dnn/dog416.png"));
Mat inp = blobFromImage(sample, 1.0 / 255.0, Size(640, 640), Scalar(), true);
2024-02-12 19:20:35 +08:00
processNet("dnn/yolov8n.onnx", "", inp);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
PERF_TEST_P_(DNNTestNetwork, YOLOX) {
applyTestTag(
CV_TEST_TAG_MEMORY_512MB,
CV_TEST_TAG_DEBUG_VERYLONG
);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
Mat sample = imread(findDataFile("dnn/dog416.png"));
Mat inp = blobFromImage(sample, 1.0 / 255.0, Size(640, 640), Scalar(), true);
2024-02-12 19:20:35 +08:00
processNet("dnn/yolox_s.onnx", "", inp);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
PERF_TEST_P_(DNNTestNetwork, EAST_text_detection)
{
applyTestTag(CV_TEST_TAG_DEBUG_VERYLONG);
2023-10-17 02:25:56 +08:00
processNet("dnn/frozen_east_text_detection.pb", "", cv::Size(320, 320));
}
PERF_TEST_P_(DNNTestNetwork, FastNeuralStyle_eccv16)
{
applyTestTag(CV_TEST_TAG_DEBUG_VERYLONG);
2024-02-12 19:20:35 +08:00
processNet("dnn/mosaic-9.onnx", "", cv::Size(224, 224));
}
PERF_TEST_P_(DNNTestNetwork, Inception_v2_Faster_RCNN)
{
applyTestTag(CV_TEST_TAG_DEBUG_VERYLONG);
2019-04-03 22:49:05 +08:00
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019010000)
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
2019-04-03 22:49:05 +08:00
throw SkipTestException("Test is disabled in OpenVINO 2019R1");
2019-07-25 14:57:49 +08:00
#endif
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2019020000)
if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
2019-07-25 14:57:49 +08:00
throw SkipTestException("Test is disabled in OpenVINO 2019R2");
#endif
#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_GE(2021010000)
if (target == DNN_TARGET_MYRIAD)
throw SkipTestException("Test is disabled in OpenVINO 2021.1+ / MYRIAD");
2019-04-03 22:49:05 +08:00
#endif
if ((backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019 && target != DNN_TARGET_CPU) ||
(backend == DNN_BACKEND_OPENCV && target == DNN_TARGET_OPENCL_FP16))
throw SkipTestException("");
processNet("dnn/faster_rcnn_inception_v2_coco_2018_01_28.pb",
2023-10-17 02:25:56 +08:00
"dnn/faster_rcnn_inception_v2_coco_2018_01_28.pbtxt",
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
cv::Size(800, 600));
}
2020-05-26 15:51:26 +08:00
PERF_TEST_P_(DNNTestNetwork, EfficientDet)
{
if (target != DNN_TARGET_CPU)
2020-05-26 15:51:26 +08:00
throw SkipTestException("");
Mat sample = imread(findDataFile("dnn/dog416.png"));
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
Mat inp = blobFromImage(sample, 1.0 / 255.0, Size(512, 512), Scalar(), true);
processNet("dnn/efficientdet-d0.pb", "dnn/efficientdet-d0.pbtxt", inp);
2020-05-26 15:51:26 +08:00
}
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
PERF_TEST_P_(DNNTestNetwork, EfficientNet)
{
Mat sample = imread(findDataFile("dnn/dog416.png"));
Mat inp = blobFromImage(sample, 1.0 / 255.0, Size(224, 224), Scalar(), true);
transposeND(inp, {0, 2, 3, 1}, inp);
2024-02-12 19:20:35 +08:00
processNet("dnn/efficientnet-lite4.onnx", "", inp);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
PERF_TEST_P_(DNNTestNetwork, YuNet) {
2024-02-12 19:20:35 +08:00
processNet("dnn/onnx/models/yunet-202303.onnx", "", cv::Size(640, 640));
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
PERF_TEST_P_(DNNTestNetwork, SFace) {
2024-02-12 19:20:35 +08:00
processNet("dnn/face_recognition_sface_2021dec.onnx", "", cv::Size(112, 112));
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
PERF_TEST_P_(DNNTestNetwork, MPPalm) {
Mat inp(cv::Size(192, 192), CV_32FC3);
randu(inp, 0.0f, 1.0f);
inp = blobFromImage(inp, 1.0, Size(), Scalar(), false);
transposeND(inp, {0, 2, 3, 1}, inp);
2024-02-12 19:20:35 +08:00
processNet("dnn/palm_detection_mediapipe_2023feb.onnx", "", inp);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
PERF_TEST_P_(DNNTestNetwork, MPHand) {
Mat inp(cv::Size(224, 224), CV_32FC3);
randu(inp, 0.0f, 1.0f);
inp = blobFromImage(inp, 1.0, Size(), Scalar(), false);
transposeND(inp, {0, 2, 3, 1}, inp);
2024-02-12 19:20:35 +08:00
processNet("dnn/handpose_estimation_mediapipe_2023feb.onnx", "", inp);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
PERF_TEST_P_(DNNTestNetwork, MPPose) {
Mat inp(cv::Size(256, 256), CV_32FC3);
randu(inp, 0.0f, 1.0f);
inp = blobFromImage(inp, 1.0, Size(), Scalar(), false);
transposeND(inp, {0, 2, 3, 1}, inp);
2024-02-12 19:20:35 +08:00
processNet("dnn/pose_estimation_mediapipe_2023mar.onnx", "", inp);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
PERF_TEST_P_(DNNTestNetwork, PPOCRv3) {
applyTestTag(CV_TEST_TAG_MEMORY_512MB);
2024-02-12 19:20:35 +08:00
processNet("dnn/onnx/models/PP_OCRv3_DB_text_det.onnx", "", cv::Size(736, 736));
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
PERF_TEST_P_(DNNTestNetwork, PPHumanSeg) {
2024-02-12 19:20:35 +08:00
processNet("dnn/human_segmentation_pphumanseg_2023mar.onnx", "", cv::Size(192, 192));
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
PERF_TEST_P_(DNNTestNetwork, CRNN) {
Mat inp(cv::Size(100, 32), CV_32FC1);
randu(inp, 0.0f, 1.0f);
inp = blobFromImage(inp, 1.0, Size(), Scalar(), false);
2024-02-12 19:20:35 +08:00
processNet("dnn/text_recognition_CRNN_EN_2021sep.onnx", "", inp);
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
Merge pull request #24476 from fengyuentau:attention_layer dnn: add attention layer #24476 Resolves #24609 Merge with: https://github.com/opencv/opencv_extra/pull/1128. Attention operator spec from onnxruntime: https://github.com/microsoft/onnxruntime/blob/v1.16.1/docs/ContribOperators.md#com.microsoft.Attention. TODO: - [x] benchmark (before this PR vs. with this PR vs. ORT). - [x] Layer fusion: Take care Slice with end=INT64_MAX. - [x] Layer fusion: match more potential attention (VIT) patterns. - [x] Single-head attention is supported. - [x] Test AttentionSubgraph fusion. - [x] Add acc tests for VIT_B_32 and VitTrack - [x] Add perf tests for VIT_B_32 and VitTrack ## Benchmarks Platform: Macbook Air M1. ### Attention Subgraph Input scale: [1, 197, 768]. | | mean (ms) | median (ms) | min (ms) | | ---------------------- | --------- | ----------- | -------- | | w/ Attention (this PR) | 3.75 | 3.68 | 3.22 | | w/o Attention | 9.06 | 9.01 | 8.24 | | ORT (python) | 4.32 | 2.63 | 2.50 | ### ViTs All data in millisecond (ms). | ViTs | With Attention | Without Attention | ORT | | -------- | -------------- | ----------------- | ------ | | vit_b_16 | 302.77 | 365.35 | 109.70 | | vit_b_32 | 89.92 | 116.22 | 30.36 | | vit_l_16 | 1593.32 | 1730.74 | 419.92 | | vit_l_32 | 468.11 | 577.41 | 134.12 | | VitTrack | 3.80 | 3.87 | 2.25 | ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
2023-12-21 00:35:07 +08:00
PERF_TEST_P_(DNNTestNetwork, VitTrack) {
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
Mat inp1(cv::Size(128, 128), CV_32FC3);
Mat inp2(cv::Size(256, 256), CV_32FC3);
randu(inp1, 0.0f, 1.0f);
randu(inp2, 0.0f, 1.0f);
inp1 = blobFromImage(inp1, 1.0, Size(), Scalar(), false);
inp2 = blobFromImage(inp2, 1.0, Size(), Scalar(), false);
2024-02-12 19:20:35 +08:00
processNet("dnn/onnx/models/object_tracking_vittrack_2023sep.onnx", "", {std::make_tuple(inp1, "template"), std::make_tuple(inp2, "search")});
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
}
Merge pull request #23987 from dkurt:openvino_int8_backend OpenVINO backend for INT8 models #23987 ### Pull Request Readiness Checklist TODO: - [x] DetectionOutput layer (https://github.com/opencv/opencv/pull/24069) - [x] Less FP32 fallbacks (i.e. Sigmoid, eltwise sum) - [x] Accuracy, performance tests (https://github.com/opencv/opencv/pull/24039) - [x] Single layer tests (convolution) - [x] ~~Fixes for OpenVINO 2022.1 (https://pullrequest.opencv.org/buildbot/builders/precommit_custom_linux/builds/100334)~~ Performace results for object detection model `coco_efficientdet_lite0_v1_1.0_quant_2021_09_06.tflite`: | backend | performance (median time) | |---|---| | OpenCV | 77.42ms | | OpenVINO 2023.0 | 10.90ms | CPU: `11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz` Serialized model per-layer stats (note that Convolution should use `*_I8` primitives if they are quantized correctly): https://gist.github.com/dkurt/7772bbf1907035441bb5454f19f0feef --- See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
2023-09-28 21:24:43 +08:00
PERF_TEST_P_(DNNTestNetwork, EfficientDet_int8)
{
if (target != DNN_TARGET_CPU || (backend != DNN_BACKEND_OPENCV &&
backend != DNN_BACKEND_TIMVX && backend != DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)) {
throw SkipTestException("");
}
Mat inp = imread(findDataFile("dnn/dog416.png"));
Merge pull request #24298 from WanliZhong:extend_perf_net_test Extend performance test models #24298 **Merged With https://github.com/opencv/opencv_extra/pull/1095** This PR aims to extend the performance tests. - **YOLOv5** for object detection - **YOLOv8** for object detection - **EfficientNet** for classification Models from OpenCV Zoo: - **YOLOX** for object detection - **YuNet** for face detection - **SFace** for face recognization - **MPPalm** for palm detection - **MPHand** for hand landmark - **MPPose** for pose estimation - **ViTTrack** for object tracking - **PPOCRv3** for text detection - **CRNN** for text recognization - **PPHumanSeg** for human segmentation If other models should be added, **please leave some comments**. Thanks! Build opencv with script: ```shell -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_opencv_gapi=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DINSTALL_C_EXAMPLES=OFF -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_ZLIB=OFF -DWITH_FFMPEG=OFF ``` Performance Test on **Apple M2 CPU** ```shell MacOS 14.0 8 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 76.244 | 76.611 | 62.534 | 57.678 | 57.238 | | EfficientNet | --- | --- | 109.224 | 130.753 | 109.076 | | MPHand | --- | --- | 19.289 | 22.727 | 27.593 | | MPPalm | 47.150 | 47.061 | 41.064 | 65.598 | 40.109 | | MPPose | --- | --- | 26.592 | 32.022 | 26.956 | | PPHumanSeg | 41.672 | 41.790 | 27.819 | 27.212 | 30.461 | | PPOCRv3 | --- | --- | 140.371 | 187.922 | 170.026 | | SFace | 43.830 | 43.834 | 27.575 | 30.653 | 26.387 | | ViTTrack | --- | --- | --- | 14.617 | 15.028 | | YOLOX | 1060.507 | 1061.361 | 495.816 | 533.309 | 549.713 | | YOLOv5 | --- | --- | --- | 191.350 | 193.261 | | YOLOv8 | --- | --- | 198.893 | 218.733 | 223.142 | | YuNet | 27.084 | 27.095 | 26.238 | 30.512 | 34.439 | | MobileNet_SSD_Caffe | 44.742 | 44.565 | 33.005 | 29.421 | 29.286 | | MobileNet_SSD_v1_TensorFlow | 49.352 | 49.274 | 35.163 | 32.134 | 31.904 | | MobileNet_SSD_v2_TensorFlow | 83.537 | 83.379 | 56.403 | 42.947 | 42.148 | | ResNet_50 | 148.872 | 148.817 | 77.331 | 67.682 | 67.760 | **n threads:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 44.262 | 44.408 | 41.540 | 40.731 | 41.151 | | EfficientNet | --- | --- | 28.683 | 42.676 | 38.204 | | MPHand | --- | --- | 6.738 | 13.126 | 8.155 | | MPPalm | 16.613 | 16.588 | 12.477 | 31.370 | 17.048 | | MPPose | --- | --- | 12.985 | 19.700 | 16.537 | | PPHumanSeg | 14.993 | 15.133 | 13.438 | 15.269 | 15.252 | | PPOCRv3 | --- | --- | 63.752 | 85.469 | 76.190 | | SFace | 10.685 | 10.822 | 8.127 | 8.318 | 7.934 | | ViTTrack | --- | --- | --- | 10.079 | 9.579 | | YOLOX | 417.358 | 422.977 | 230.036 | 234.662 | 228.555 | | YOLOv5 | --- | --- | --- | 74.249 | 75.480 | | YOLOv8 | --- | --- | 63.762 | 88.770 | 70.927 | | YuNet | 8.589 | 8.731 | 11.269 | 16.466 | 14.513 | | MobileNet_SSD_Caffe | 12.575 | 12.636 | 11.529 | 12.114 | 12.236 | | MobileNet_SSD_v1_TensorFlow | 13.922 | 14.160 | 13.078 | 12.124 | 13.298 | | MobileNet_SSD_v2_TensorFlow | 25.096 | 24.836 | 22.823 | 20.238 | 20.319 | | ResNet_50 | 41.561 | 41.296 | 29.092 | 30.412 | 29.339 | Performance Test on [Intel Core i7-12700K](https://www.intel.com/content/www/us/en/products/sku/134594/intel-core-i712700k-processor-25m-cache-up-to-5-00-ghz/specifications.html) ```shell Ubuntu 22.04.2 LTS 8 Performance-cores (3.60 GHz, turbo up to 4.90 GHz) 4 Efficient-cores (2.70 GHz, turbo up to 3.80 GHz) 20 threads ``` **1 thread:** | Name of Test | 4.5.5-1th | 4.6.0-1th | 4.7.0-1th | 4.8.0-1th | 4.8.1-1th | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 16.752 | 16.851 | 16.840 | 16.625 | 16.663 | | EfficientNet | --- | --- | 61.107 | 76.037 | 53.890 | | MPHand | --- | --- | 8.906 | 9.969 | 8.403 | | MPPalm | 24.243 | 24.638 | 18.104 | 35.140 | 18.387 | | MPPose | --- | --- | 12.322 | 16.515 | 12.355 | | PPHumanSeg | 15.249 | 15.303 | 10.203 | 10.298 | 10.353 | | PPOCRv3 | --- | --- | 87.788 | 144.253 | 90.648 | | SFace | 15.583 | 15.884 | 13.957 | 13.298 | 13.284 | | ViTTrack | --- | --- | --- | 11.760 | 11.710 | | YOLOX | 324.927 | 325.173 | 235.986 | 253.653 | 254.472 | | YOLOv5 | --- | --- | --- | 102.163 | 102.621 | | YOLOv8 | --- | --- | 87.013 | 103.182 | 103.146 | | YuNet | 12.806 | 12.645 | 10.515 | 12.647 | 12.711 | | MobileNet_SSD_Caffe | 23.556 | 23.768 | 24.304 | 22.569 | 22.602 | | MobileNet_SSD_v1_TensorFlow | 26.136 | 26.276 | 26.854 | 24.828 | 24.961 | | MobileNet_SSD_v2_TensorFlow | 43.521 | 43.614 | 46.892 | 44.044 | 44.682 | | ResNet_50 | 73.588 | 73.501 | 75.191 | 66.893 | 65.144 | **n thread:** | Name of Test | 4.5.5-nth | 4.6.0-nth | 4.7.0-nth | 4.8.0-nth | 4.8.1-nth | |--------------|:---------:|:---------:|:---------:|:---------:|:---------:| | CRNN | 8.665 | 8.827 | 10.643 | 7.703 | 7.743 | | EfficientNet | --- | --- | 16.591 | 12.715 | 9.022 | | MPHand | --- | --- | 2.678 | 2.785 | 1.680 | | MPPalm | 5.309 | 5.319 | 3.822 | 10.568 | 4.467 | | MPPose | --- | --- | 3.644 | 6.088 | 4.608 | | PPHumanSeg | 4.756 | 4.865 | 5.084 | 5.179 | 5.148 | | PPOCRv3 | --- | --- | 32.023 | 50.591 | 32.414 | | SFace | 3.838 | 3.980 | 4.629 | 3.145 | 3.155 | | ViTTrack | --- | --- | --- | 10.335 | 10.357 | | YOLOX | 68.314 | 68.081 | 82.801 | 74.219 | 73.970 | | YOLOv5 | --- | --- | --- | 47.150 | 47.523 | | YOLOv8 | --- | --- | 32.195 | 30.359 | 30.267 | | YuNet | 2.604 | 2.644 | 2.622 | 3.278 | 3.349 | | MobileNet_SSD_Caffe | 13.005 | 5.935 | 8.586 | 4.629 | 4.713 | | MobileNet_SSD_v1_TensorFlow | 7.002 | 7.129 | 9.314 | 5.271 | 5.213 | | MobileNet_SSD_v2_TensorFlow | 11.939 | 12.111 | 22.688 | 12.038 | 12.086 | | ResNet_50 | 18.227 | 18.600 | 26.150 | 15.584 | 15.706 |
2023-10-04 18:05:32 +08:00
inp = blobFromImage(inp, 1.0 / 255.0, Size(320, 320), Scalar(), true);
2024-02-12 19:20:35 +08:00
processNet("dnn/tflite/coco_efficientdet_lite0_v1_1.0_quant_2021_09_06.tflite", "", inp);
Merge pull request #23987 from dkurt:openvino_int8_backend OpenVINO backend for INT8 models #23987 ### Pull Request Readiness Checklist TODO: - [x] DetectionOutput layer (https://github.com/opencv/opencv/pull/24069) - [x] Less FP32 fallbacks (i.e. Sigmoid, eltwise sum) - [x] Accuracy, performance tests (https://github.com/opencv/opencv/pull/24039) - [x] Single layer tests (convolution) - [x] ~~Fixes for OpenVINO 2022.1 (https://pullrequest.opencv.org/buildbot/builders/precommit_custom_linux/builds/100334)~~ Performace results for object detection model `coco_efficientdet_lite0_v1_1.0_quant_2021_09_06.tflite`: | backend | performance (median time) | |---|---| | OpenCV | 77.42ms | | OpenVINO 2023.0 | 10.90ms | CPU: `11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz` Serialized model per-layer stats (note that Convolution should use `*_I8` primitives if they are quantized correctly): https://gist.github.com/dkurt/7772bbf1907035441bb5454f19f0feef --- See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
2023-09-28 21:24:43 +08:00
}
PERF_TEST_P_(DNNTestNetwork, VIT_B_32)
{
applyTestTag(CV_TEST_TAG_DEBUG_VERYLONG);
2024-02-12 19:20:35 +08:00
processNet("dnn/onnx/models/vit_b_32.onnx", "", cv::Size(224, 224));
Merge pull request #24476 from fengyuentau:attention_layer dnn: add attention layer #24476 Resolves #24609 Merge with: https://github.com/opencv/opencv_extra/pull/1128. Attention operator spec from onnxruntime: https://github.com/microsoft/onnxruntime/blob/v1.16.1/docs/ContribOperators.md#com.microsoft.Attention. TODO: - [x] benchmark (before this PR vs. with this PR vs. ORT). - [x] Layer fusion: Take care Slice with end=INT64_MAX. - [x] Layer fusion: match more potential attention (VIT) patterns. - [x] Single-head attention is supported. - [x] Test AttentionSubgraph fusion. - [x] Add acc tests for VIT_B_32 and VitTrack - [x] Add perf tests for VIT_B_32 and VitTrack ## Benchmarks Platform: Macbook Air M1. ### Attention Subgraph Input scale: [1, 197, 768]. | | mean (ms) | median (ms) | min (ms) | | ---------------------- | --------- | ----------- | -------- | | w/ Attention (this PR) | 3.75 | 3.68 | 3.22 | | w/o Attention | 9.06 | 9.01 | 8.24 | | ORT (python) | 4.32 | 2.63 | 2.50 | ### ViTs All data in millisecond (ms). | ViTs | With Attention | Without Attention | ORT | | -------- | -------------- | ----------------- | ------ | | vit_b_16 | 302.77 | 365.35 | 109.70 | | vit_b_32 | 89.92 | 116.22 | 30.36 | | vit_l_16 | 1593.32 | 1730.74 | 419.92 | | vit_l_32 | 468.11 | 577.41 | 134.12 | | VitTrack | 3.80 | 3.87 | 2.25 | ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
2023-12-21 00:35:07 +08:00
}
INSTANTIATE_TEST_CASE_P(/*nothing*/, DNNTestNetwork, dnnBackendsAndTargets());
2017-09-22 20:15:57 +08:00
} // namespace