Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenWizard2015 committed Apr 10, 2024
1 parent 24d88d0 commit 54143dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Utils/CroppingAugm.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,22 @@ def _FF(img):
res['sobel'] = tf.reshape(sobel, [N, 6])

if withBlur:
R = RArg = None
if blurShared:
idx = tf.random.uniform((1,), minval=0, maxval=blurN, dtype=tf.int32)
R = tf.gather(blurRange, idx)
R = tf.reshape(R, (1,))
RArg = R
R = tf.fill([N, 1], R[0])
else:
idx = tf.random.uniform((N,), minval=0, maxval=blurN, dtype=tf.int32)
R = tf.gather(blurRange, idx)
R = tf.reshape(R, (N, 1))
RArg = R
pass

tf.assert_equal(tf.shape(R), (N, 1))
res['blured'] = blur(src, positions[0], R)
res['blured'] = blur(src, positions[0], RArg)
res['blur R'] = R - minR # ensure that R is starting from 0.0
pass
return res
Expand Down

0 comments on commit 54143dd

Please sign in to comment.