I have a image im, and need to crop it to a bounding box (x1, x2, y1, y2). Currently I am doing im[y1: y2, x1: x2], but pytorch reminds me that indices should be integers or None. Is it possible to make the operation back-propagatable with respect to x1, x2, y1, y2?
My requirement is a little different from your paper. Rather than learning to focus to and transform specific region of an image, I would like to deterministically crop a given region.