The input coordinates are under original image scale, and bottom is the Conv feature before roiAlign, so the coordinates are changed to feature scale.
Theta is the transformation matrix. X1, y1 is the left corner and x2, y2 KS the right bottom corner of the roi.
If you don’t fully understand, you can set some value to x1 y1 x2 y3 bottom, and run the function.