Supporting non maximum suppresion op with dynamic output shape

Hi, I’m trying to translate PyTorch’s NMS op below, whose output shape depends on input:

Can we translate this to Relay using its recent dynamic feature? I’m not familiar with shape function etc.

@haichen @zhiics @jroesch

Currently it’s not very easy to add shape function for the nms op because computing the output shape basically has the same cost of computing nms. The better way to solve this is to add an extra mode, upper bound, to the shape function that only calculates the upper bound of output shape. And then resize it after nms computation finishes.

1 Like