Skip to content

Commit c00b64e

Browse files
author
Beat Buesser
committed
Make number of frames variable
Signed-off-by: Beat Buesser <[email protected]>
1 parent 5c26dbc commit c00b64e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

art/attacks/evasion/adversarial_patch/adversarial_patch_tensorflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,10 @@ def _random_overlay(self, images: np.ndarray, patch: np.ndarray, scale: Optional
314314
padded_patch = tfa.image.transform(padded_patch, transform_vectors, "BILINEAR",)
315315

316316
if self.nb_dims == 4:
317-
image_mask = tf.stack([image_mask] * 15, axis=1)
317+
image_mask = tf.stack([image_mask] * images.shape[1], axis=1)
318318
image_mask = tf.cast(image_mask, images.dtype)
319319

320-
padded_patch = tf.stack([padded_patch] * 15, axis=1)
320+
padded_patch = tf.stack([padded_patch] * images.shape[1], axis=1)
321321
padded_patch = tf.cast(padded_patch, images.dtype)
322322

323323
inverted_mask = 1 - image_mask

0 commit comments

Comments
 (0)