From 313d491143700f3cd5b8ab87785ac0d9ef12c72b Mon Sep 17 00:00:00 2001 From: Laurent Fainsin Date: Fri, 26 Aug 2022 10:50:47 +0200 Subject: [PATCH] fix: wrong xy coordinates when pasting Former-commit-id: 8d3f4982614fb9874aa26b5d682148b53d45231c [formerly 03f6799ff09de7314e1e420eb123de7a3523d8dd] Former-commit-id: 9a8a5c2d21e49a72dfcc8b5efdcce3a20f4f8de6 --- src/notebooks/comp.ipynb.REMOVED.git-id | 2 +- src/utils/paste.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/notebooks/comp.ipynb.REMOVED.git-id b/src/notebooks/comp.ipynb.REMOVED.git-id index 1caa707..5f60815 100644 --- a/src/notebooks/comp.ipynb.REMOVED.git-id +++ b/src/notebooks/comp.ipynb.REMOVED.git-id @@ -1 +1 @@ -c2144df415f2913c12a788aa8070ad538ce60480 \ No newline at end of file +297b2baa92a60d4fc01739921af7bf9f0f364370 \ No newline at end of file diff --git a/src/utils/paste.py b/src/utils/paste.py index 6398551..1d951e5 100644 --- a/src/utils/paste.py +++ b/src/utils/paste.py @@ -147,11 +147,11 @@ class RandomPaste(A.DualTransform): scale = rd.uniform(*self.scale_range) * min_scale shape = np.array(paste_shape * scale, dtype=np.uint) - x = rd.randint(0, target_shape[0] - shape[0]) - y = rd.randint(0, target_shape[1] - shape[1]) + x = rd.randint(0, target_shape[1] - shape[1]) + y = rd.randint(0, target_shape[0] - shape[0]) # check for overlapping - if RandomPaste.overlap(augmentations, x, y, shape[0], shape[1]): + if RandomPaste.overlap(augmentations, x, y, shape[1], shape[0]): continue shearx = rd.uniform(-2, 2)