mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
build issue fixed
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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<inputs[0].size();_i++) fprintf(stderr, "%d,", inputs[0][_i]);
|
||||
fprintf(stderr, "]\n");
|
||||
|
||||
bool isPool1D = inputs[0].size() == 3;
|
||||
std::vector<int> inpShape(inputs[0].begin() + 2, inputs[0].end());
|
||||
std::vector<int> outShape(inputs[0].begin(), inputs[0].begin() + 2);
|
||||
|
||||
@@ -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()));
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user