Question

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?

Était-ce utile?

La solution

Removing the ANTIALIAS solves the problem

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top