You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/11/14 05:53:10 UTC

[GitHub] cypw commented on issue #8644: fix bug in TryCrop()

cypw commented on issue #8644: fix bug in TryCrop()
URL: https://github.com/apache/incubator-mxnet/pull/8644#issuecomment-344153970
 
 
   @zhreshold 
   If all conditions must be true, then why did you add the `if` in [Line 323](https://github.com/apache/incubator-mxnet/blob/master/src/io/image_det_aug_default.cc#L323), [Line 329](https://github.com/apache/incubator-mxnet/blob/master/src/io/image_det_aug_default.cc#L329), [Line 335](https://github.com/apache/incubator-mxnet/blob/master/src/io/image_det_aug_default.cc#L335) ?
   ```c++
       // check if crop_box valid
       bool valid = false;
       if (min_crop_overlap > 0.f && max_crop_overlap < 1.f &&
           min_crop_sample_coverage > 0.f && max_crop_sample_coverage < 1.f &&
           min_crop_object_coverage > 0.f && max_crop_object_coverage < 1.f) {
         for (auto& obj : objects_) {
           Rect gt_box = obj.ToRect();
           if (min_crop_overlap > 0.f || max_crop_overlap < 1.f) {  // <--  ???
             float ovp = RectIOU(crop_box, gt_box);
             if (ovp < min_crop_overlap || ovp > max_crop_overlap) {
               continue;
             }
           }
           if (min_crop_sample_coverage > 0.f || max_crop_sample_coverage < 1.f) { // <-- ???
             float c = (crop_box & gt_box).area() / crop_box.area();
             if (c < min_crop_sample_coverage || c > max_crop_sample_coverage) {
               continue;
             }
           }
           if (min_crop_object_coverage > 0.f || max_crop_object_coverage < 1.f) { // <-- ???
             float c = (crop_box & gt_box).area() / gt_box.area();
             if (c < min_crop_object_coverage || c > max_crop_object_coverage) {
               continue;
             }
           }
           valid = true;
           break;
         }
       } else {
         valid = true;
       }
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services