Commit 27ce4190 authored by Jerry Jiarui XU's avatar Jerry Jiarui XU Committed by Kai Chen
Browse files

fixed crop of single channel image like semantic map (#107)

parent 3b46ddf0
...@@ -142,7 +142,7 @@ def imcrop(img, bboxes, scale=1.0, pad_fill=None): ...@@ -142,7 +142,7 @@ def imcrop(img, bboxes, scale=1.0, pad_fill=None):
patch = img[y1:y2 + 1, x1:x2 + 1, ...] patch = img[y1:y2 + 1, x1:x2 + 1, ...]
else: else:
_x1, _y1, _x2, _y2 = tuple(scaled_bboxes[i, :]) _x1, _y1, _x2, _y2 = tuple(scaled_bboxes[i, :])
if chn == 2: if chn == 1:
patch_shape = (_y2 - _y1 + 1, _x2 - _x1 + 1) patch_shape = (_y2 - _y1 + 1, _x2 - _x1 + 1)
else: else:
patch_shape = (_y2 - _y1 + 1, _x2 - _x1 + 1, chn) patch_shape = (_y2 - _y1 + 1, _x2 - _x1 + 1, chn)
......
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