I'm a starter on Halide, I'm trying to use it to accelerate maskrcnn.
By now, the performance is really excellent comparing to c version. Then, I've run into a problem which has bothered me for several days: Non maximum suppression(nms), it is a classic algorithm but I have not found any similar example for this in halide, the summary is:
Sort an array box first, then for every i in box, from i+1 to the end of this array, compute the overlap with box[i], then either keep it or delete it according to overlap. Is it possible to realize it in halide? Do I have to use an define::extern? Appeciate a lot if anyone could reply.
update:
Sorry that I didn't explain this problem very well. The Non maximum suppression in MaskRcnn is a little different from the one in Canny Edge Detector, You can refer to this:
https://www.pyimagesearch.com/2015/02/16/faster-non-maximum-suppression-python/
where the python code is the realization of this kind of algorithm.
If it's too long, think about this simple question:
For an array a[10]= {1, 2, 3, 4, 5 ,6 , 7 , 8, 9, 10}, we need to compute the product between a[i] and a[j](i+1<=j < 10), if this product value is smaller than 6(for example), then we delete the a[j], iterates this operation for all i in range [0, 9]. Thank you.