Removing the ANTIALIAS solves the problem
Resize Ground truth images, without changing the labels
-
05-07-2023 - |
题
I have some manually annotated ground truth images color-coding some object. When I resize them (to have X and Y as training images with lower resolution i.e. faster processing time), something changes the label color inside the ground truth.
from PIL import Image
ground_truth=Image.open(//location)
ground_truth_resized = ground_truth.resize(size, Image.ANTIALIAS)
ground_truth_resized.save(//destination folder)
I presume the antialias is doing something to change the color (i.e. label ) I am going from 1024x768 to 640x480, essentially preserving the aspect ratio
How can I reduce resolution but keep labels?
解决方案
不隶属于 StackOverflow