gradients = frcnn.loss_gradient(x=image, y=None)
// Create adversarial image
image_adv = image + np.sign(gradients) * 8 * 1
image_adv = np.clip(image_adv, a_min=0, a_max=255).astype(np.uint8)
for i in range(image_adv.shape[0]):
After Change
image_adv = attack.generate(x=image, y=None)
print("np.amax(np.abs(image - image_adv))")
print(np.amax(np.abs(image - image_adv)))
for i in range(image_adv.shape[0]):
plt.axis("off")