Pyramid Adversarial Training Improves ViT's Performance
All you have to do is loading images and deep model(s).
import torchvision
import cv2
from pyramidAT import pyramidAT
n_steps = 10
models = torchvision.models.resnet50(pretrained='imagenet').eval()
images = cv2.resize(cv2.imread('imgs/golf_ball.jfif'), (224,224))
perturbed_image = pyramidAT(images, model, mode='nearest', n_steps=n_steps)
- Convert original TF/JAX to PyTorch version
- PyramidAT with dataloader
- Bench-marking table
email: kdhht5022@gmail.com