Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

torchvision.transforms

from torchvision import transforms as transforms
transform = transforms.Compose([
    transforms.RandomCrop(32, padding=4),  #先四周填充0,在把图像随机裁剪成32*32
    transforms.RandomHorizontalFlip(),  #图像一半的概率翻转,一半的概率不翻转
    transforms.RandomRotation((-45,45)), #随机旋转
    transforms.ToTensor(),
    transforms.Normalize((0.4914, 0.4822, 0.4465), (0.229, 0.224, 0.225)), #R,G,B每层的归一化用到的均值和方差
])
Comment

PREVIOUS NEXT
Code Example
Python :: python list of integers 
Python :: how to create obtain any random 3 items of list in python 
Python :: python csv dict reader 
Python :: taking multiple input in python 
Python :: google smtp 
Python :: python trie 
Python :: password text in entry in tkinter 
Python :: merge on row number python 
Python :: python pandas remove non-numeric characters from multiple columns 
Python :: add dir to path python 
Python :: django redirect to external url 
Python :: calculate nth prime number python 
Python :: remove particular row number in pandas 
Python :: import image 
Python :: sklearn train_test_split 
Python :: python how to use input 
Python :: selenium get parent element python 
Python :: Python RegEx Getting index of matched object 
Python :: python ddos 
Python :: circular array python 
Python :: how to get decimal part of a double in python 
Python :: python remove first item in tuple 
Python :: pangram function 
Python :: python not jump next line 
Python :: install python packages behind proxy 
Python :: python split only last occurrence of a character 
Python :: Simple way to measure cell execution time in ipython notebook 
Python :: python mp4 to mp3 
Python :: addition in python 
Python :: python random integer in range 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =