当前位置:网站首页>transforms. ColorJitter(0.3, 0, 0, 0)
transforms. ColorJitter(0.3, 0, 0, 0)
2022-06-13 08:55:00 【Human high quality Algorithm Engineer】
pytorch and onnx The output is a little different , It should be strictly aligned
Carefully aligned the model pretreatment , Finally, locating the difference is one of the color jitters
transform = transforms.Compose([
transforms.ColorJitter(0.3, 0, 0, 0),
transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))
])
Click to see the source code implementation , stay transform.py in
if brightness is not None:
brightness_factor = random.uniform(brightness[0], brightness[1])
transforms.append(Lambda(lambda img: F.adjust_brightness(img, brightness_factor)))
Finally, it was found that PIL In the library ImageEnhance To enhance the brightness
enhancer = ImageEnhance.Brightness(img)
img = enhancer.enhance(brightness_factor)
return img
#-*- coding: UTF-8 -*-
from PIL import Image
from PIL import ImageEnhance
# original image
image = Image.open('lena.jpg')
image.show()
# Brightness enhancement
enh_bri = ImageEnhance.Brightness(image)
brightness = 1.5
image_brightened = enh_bri.enhance(brightness)
image_brightened.show()
# Chroma enhancement
enh_col = ImageEnhance.Color(image)
color = 1.5
image_colored = enh_col.enhance(color)
image_colored.show()
# Contrast enhancement
enh_con = ImageEnhance.Contrast(image)
contrast = 1.5
image_contrasted = enh_con.enhance(contrast)
image_contrasted.show()
# Sharpness enhancement
enh_sha = ImageEnhance.Sharpness(image)
sharpness = 3.0
image_sharped = enh_sha.enhance(sharpness)
image_sharped.show()
边栏推荐
- Brief description of port, domain communication port and domain service
- JS to get the date in the next seven days of the current date
- JS array using the reduce() method
- ADT Google browser plug-in ad Terminator
- GBase 8a V95与V86压缩策略类比
- Docker installing MySQL local remote connection docker container MySQL
- Gbase 8A v95 vs v86 compression strategy analogy
- redis. exceptions. ConnectionError: Error 111 connecting to 172.16.8.128:6379. Connection refused.
- Map 23 summary
- How to save the video of wechat video number locally?
猜你喜欢
On the use of regular expressions (bracket problem)
Uni app subcontracting loading and optimization
4. Relationship selector (parent-child relationship, ancestor offspring relationship, brother relationship)
[network security] webshell empowerment of new thinking of SQL injection
centos 安装mysql及设置远程访问
Replace jade engine with EJS
Wrap dynamically created child elements in dynamically created structures
Problems in the deconstruction and assignment of objects, comparison between empty strings and undefined
redis. exceptions. ConnectionError: Error 111 connecting to 172.16.8.128:6379. Connection refused.
WARNING:tornado. access:404 GET /favicon. ICO (172.16.8.1) 1.84ms [with static file settings]
随机推荐
1、 JS introduction
15. copy constructor
How to resolve "the operation cannot be completed successfully because the file contains viruses or potentially junk software
output. Interpretation of topk() function
Problems in the deconstruction and assignment of objects, comparison between empty strings and undefined
About RSA encryption and decryption principle
What is the difference between getfullyear() and getyear()
GBase 常见网络问题及排查方法
Wrap dynamically created child elements in dynamically created structures
Container concept and cloud native
【leetcode周赛记录】第80场双周赛记录
centos 安装mysql及设置远程访问
Sky background map, navigation page lovefanfan top
VS安装VAssistX插件导致WPF-XAML文件输入中文出现乱码问题解决方案
2020-12-28
Four kinds of hooks in deep learning
H5 mobile terminal adaptation
Web page H5 wechat sharing
Tensorflow1.14 corresponds to numpy version
Mobile terminal development I: basic concepts