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
This commit is contained in:
Roman Shapovalov 2024-07-16 02:21:13 -07:00 committed by Facebook GitHub Bot
parent 4df110b0a9
commit d0d0e02007

View File

@ -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(