当前位置:网站首页>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()
边栏推荐
- 6、 JS naming rules and specifications
- Wrap dynamically created child elements in dynamically created structures
- [leetcode weekly race record] record of the 80th biweekly race
- Cesium achieves sunny, rainy, foggy, snowy and other effects
- VI editor
- 3、 JS notes
- Knowledge points related to system architecture 2
- 0. some doubts about learning SolidWorks for the first time
- GBase 常见网络问题及排查方法
- 7、 JS data type
猜你喜欢
随机推荐
Differences and uses among cookies, localstorage, sessionstorage, and application caching
Number of parameters of pytorch statistical model
Brief description of software testing and software maintenance
Use of grep
1. preliminary understanding of Express
Explanation of JS event loop mechanism and asynchronous tasks
Object in ES6 Use of entries()
VI editor
GBase 8a磁盤問題及處理
Common network problems and troubleshooting methods of gbase
ERP outlet
PHP wechat special merchant incoming V3 packaging interface
You don't know the usage of stringstream
Replace jade engine with EJS
關於RSA加密解密原理
1.初步认识express
File upload JS
Screenshot of cesium implementation scenario
GBase 常见网络问题及排查方法
3、 JS notes









