Skip to content

Commit

Permalink
First lazy BBaug
Browse files Browse the repository at this point in the history
  • Loading branch information
U-DESKTOP-A6FGL28\nekit committed Jun 21, 2020
1 parent d20acc7 commit cc4dd43
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mmdet/datasets/pipelines/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
from mmdet.core import PolygonMasks
from mmdet.core.evaluation.bbox_overlaps import bbox_overlaps
from ..builder import PIPELINES
try:
import bbaug
from bbaug import policies
except ImportError:
use_bbaug = None

try:
from imagecorruptions import corrupt
Expand Down Expand Up @@ -950,6 +955,9 @@ def __init__(self):
pass

def __call__(self, results):
if use_bbaug is None:
raise RuntimeError('BBaug is not installed')

policy = policy_container.select_random_policy()
img_aug, bbs_aug = policy_container.apply_augmentation(policy, results['img'], results['gt_bboxes'], results['gt_labels'])

Expand Down

0 comments on commit cc4dd43

Please sign in to comment.