MCPcopy Create free account
hub / github.com/NVIDIA/semantic-segmentation / tensor_to_pil

Function tensor_to_pil

utils/misc.py:88–98  ·  view source on GitHub ↗
(img)

Source from the content-addressed store, hash-verified

86
87
88def tensor_to_pil(img):
89 inv_mean = [-mean / std for mean, std in zip(cfg.DATASET.MEAN,
90 cfg.DATASET.STD)]
91 inv_std = [1 / std for std in cfg.DATASET.STD]
92 inv_normalize = standard_transforms.Normalize(
93 mean=inv_mean, std=inv_std
94 )
95 img = inv_normalize(img)
96 img = img.cpu()
97 img = standard_transforms.ToPILImage()(img).convert('RGB')
98 return img
99
100
101def eval_metrics(iou_acc, args, net, optim, val_loss, epoch, mf_score=None):

Callers 1

dump_imagesMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected