Last active
March 15, 2018 02:25
-
-
Save beeva-ricardoguerrero/c3f862b9be23511e5e809b258d4acbc9 to your computer and use it in GitHub Desktop.
How to load Pascal VOC 2012 Segmentation's ground truth in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def load_gt(gt_path, network_size): | |
""" | |
Load ground truth images with it's specific format. | |
VERY IMPORTANT TO LOAD GT THIS WAY. OTHERWISE THE VALUES WON'T BE CORRECT | |
To read more: | |
http://host.robots.ox.ac.uk/pascal/VOC/voc2012/segexamples/index.html | |
https://docs.scipy.org/doc/scipy-0.18.1/reference/generated/scipy.misc.imread.html | |
""" | |
im = scipy.misc.imread(image_path, mode='P') # Split indexes from palette | |
return im |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment