From dd3f3f6d9d5997477eda269d6bd8ddb9e7dec519 Mon Sep 17 00:00:00 2001 From: Abhishek Gola Date: Wed, 1 Jul 2026 15:38:01 +0530 Subject: [PATCH] build issue fixed --- modules/dnn/src/graph_block_layout.cpp | 11 ---------- modules/dnn/src/layers/pooling_layer.cpp | 4 ---- modules/dnn/test/test_model.cpp | 28 ------------------------ modules/java/generator/gen_java.py | 4 +++- 4 files changed, 3 insertions(+), 44 deletions(-) diff --git a/modules/dnn/src/graph_block_layout.cpp b/modules/dnn/src/graph_block_layout.cpp index 1a90dec1be..22834c2909 100644 --- a/modules/dnn/src/graph_block_layout.cpp +++ b/modules/dnn/src/graph_block_layout.cpp @@ -166,17 +166,6 @@ struct BlockLayoutTransformer CV_Assert(inputLayoutsNew.size() == ninputs); CV_Assert(outputLayouts.size() == noutputs); - fprintf(stderr, "BLKALL op=%s name=%s\n", op_name.c_str(), name.c_str()); - if (op_name == "Pooling" || op_name == "DequantizeLinear" || op_name == "QuantizeLinear") { - fprintf(stderr, "BLKDBG op=%s name=%s deviceOp=%d defaultLayout=%d orig=[", op_name.c_str(), name.c_str(), (int)deviceOp, (int)defaultLayout); - for (auto l : inputLayoutsOrig) fprintf(stderr, "%d,", (int)l); - fprintf(stderr, "] new=["); - for (auto l : inputLayoutsNew) fprintf(stderr, "%d,", (int)l); - fprintf(stderr, "] out=["); - for (auto l : outputLayouts) fprintf(stderr, "%d,", (int)l); - fprintf(stderr, "]\n"); - } - if (deviceOp) { for (size_t i = 0; i < ninputs; i++) inputLayoutsNew[i] = defaultLayout; diff --git a/modules/dnn/src/layers/pooling_layer.cpp b/modules/dnn/src/layers/pooling_layer.cpp index 2757b8513e..1f3932dc7b 100644 --- a/modules/dnn/src/layers/pooling_layer.cpp +++ b/modules/dnn/src/layers/pooling_layer.cpp @@ -1180,10 +1180,6 @@ public: { CV_Assert(inputs.size() != 0); - fprintf(stderr, "DBG Pooling '%s' inp0 dims=%d layout=%d global=%d kernel=%zu pads_begin=%zu shape=[", name.c_str(), (int)inputs[0].size(), (int)inputs[0].layout, (int)globalPooling, kernel_size.size(), pads_begin.size()); - for (size_t _i=0;_i inpShape(inputs[0].begin() + 2, inputs[0].end()); std::vector outShape(inputs[0].begin(), inputs[0].begin() + 2); diff --git a/modules/dnn/test/test_model.cpp b/modules/dnn/test/test_model.cpp index 5d71d518c7..ca978cfe49 100644 --- a/modules/dnn/test/test_model.cpp +++ b/modules/dnn/test/test_model.cpp @@ -752,34 +752,6 @@ TEST_P(Reproducibility_ResNet50_ONNX, Accuracy) for (int i = 0; i < K; i++) { EXPECT_NEAR(ref[i].second, res[i].second, eps); } - - // Benchmark: warmup runs followed by timed runs, reporting avg/min/max forward time. - const int numWarmup = 5; - const int numRuns = 30; - for (int i = 0; i < numWarmup; i++) - { - net.setInput(input); - net.forward(); - } - - double timeMin = DBL_MAX, timeMax = 0.0, timeSum = 0.0; - for (int i = 0; i < numRuns; i++) - { - net.setInput(input); - TickMeter tm; - tm.start(); - net.forward(); - tm.stop(); - double t = tm.getTimeMilli(); - timeSum += t; - timeMin = std::min(timeMin, t); - timeMax = std::max(timeMax, t); - } - - std::cout << "[ BENCHMARK ] ResNet50 ONNX (backend=" << (int)backendId << ", target=" << (int)targetId << ") over " - << numRuns << " runs: avg=" << (timeSum / numRuns) << " ms" - << ", min=" << timeMin << " ms" - << ", max=" << timeMax << " ms" << std::endl; } INSTANTIATE_TEST_CASE_P(/**/, Reproducibility_ResNet50_ONNX, testing::ValuesIn(resnet50BackendsAndTargets())); diff --git a/modules/java/generator/gen_java.py b/modules/java/generator/gen_java.py index eca3cc37f9..0d46721846 100755 --- a/modules/java/generator/gen_java.py +++ b/modules/java/generator/gen_java.py @@ -297,8 +297,10 @@ class ClassInfo(GeneralInfo): base_class = re.sub(r"^cv::", "", base_class) base_class = base_class.replace('::', '.') base_info = ClassInfo(('class {}'.format(base_class), '', [], [], None, None), [self.namespace]) - # Use resolved base name; don't strip this class's own name. base_type_name = base_info.name + if not base_type_name in type_dict: + # Take the base's last name segment; don't strip this class's own name. + base_type_name = re.sub(r"^.*:", "", decl[1].split(",")[0]).strip() self.base = base_type_name self.addImports(self.base)