/coloured_mask_to_black

convert one channel black mask into coloured (RGB) mask (.png)

Primary LanguagePythonApache License 2.0Apache-2.0

black_mask_to_coloured

convert coloured (RGB) mask (.png) into one channel black mask for machine learning segmentation.

picture

USAGE

Configure Line15~17

path = '/Users/bogus/Downloads/SegmentationClass/' # Source Folder
dstpath = '/Users/bogus/Downloads/SegmentationClass2/' # Destination Folder

#color mapping
VOC_COLORMAP = [[176, 112, 32], [48, 240, 32], [48, 112, 32], [176, 240, 160],
                [176, 240, 32], [48, 240, 160], [176, 112, 160]]
  • configure path
  • need to specify VOC_COLORMAP with corresponding class name
  • VOC_CLASSES is not used in code but just for guide of colormap

run

python maskcvt_git.py