mmdeploy
mmdeploy copied to clipboard
Dynamic num_dets does not take effect when onnx is converted to openvino.
When converting maskrcnn into an openvino model, it is found that even if the configuration file uses a dynamic config, the result given by openvino is still a fixed value in the dimension of num_dets (max_per_img+1).
The version of mmdeploy I am using is v0.3.0 The configuration file is as follows: openvino.zip
@SemyonBevzuk Hi, bro. Could you take a look at this issue? It appears that outputs are padded inside openvino. However, similar onnx on onnxruntime woud output dynamically.
Hello! OpenVINO in this implementation supports dynamic shapes with some limitations. It is possible that due to differences in the implementation of some operations, the OpenVINO model may generate more high score results. Thus, a limit of 100 results after NMS can be reached.
The reason for the number of results exceeds the limit by 1, in my opinion, is in the following: https://github.com/open-mmlab/mmdeploy/blob/69111a6b956fd147d1590f0b808e545cebf45eeb/mmdeploy/codebase/mmdet/models/roi_heads/standard_roi_head.py#L43-L56
Here is the part of the graph where the concatenation with 1 takes place:

Sorry for the wait.
@SemyonBevzuk Hi, you 're right about appending one extra bbox. But it still cannot explain why number of output is always 101 and there are lots of zero bboxes. If you run inference with an image of all 255 pixesl, then there' should be only one output, which is the appended bbox.
Unfortunately, the current implementation always returns the maximum possible tensor when working with dynamic tensors. In version 2021.4.2, dummy results were filled with zeros and could be filtered out. In the current version 2022.1.0 something is broken with the IOU threshold, I think.
Unfortunately, the current implementation always returns the maximum possible tensor when working with dynamic tensors. In version 2021.4.2, dummy results were filled with zeros and could be filtered out. In the current version 2022.1.0 something is broken with the IOU threshold, I think.
@SemyonBevzuk Hi, appreciated your effort. Hope it would be fixed soon.
closed for no activity for a long time.