def METHOD_NAME(imagenet_r, imagenetr_labels, model, preprocess, device):
    res = []
    for item in imagenet_r.imgs:
        img, label = item
        image = Image.open(img)
        image_input = preprocess(image).unsqueeze(0).to(device)
        text_inputs = torch.cat(
            [clip.tokenize(f"a picture of a {c}") for c in imagenetr_labels]).to(device)
        # Calculate features
        with torch.no_grad():
            image_features = model.encode_image(image_input)
            text_features = model.encode_text(text_inputs)
        image_features /= image_features.norm(dim=-1, keepdim=True)
        text_features /= text_features.norm(dim=-1, keepdim=True)
        similarity = (100.0 * image_features @ text_features.T).softmax(dim=-1)
        values, indices = similarity[0].topk(1)
        for value, index in zip(values, indices):
            res.append([index.cpu().numpy(), label])
    res = np.array(res)
    acc = np.mean(np.array(res)[:, 0] == np.array(res)[:, 1])
    return res, acc