yongwww commented on issue #4417: [TOPI][RELAY][OP] add op crop_and_resize URL: https://github.com/apache/incubator-tvm/pull/4417#issuecomment-558977266 > Looking at this again, I was wondering if there's any reason we can't implement a separate `topi.crop` function then have `topi.crop_and_resize` simply first call `topi.crop` then call `topi.resize`. That seems like it would be by far the cleanest implementation. I guess `crop` here is the same as `strided_slice`? I was thinking this for a while, besides the reasons in the pr description above, some of the other reasons are as following: - Having a single op `crop_and_resize`, we don't crop the input and then resize sequentially. `crop_and_resize` directly resizes the input with target size. However, if crop first, then resize, it has to iterate through input images twice, which would introduce some overhead, I guess it is one of the important reasons why TF has crop_and_resize. - "Crop and then Resize" is not able to handle interpolation with `extrapolation_value > 0` (sorry TF has this), the extrapolation_value is related to boxes, original image height and width, that means we have to change `resize` to take some extra inputs like boxes and original (NOT the cropped) image height and width, seems it is not simple/clean.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
