Closed gursimarsingh closed 2 weeks ago
No error : you must simplify model :
onnxsim model(1).onnx a.sim.onnx
opencv onnx importer does not process dynamic shape. You have to substitue w and h
python -m onnxruntime.tools.make_dynamic_shape_fixed --dim_param w --dim_value 640 a.sim.onnx a1.onnx
python -m onnxruntime.tools.make_dynamic_shape_fixed --dim_param h --dim_value 480 a1.onnx a2.onnx
then python
Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2 as cv
>>> x = cv.dnn.readNet("a2.onnx")
>>> import numpy as np
>>> img = np.zeros((1, 3, 480,640))
>>> x.setInput(img)
>>> w = x.forward()
>>>
This bug should be fixed if possible. dexiened is used to replace hed_pretrained_bsds
model for edge detection. Do we have other public onnx models without manual modification for edge detection? Use public model link will save our traffic.
This bug should be fixed if possible.
https://github.com/opencv/opencv/issues/19347#issuecomment-1868227401
This bug should be fixed if possible.
OK, Thanks! Replaced model PR is crested https://github.com/opencv/opencv/pull/25515
This bug should be fixed if possible.
bug fixed
System Information
Python 3.10.10 General configuration for OpenCV 4.6, 4.x and 5.x =====================================
Platform: Host: Linux (Ubuntu 22.04) x86_64 CMake: 3.22.1 Configuration: Debug Release
Detailed description
Detailed description
Issue came up while adding a new onnx model dexiened for edge detection sample in dnn
onnx model can be downloaded from here
Model works perfectly when inferred with onnx and opencv==4.6.0
I get the following error with opencv==4.9.0-dev and opencv==5.x during model loading:
Similar issues: https://github.com/opencv/opencv/issues/24030 , https://github.com/opencv/opencv/issues/19416
Steps to reproduce
Here is the inference snippet:
Issue submission checklist