Imported from https://github.com/CSAILVision/semantic-segmentation-pytorch