1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #28634 from abhishek-gola:flops_addition

Added getFLOPS support in new DNN engine #28634

closes: https://github.com/opencv/opencv/issues/26199

### 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
This commit is contained in:
Abhishek Gola
2026-03-13 20:57:14 +05:30
committed by GitHub
parent 1b483ffea6
commit f059d3b517
11 changed files with 786 additions and 12 deletions
+1 -3
View File
@@ -65,9 +65,7 @@ public:
size_t weightsMemory = 0, blobsMemory = 0;
net.getMemoryConsumption(netMatShapes, netMatTypes, weightsMemory, blobsMemory);
int64 flops = net.getFLOPS(netMatShapes, netMatTypes);
// [TODO] implement getFLOPS in the new engine
// Issue: https://github.com/opencv/opencv/issues/26199
CV_Assert(flops > 0 || net.getMainGraph());
CV_Assert(flops > 0);
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;