Beyond-ImageNet-Attack icon indicating copy to clipboard operation
Beyond-ImageNet-Attack copied to clipboard

images are not resized lossless

Open jS5t3r opened this issue 1 year ago • 0 comments

Here: https://github.com/Alibaba-AAIG/Beyond-ImageNet-Attack/blob/863b758ee4f4a6d3d4e7777c5f94f457fa449f73/imagenet/convert.py#L22

This resizing is a bilinear interpolation, which can produce some loss. Nearest neighbor is said to be lossless:

resized_image = cv2.resize(image, (new_width, new_height), interpolation=cv2.INTER_NEAREST)

jS5t3r avatar Nov 30 '23 12:11 jS5t3r