当前位置:网站首页>图像变换 torchvision.transforms 笔记
图像变换 torchvision.transforms 笔记
2022-06-11 19:21:00 【秋山丶雪绪】
1. Transforms on PIL Image
CenterCrop 中心裁剪
torchvision.transforms.CenterCrop(size)
参数:size: (h,w) or int
ColorJitter 随机改变亮度、对比度、饱和度
torchvision.transforms.ColorJitter(brightness=0, contrast=0, saturation=0, hue=0)
参数:brightness: float or (min,max), 亮度, [max(0, 1 - brightness), 1 + brightness] or [min, max], 非负数
contrast: float or (min,max), 对比度, [max(0, 1 - contrast), 1 + contrast] or [min, max], 非负数
saturation: float or (min,max), 饱和度, [max(0, 1 - saturation), 1 + saturation] or [min, max], 非负数
hue: float or (min,max), 色相, [-hue, hue] or [min, max], 0 <= hue <= 0.5 or -0.5 <= min <= max <= 0.5
RandomResizedCrop 随机大小和长宽比裁剪并resize
torchvision.transforms.RandomResizedCrop(size, scale=(0.08, 1.0), ratio=(0.75, 1.33), interpolation=2)
参数:size: 最终大小
scale: 裁剪原始图像尺寸
ratio: 长宽比
interpolation: 插值方法,默认 PIL.Image.BILINEAR
RandomHorizontalFlip 随机水平翻转
torchvision.transforms.RandomHorizontalFlip(p=0.5)
参数:p: float
RandomApply 随机应用一系列变换
torchvision.transforms.RandomApply(transforms, p=0.5)
参数:transforms: list or tuple
p: float
RandomGrayscale 随机灰度化
torchvision.transforms.RandomGrayscale(p=0.1)
参数:p: float
注:
p 概率变为灰度图,1-p 概率不变;
输入图为1通道,灰度图为1通道;输入图为3通道,灰度图为3通道,r == g == b。
边栏推荐
- 【图像分割】基于马尔可夫随机场实现图像分割附matlab代码
- Cf:c. restoring the duration of tasks
- SQL injection vulnerability learning 1: phpstudy integrated environment building DVWA shooting range
- 使用贝叶斯优化进行深度神经网络超参数优化
- Flask CKEditor 富文本编译器实现文章的图片上传以及回显,解决路径出错的问题
- [image denoising] image denoising based on Markov random field with matlab code
- Project management of workflow and business service on SAP BTP
- Leetcode: sword finger offer 56 - ii Number of occurrences of numbers in the array II [simple sort]
- On the translation of rich text storage database format
- 《经济学人》:WTO MC12重启 数字经济成为全球经济复苏和增长的核心引擎
猜你喜欢

WWDC22 开发者需要关注的重点内容

"Case sharing" based on am57x+ artix-7 FPGA development board - detailed explanation of Pru Development Manual

Replace the backbone of target detection (take the fast RCNN as an example)

Use Mysql to determine the day of the week

Common - name of conference room

cf:C. Restoring the Duration of Tasks【找规律】

关于富文本储存数据库格式转译问题

MOS transistor 24n50 parameters of asemi, 24n50 package, 24n50 size

Practice of Flink CDC in Dajian cloud warehouse

The Economist: WTO MC12 restarts the digital economy and becomes the core engine of global economic recovery and growth
随机推荐
What started mongodb? What are the application scenarios?
更换目标检测的backbone(以Faster RCNN为例)
cf:E. Price Maximization【排序 + 取mod + 双指针+ 配对】
Practice of tag recognition based on Huawei cloud image
Hyper parameter optimization of deep neural networks using Bayesian Optimization
leetcode:66. add one-tenth
关于我的 “二进制部署 kubernetes 集群” 的体验
kubernetes 二进制安装(v1.20.15)(九)收尾:部署几个仪表盘
Add your favorite background music
01. Telecommunications_ Field business experience
The 2023 MBA (Part-time) of Beijing University of Posts and telecommunications has been launched
7-3 组合问题(*)
High concurrency architecture design
Pymysql uses cursor operation database method to encapsulate!!!
Merge multiple binary search trees
2022 the latest software testing classic summarized by major manufacturers. After reading it, I'm not afraid I won't get an offer
Given a project, how will you conduct performance testing?
Programmers have changed dramatically in 10 years. Everything has changed, but it seems that nothing has changed
Cf:b. array determinations
NR LDPC punched