Closed monajalal closed 2 years ago
Set RETURN_PREACTIVATION = True in the starter code. You need to modify the images variable to accept a single image after preprocessing it to be a tensor. For the record, unless you are only interested in a few images, not using batches would be really slow compared to batch forward calls.
transform = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize(mean=(0.5, 0.5, 0.5), std=(0.5, 0.5, 0.5))
])
rgb_img = Image.open(img)
images = transform(rgb_img)
images = images.unsqueeze(0) # or einops.rearrange('c h w -> () c h w')
Thanks for the great paper. For using the ResNet18 from img2vec git repo, I have been using the following script. Could you please provide a similar script for use on your saved model named tenpercent_resnet18.ckpt