Answers for "pil normalize image"

0

pil normalize image

# load image
image = Image.open('sydney_bridge.jpg')
pixels = asarray(image)

# convert from integers to floats
pixels = pixels.astype('float32')
# normalize to the range 0-1
pixels /= 255.0
Posted by: Guest on June-03-2021

Python Answers by Framework

Browse Popular Code Answers by Language