当前位置:网站首页>图像变换 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。
边栏推荐
- Use Mysql to determine the day of the week
- 对‘g2o::VertexSE3::VertexSE3()’未定义的引用
- Use canvas to add text watermark to the page
- SLAM APP
- What is the workflow of dry goods MapReduce?
- 【Multisim仿真】利用运算放大器产生方波、三角波发生器
- 司空见惯 - 会议室名称
- 视觉SLAM十四讲笔记-10-2
- Pymysql uses cursor operation database method to encapsulate!!!
- Replace the backbone of target detection (take the fast RCNN as an example)
猜你喜欢

Introduction to go language (V) -- branch statement

CMU 15 - 445 cours de base de données Leçon 5 version texte - Pool tampon
![[Multisim Simulation] using operational amplifier to generate sawtooth wave](/img/98/27086746dc552ada25fd36a82cb52b.png)
[Multisim Simulation] using operational amplifier to generate sawtooth wave

Flink CDC 在大健云仓的实践

Cf:d. black and white stripe

Review of software testing technology

金字塔测试原理:写好单元测试的8个小技巧,一文总结

Find the maximum 3 same digits in the string

Gmail: how do I recall an outgoing message?

On the translation of rich text storage database format
随机推荐
基于华为云图像识别标签实战
SISO decoder for SPC (supplementary Chapter 1)
WWDC22 开发者需要关注的重点内容
关于富文本储存数据库格式转译问题
Realize that you can continue to play
2022 the latest software testing classic summarized by major manufacturers. After reading it, I'm not afraid I won't get an offer
Cf:g. count the trains [sortedset + bisect + simulation maintaining strict decreasing sequence]
Introduction to go language (V) -- branch statement
Swagger2 easy to use
The 2023 MBA (Part-time) of Beijing University of Posts and telecommunications has been launched
Record the phpstudy configuration php8.0 and php8.1 extension redis
SLAM APP
【题解】Codeforces Round #798 (Div. 2)
视觉SLAM十四讲笔记-10-2
Judge whether it is a balanced binary tree
I don't want to open an account online. Is it safe to open an account online?
leetcode:剑指 Offer 59 - II. 队列的最大值[deque + sortedlist]
[untitled]
First acquaintance with enterprise platform
Go语言入门(六)——循环语句