andylucny / BackgroundRemovalByModNet4OpenCV

ModNet for pure OpenCV
20 stars 7 forks source link

Doesn't work on Google Colab #3

Open Suleman-Elahi opened 9 months ago

Suleman-Elahi commented 9 months ago
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

andylucny commented 9 months ago

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

Suleman-Elahi commented 9 months ago

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.