Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 4e7fced

Browse files
Update transforms.py
1 parent deca0a1 commit 4e7fced

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/xvision/transforms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ def __call__(self, imgs, point_meta=None):
316316
y2 = y1 + self.crop_y
317317

318318
w, h = imgs[0].size
319-
if x1 < 0 or x2 < 0 or x2 >= w or y2 >= h:
320-
pad = max(0-x1, 0-x2, x2-w+1, y2-h+1)
319+
if x1 < 0 or y1 < 0 or x2 >= w or y2 >= h:
320+
pad = max(0-x1, 0-y1, x2-w+1, y2-h+1)
321321
assert pad > 0, 'padding operation in crop must be greater than 0'
322322
imgs = [ ImageOps.expand(img, border=pad, fill=self.fill) for img in imgs ]
323323
x1, x2, y1, y2 = x1 + pad, x2 + pad, y1 + pad, y2 + pad

0 commit comments

Comments
 (0)