Commit 5b09d662 authored by Zecheng He's avatar Zecheng He Committed by Facebook GitHub Bot
Browse files

Add orig_h and orig_w to CropTransform to enable inverse transform

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

Inverse transform of ``CropTransform`` requires knowing the original h and w. Add ``orig_h`` and ``orig_w`` to ``CropTransform`` so inverse transform can be used.

Reviewed By: wat3rBro

Differential Revision: D36321451

fbshipit-source-id: 4382de808724d48d71aafe458e05bba400bf6c6b
parent 70f236a6
......@@ -227,7 +227,9 @@ class RandomInstanceCrop(aug.Augmentation):
bbox_xywh = bu.scale_bbox_center(bbox_xywh, scale)
bbox_xywh = bu.clip_box_xywh(bbox_xywh, image_size).int()
return CropTransform(*bbox_xywh.tolist())
return CropTransform(
*bbox_xywh.tolist(), orig_h=image_size[0], orig_w=image_size[1]
)
# example repr: "RandomInstanceCropOp::{'crop_scale': [0.8, 1.6]}"
......
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