Skip to content

Commit 79efb61

Browse files
committed
Updates based on Beat's feedback
1 parent eb3e2ef commit 79efb61

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

art/attacks/evasion/adversarial_patch/adversarial_patch_pytorch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,8 @@ def generate( # type: ignore
490490
491491
:param x: An array with the original input images of shape NCHW or input videos of shape NFCHW.
492492
:param y: True or target labels of format `list[dict[str, Union[np.ndarray, torch.Tensor]]]`, one for each
493-
input image. For untargeted attacks, this should be None. The fields of the dict are as follows:
493+
input image. For untargeted attacks, if `y` is None the attack will attack the model predictions
494+
on `x`. The fields of the dict are as follows:
494495
495496
- boxes [N, 4]: the boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.
496497
- labels [N]: the labels for each image.

art/attacks/evasion/dpatch_robust.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ def generate( # type: ignore
155155
if y is None and self.targeted:
156156
raise ValueError("The targeted version of RobustDPatch attack requires target labels provided to `y`.")
157157
if y is not None and not self.targeted:
158-
raise ValueError(
159-
"The untargeted version of RobustDPatch attack does not use target labels provided to 'y'."
160-
)
158+
raise ValueError("The untargeted version of RobustDPatch attack does not use True labels provided to 'y'.")
161159
if x.ndim != 4: # pragma: no cover
162160
raise ValueError("The adversarial patch can only be applied to images.")
163161

0 commit comments

Comments
 (0)