MiDaS
MiDaS copied to clipboard
When will MiDaS 3.1 be supported for conversion into ONNX?
When will MiDaS 3.1 be supported for conversion into ONNX?
@md5xwl For now, it's enough to use Pytorch Nighthly and onnx opset >= 13 to convert models of version 3.1 to onnx format. I managed to convert dpt_swin2_tiny_256 and dpt_levit_224.
@scarletshroud Thanks man, it works for me too!
Can you please share the code? I used pytorch nightly and onnx opset. I couldn't load the model... P.S. Fine, after reinstalling packages, it worked ...
@smzyqin could you share your code? or the resulting onnx model? thanks.
@scarletshroud do you mind sharing code?
@md5xwl How about these? https://github.com/parkchamchi/MiDaS/releases/tag/23.02.18
@md5xwl How about these? https://github.com/parkchamchi/MiDaS/releases/tag/23.02.18 I can’t load your model error: [ERROR:[email protected]] global onnx_importer.cpp:1064 cv::dnn::dnn4_v20230620::ONNXImporter::handleNode DNN/ONNX: ERROR during processing node with 4 inputs and 1 outputs: [Resize]:(onnx_node!/Resize) from domain='ai.onnx' Traceback (most recent call last): File "D:\code\python\singleCreamDis\WeiShuHelper\test_export.py", line 8, in
net = cv2.dnn.readNetFromONNX('weights/dpt_hybrid_384.onnx') cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\onnx\onnx_importer.cpp:1083: error: (-2:Unspecified error) in function 'cv::dnn::dnn4_v20230620::ONNXImporter::handleNode' Node [[email protected]]:(onnx_node!/Resize) parse error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\layers\resize_layer.cpp:62: error: (-215:Assertion failed) inputs.size() == 1 || inputs.size() == 2 in function 'cv::dnn::ResizeLayerImpl::getMemoryShapes'
Can you please share the code?
@123467895 For conversion? we'd have to ask @parkchamchi
I tried with this model, but it worked poorly. [https://github.com/parkchamchi/MiDaS/releases/tag/23.02.18]
@md5xwl
I tried with this model, but it worked poorly.
Have you normalized the input? (#) Thank you, I check my code. Now it works correctly. I did normalize, but I did it wrong, I forgot this tensor = tensor/255.0