opencv_zoo
opencv_zoo copied to clipboard
torch.nn.functional.interpolate is unsupport!
I meet error when run:
python demo.py -m model.onnx -i imgfile.jpg
It seems that the latest version don`t support upsample operation.
The onnx model in Netron:
The problems are:
- OpenCV DNN does not support ONNX model with dynamic input shape. However, we have a clear plan to support this in OpenCV 5.x.
- For fixed input shape, the resize operators have fixed target size as input. So for OpenCV DNN, when it takes a input of different size, the ouputs of resize operators will have a wrong shape.
Current solution is:
- Export this model with resize operators with scale 2 as input instead of fixed size.
- Resize the input so that its width and height can be divisible by 64.
- Get the lastest OpenCV:
pip install opencv-python-rolling
.
Code needs to be changed in libfacedetection.train:
- size=[feats[i].size(2), feats[i].size(3)],
+ scale = 2,
We will have a discussion on whether we should replace the one currently in the zoo with this model today.