From d0d0e020071c34ffa0953c00f9e85be0672b597e Mon Sep 17 00:00:00 2001 From: Roman Shapovalov Date: Tue, 16 Jul 2024 02:21:13 -0700 Subject: [PATCH] Fix: setting FrameData.crop_bbox_xywh for backwards compatibility Summary: This diff is fixing a backwards compatibility issue in PyTorch3D's dataset API. The code ensures that the `crop_bbox_xywh` attribute is set when box_crop flag is on. This is an implementation detail that people should not really use, however some people depend on this behaviour. Reviewed By: bottler Differential Revision: D59777449 fbshipit-source-id: b875e9eb909038b8629ccdade87661bb2c39d529 --- pytorch3d/implicitron/dataset/frame_data.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pytorch3d/implicitron/dataset/frame_data.py b/pytorch3d/implicitron/dataset/frame_data.py index 87ec9084..631bea8a 100644 --- a/pytorch3d/implicitron/dataset/frame_data.py +++ b/pytorch3d/implicitron/dataset/frame_data.py @@ -276,6 +276,7 @@ class FrameData(Mapping[str, Any]): image_size_hw=tuple(self.effective_image_size_hw), # pyre-ignore ) crop_bbox_xywh = bbox_xyxy_to_xywh(clamp_bbox_xyxy) + self.crop_bbox_xywh = crop_bbox_xywh if self.fg_probability is not None: self.fg_probability = crop_around_box(