If using different input size (such as 600x300), with "GridAnchorRect_TRT", the outputs are wrong.
we use a featuremaps of "featureMapShapes=[19, 38, 10, 19, 5, 10, 3, 5, 2, 3, 1, 2])#600x300". There are couple of bugs:
Even if we resolve such issues, the output bounding boxes are still not correct, and not sure how the problems come from.
@rajeevsrao for bug with this plugin. Also FWIW, this commit wasn't included in release/7.0 or master branch.
@fshi98 can you please attach sample code to repro the issue you are seeing for 2 (assuming the plugin must be registered under GridAnchorRect_TRT)? Also, did you check if sampleUffSSD (which uses GridAchorRect_TRT) works?
Closing since no response. Will re-open if necessary.
I used a squared size (300x300) and the plugin worked fine, but now I am using a different input size (240 height x 360 width) with "GridAnchorRect_TRT" and the output predictions are wrong. I use the following configuration to create the trt plugin:
PriorBox = gs.create_plugin_node(
name="MultipleGridAnchorGenerator",
op="GridAnchorRect_TRT",
minSize=0.2,
maxSize=0.95,
aspectRatios=[1.0, 2.0, 0.5, 3.0, 0.33],
variance=[0.1, 0.1, 0.2, 0.2],
featureMapShapes=[
15,
23,
8,
12,
4,
6,
2,
3,
1,
2,
1,
1,
],
numLayers=6,
)
And I get these weird/mirrored predictions:

Obviously the bounding box coordinates are wrongly encoded/decoded from the anchors.
I think that GridAnchorRect_TRT is a fundamental plugin for real world applications, and it needs a fix asap.
@rmccorm4 do you mind re-opening it?
@fshi98 @edumotya can you please verify if this resolves the issue: https://github.com/NVIDIA/TensorRT/pull/679
Well @rajeevsrao , now the uff parser does not find the plugin:
[TensorRT] ERROR: UffParser: Validator error: MultipleGridAnchorGenerator: Unsupported operation _GridAnchorRect_TRT
I am creating the plugin node using this code:
PriorBox = gs.create_plugin_node(
name="MultipleGridAnchorGenerator",
op="GridAnchorRect_TRT",
minSize=0.2,
maxSize=0.95,
aspectRatios=[1.0, 2.0, 0.5, 3.0, 0.33],
variance=[0.1, 0.1, 0.2, 0.2],
featureMapShapes=[40, 23, 20, 12, 10, 6, 5, 3, 3, 2, 2, 1],
numLayers=6,
)
I started from the container nvcr.io/nvidia/deepstream-l4t:5.0-20.07-base. I also tried to rebuild the TensorRT OSS components on Jetson from the master branch, with no success, the error was the same. I am using TensorRT version: 7.1.3, library version: 7.
Am I doing something wrong? Do you have any clues?
EDIT: I have opened a new issue for this 807
Most helpful comment
I used a squared size (300x300) and the plugin worked fine, but now I am using a different input size (240 height x 360 width) with "GridAnchorRect_TRT" and the output predictions are wrong. I use the following configuration to create the trt plugin:
And I get these weird/mirrored predictions:
Obviously the bounding box coordinates are wrongly encoded/decoded from the anchors.
I think that GridAnchorRect_TRT is a fundamental plugin for real world applications, and it needs a fix asap.