BackgroundRemovalByModNet4OpenCV icon indicating copy to clipboard operation
BackgroundRemovalByModNet4OpenCV copied to clipboard

Doesn't work on Google Colab

Open Suleman-Elahi opened this issue 1 year ago • 2 comments

error                                     Traceback (most recent call last)
[<ipython-input-11-5d8df0bd5dfe>](https://localhost:8080/#) in <cell line: 11>()
      9 # load model
     10 modelPath = "modnet_photographic_portrait_matting_opset9.onnx"
---> 11 net = cv2.dnn.readNetFromONNX(modelPath)

error: OpenCV(4.8.0) /io/opencv/modules/dnn/src/onnx/onnx_importer.cpp:279: error: (-210:Unsupported format or combination of formats) Failed to parse ONNX model: modnet_photographic_portrait_matting_opset9.onnx in function 'ONNXImporter'

image

Suleman-Elahi avatar Nov 12 '23 07:11 Suleman-Elahi

download the model, the onnx file has to be in your working directory

andylucny avatar Nov 12 '23 17:11 andylucny

I know that much ..... the file is there in the cwd. The error says the model file is not the correct format. So, is it due to version conflict or something else.

Suleman-Elahi avatar Nov 13 '23 16:11 Suleman-Elahi