Commit 4b91c947 authored by Zecheng He's avatar Zecheng He Committed by Facebook GitHub Bot
Browse files

RandomResize op

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/384

Random resize augmentation. Randomly pick a scale from the shape_list and resize to that scale.

  D2 (https://github.com/facebookresearch/d2go/commit/87374efb134e539090e0b5c476809dc35bf6aedb)GO_DATA:
    AUG_OPS:
      TRAIN: [
        RandomResizeOp::{"shape_list": [[224, 224], [256, 256], [320, 320]]}
      ]

Reviewed By: XiaoliangDai

Differential Revision: D40230332

fbshipit-source-id: 60a48f85240aef673033d48db4662899dc90bef4
parent 55133c79
......@@ -24,6 +24,7 @@ D2_RANDOM_TRANSFORMS = {
"RandomFlip": d2T.RandomFlip,
"RandomSaturation": d2T.RandomSaturation,
"RandomLighting": d2T.RandomLighting,
"RandomResize": d2T.RandomResize,
"FixedSizeCrop": d2T.FixedSizeCrop,
"ResizeScale": d2T.ResizeScale,
}
......@@ -123,3 +124,11 @@ def FixedSizeCropOp(
cfg: CfgNode, arg_str: Optional[str], is_train: bool
) -> List[aug.Augmentation]:
return build_func(cfg, arg_str, is_train, name="FixedSizeCrop")
# example repr: RandomResizeOp::{"shape_list": [[224, 224], [256, 256], [320, 320]]}
@TRANSFORM_OP_REGISTRY.register()
def RandomResizeOp(
cfg: CfgNode, arg_str: Optional[str], is_train: bool
) -> List[aug.Augmentation]:
return build_func(cfg, arg_str, is_train, name="RandomResize")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment