当前位置:网站首页>Summary of image classification based on pytoch: swing transformer

Summary of image classification based on pytoch: swing transformer

2022-06-22 03:27:00 Steady, not very cold, strong brother

Swin Transformer Detailed explanation and program interpretation of the paper - You know (zhihu.com)

Swin Transformer Detailed explanation and program interpretation of the paper - You know (zhihu.com)

machine learning _ Detailed explanation Swin Transformer (SwinT)_ Where is Wen Shao's blog -CSDN Blog _swin transformer

Swin Transformer: Hierarchical Vision Transformer using Shifted Windows (arxiv.org)

Swin-Transformer Network structure details _ Sunflower's little mung bean blog -CSDN Blog _swin transformer Network structure

microsoft/Swin-Transformer: This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows". (github.com)

swin_transformer Used for image classification ( Has run through )swin transformer Image classification

Pytorch Download data set of _ Tut tut tut biubiu The blog of -CSDN Blog _pytorch Download datasets

pytorch Save picture and channel order _pytorch Change the channel order

 PyTorch Learning notes :transforms Twenty two ways to (transforms The usage is very detailed

numpy.clip(a, a_min, a_max, out=None)
a Is an array , The last two parameters represent the minimum and maximum values respectively .
 in other words clip This function limits the elements in the array to a_min, a_max Between , Greater than a_max That makes it equal to  a_max, Less than a_min, That makes it equal to a_min.

pytorch Of clamp  Same as np.clip: Be confined to a certain range 
torch.clamp(input,min,max,out=None)
 take input The elements in are limited to [min,max] And returns a Tensor

# Pytorch  Inverse normalization 
# https://discuss.pytorch.org/t/simple-way-to-inverse-transform-normalization/4821/3
class UnNormalize(object):
    def __init__(self,mean,std):
        self.mean=mean
        self.std=std
 
    def __call__(self,tensor):
        """
        Args:
        :param tensor: tensor image of size (B,C,H,W) to be un-normalized
        :return: UnNormalized image
        """
        for t, m, s in zip(tensor,self.mean,self.std):
            t.mul_(s).add_(m)


pytorch in transform function 
torchvision.transforms yes pytorch Image preprocessing package in 
 It's usually used Compose Put multiple steps together :
 for instance 
transforms.Compose([
transforms.CenterCrop(10),
transforms.ToTensor(),
])

原网站

版权声明
本文为[Steady, not very cold, strong brother]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206220305461262.html