piiswrong commented on a change in pull request #11027: Add standard ResNet data augmentation for ImageRecordIter URL: https://github.com/apache/incubator-mxnet/pull/11027#discussion_r194592109
########## File path: src/io/image_aug_default.cc ########## @@ -296,7 +436,27 @@ class DefaultImageAugmenter : public ImageAugmenter { param_.data_shape[2], param_.data_shape[1], prnd); cv::resize(res(roi), res, cv::Size(param_.data_shape[2], param_.data_shape[1]) , 0, 0, interpolation_method); - } else { + } else if (!random_resized_crop_exec) { + if (res.rows < param_.data_shape[1]) { + index_t new_cols = static_cast<index_t>(static_cast<float>(param_.data_shape[1]) / + static_cast<float>(res.rows) * + static_cast<float>(res.cols)); + int interpolation_method = GetInterMethod(param_.inter_method, res.cols, res.rows, Review comment: Looks like the three calls to GetInterMethod can be extracted outside ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services