Avoid negatives areas found exception
Avoid negatives areas found exception

Summary:
In some cases, eg training from scratch with a high LR or w/o activation normalization, we saw a "Negative Areas Found" exception. The RPN proposal generation code filters proposals that have a height or width that are too small. By default we use a `min_size` of 0. In a distant other part of the code, it computes the area of the proposals in order to determine FPN scale assignment. An issue arises because the `+ 1` in the `x2 - x1 + 1` width (and height) computation is not scale invariant. It turns out that the filter based on `min_size` was performed in the scaled input coordinates while the FPN scale assignment areas are computed using the unscaled, original image size. Thus a `min_size` of 0 can result in proposals with a negative area as measured wrt the original image. Uuuugh :P.

This diff addresses the issue by filtering based on the area in the unscaled input image and also using a generous (though still small) margin of 1 pixel for `min_size`.

Reviewed By: KaimingHe

Differential Revision: D8773216

fbshipit-source-id: b4ffbc5b6a831176b2656810edea3d3d4e52d687

facebookresearch/Detectron,facebookresearch/Detectron,facebookresearch/Detectron