Bugfix - wrong mask bounds passed to box clamping

Summary: Fixes a bug

Reviewed By: bottler

Differential Revision: D37743350

fbshipit-source-id: d68e680d6027ae2b9814b2241fb72d3b74df77c1
This commit is contained in:
David Novotny 2022-07-10 16:01:33 -07:00 committed by Facebook GitHub Bot
parent e8390d3500
commit 522e5f0644

View File

@ -427,7 +427,6 @@ class JsonIndexDataset(DatasetBase, ReplaceableBase):
image_path=entry.image.path,
box_crop_context=self.box_crop_context,
)
mask = _crop_around_box(mask, clamp_bbox_xyxy, full_path)
crop_box_xyxy = _clamp_box_to_image_bounds_and_round(
clamp_bbox_xyxy,
@ -435,6 +434,8 @@ class JsonIndexDataset(DatasetBase, ReplaceableBase):
)
crop_box_xywh = _bbox_xyxy_to_xywh(crop_box_xyxy)
mask = _crop_around_box(mask, clamp_bbox_xyxy, full_path)
fg_probability, _, _ = self._resize_image(mask, mode="nearest")
return fg_probability, full_path, bbox_xywh, clamp_bbox_xyxy, crop_box_xywh