From 7220cee1d1dc1f14003dbf8d633bbb76c547000c Mon Sep 17 00:00:00 2001 From: haoyuefan <35680714+yuefanhao@users.noreply.github.com> Date: Thu, 24 Sep 2020 00:51:33 +0800 Subject: [PATCH] mosaic4 bottom left image fix (#1021) fix a bug in load_mosaic --- utils/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/datasets.py b/utils/datasets.py index 4be6a81e32af..29ee4b051e85 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -661,7 +661,7 @@ def load_mosaic(self, index): x1b, y1b, x2b, y2b = 0, h - (y2a - y1a), min(w, x2a - x1a), h elif i == 2: # bottom left x1a, y1a, x2a, y2a = max(xc - w, 0), yc, xc, min(s * 2, yc + h) - x1b, y1b, x2b, y2b = w - (x2a - x1a), 0, max(xc, w), min(y2a - y1a, h) + x1b, y1b, x2b, y2b = w - (x2a - x1a), 0, w, min(y2a - y1a, h) elif i == 3: # bottom right x1a, y1a, x2a, y2a = xc, yc, min(xc + w, s * 2), min(s * 2, yc + h) x1b, y1b, x2b, y2b = 0, 0, min(w, x2a - x1a), min(y2a - y1a, h)