0

I'm working on a custom Faster RCNN with Detectron2 framework and I have a doubt about transformation during training and inference. I created a custom Trainer inheriting from DefaultTrainer class and I overridden build_train_loader and build_test_loader. the following code represent what I did:

@classmethod
def build_train_loader(cls, cfg):
    mapper = DatasetMapper(cfg, is_train=True, augmentations=custom_aug(is_train=True))
    return build_detection_train_loader(cfg, mapper=mapper)

I did equivalent with is_train=False for build_test_loader(...) method. Now I don't know if only transformation in custom_aug are executed or also the transformation specified into cfg file. In particular, for Faster-RCNN, I referred to these string into configuration file:

# By default, {MIN,MAX}_SIZE options are used in transforms.ResizeShortestEdge.
# Please refer to ResizeShortestEdge for detailed definition.
# Size of the smallest side of the image during training
_C.INPUT.MIN_SIZE_TRAIN = (800,)
# Sample size of smallest side by choice or random selection from range give by
# INPUT.MIN_SIZE_TRAIN
_C.INPUT.MIN_SIZE_TRAIN_SAMPLING = "choice"
# Maximum size of the side of the image during training
_C.INPUT.MAX_SIZE_TRAIN = 1333
# Size of the smallest side of the image during testing. Set to zero to disable resize in testing.
_C.INPUT.MIN_SIZE_TEST = 800
# Maximum size of the side of the image during testing
_C.INPUT.MAX_SIZE_TEST = 1333
# Mode for flipping images used in data augmentation during training
# choose one of ["horizontal, "vertical", "none"]
_C.INPUT.RANDOM_FLIP = "horizontal"

So, my question is, these transformations will be executed along these into custom_aug or will be "overridden" by custom_aug?

0 Answers0