Skip to content

Commit b3a8e6e

Browse files
authored
Merge branch 'main' into main
2 parents 1e0a80c + af90a12 commit b3a8e6e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

requirements_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jax[cpu]==0.4.30
5454
# tests and style checking
5555
pytest~=8.3.2
5656
pytest-mock~=3.14.0
57-
pytest-cov~=6.0.0
57+
pytest-cov~=6.1.1
5858
pylint==3.2.6
5959
mypy==1.11.1
6060
pycodestyle==2.12.1

tests/attacks/test_steal_now_attack_later.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ def collect_patches_from_images(detector, imgs):
6666
pos_matrix[:, 2] = torch.clamp_max(pos_matrix[:, 2], imgs.shape[3])
6767
pos_matrix[:, 3] = torch.clamp_max(pos_matrix[:, 3], imgs.shape[2])
6868
for pos_m in pos_matrix:
69+
if pos_m[3] - pos_m[1] == 0 or pos_m[2] - pos_m[0] == 0:
70+
continue
6971
p = imgs[i, :, pos_m[1] : pos_m[3], pos_m[0] : pos_m[2]]
7072
patch.append(p.to(detector.device))
7173

@@ -165,7 +167,7 @@ def _loader(path):
165167
attack = SNAL(
166168
object_detector,
167169
eps=16.0 / 255.0,
168-
max_iter=10,
170+
max_iter=5,
169171
num_grid=10,
170172
candidates=candidates_list,
171173
collector=collect_patches_from_images,

0 commit comments

Comments
 (0)