I see that RoIAlign has been written in cuda here: https://github.com/facebookresearch/maskrcnn-benchmark/blob/master/maskrcnn_benchmark/csrc/cuda/ROIAlign_cuda.cu
I am wondering if there was any particular reason it was not written in python?
It's mostly for efficiency reasons.
If you want a Python-only version of ROIPool, you can find it here.
It probably doesn't work as is anymore (it was written for PyTorch 0.1), but it gives the gist of it.
roi pool and roi align are now implemented in torchvision.ops. Pretty convenient and easy to work with in Python.
Most helpful comment
roi pool and roi align are now implemented in torchvision.ops. Pretty convenient and easy to work with in Python.