microsoft / CSWin-Transformer

CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped, CVPR 2022
MIT License
539 stars 78 forks source link

about the test result on imagenet-2012 #24

Closed rentainhe closed 2 years ago

rentainhe commented 2 years ago

Hi! I've test the CSwin-Tiny-224 released pretrained weight, this is my data transforms during testing:

DEFAULT_CROP_SIZE = 0.9
scale_size = int(math.floor(image_size / DEFAULT_CROP_SIZE))
transform = transforms.Compose(
        [
            transforms.Resize(scale_size, interpolation=3)  # 3: bibubic
            if image_size == 224
            else transforms.Resize(image_size, interpolation=3),
            transforms.CenterCrop(image_size),
            transforms.ToTensor(),
            transforms.Normalize(IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD),
        ]
    )

I can only get 80.5% on imagenet2012 dataset which is inconsistent with the results as you mentioned in this repo, did I miss some details about the data-augmentation during testing?

LightDXY commented 2 years ago

Our code contains the test code, please refer to https://github.com/microsoft/CSWin-Transformer/blob/main/main.py and find the difference