Commit 522e5f06 authored by David Novotny's avatar David Novotny Committed by Facebook GitHub Bot
Browse files

Bugfix - wrong mask bounds passed to box clamping

Summary: Fixes a bug

Reviewed By: bottler

Differential Revision: D37743350

fbshipit-source-id: d68e680d6027ae2b9814b2241fb72d3b74df77c1
parent e8390d35
...@@ -427,7 +427,6 @@ class JsonIndexDataset(DatasetBase, ReplaceableBase): ...@@ -427,7 +427,6 @@ class JsonIndexDataset(DatasetBase, ReplaceableBase):
image_path=entry.image.path, image_path=entry.image.path,
box_crop_context=self.box_crop_context, 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( crop_box_xyxy = _clamp_box_to_image_bounds_and_round(
clamp_bbox_xyxy, clamp_bbox_xyxy,
...@@ -435,6 +434,8 @@ class JsonIndexDataset(DatasetBase, ReplaceableBase): ...@@ -435,6 +434,8 @@ class JsonIndexDataset(DatasetBase, ReplaceableBase):
) )
crop_box_xywh = _bbox_xyxy_to_xywh(crop_box_xyxy) 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") fg_probability, _, _ = self._resize_image(mask, mode="nearest")
return fg_probability, full_path, bbox_xywh, clamp_bbox_xyxy, crop_box_xywh return fg_probability, full_path, bbox_xywh, clamp_bbox_xyxy, crop_box_xywh
......
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