예제 #1
0
 def __init__(self, shape, mean=pr.BGR_IMAGENET_MEAN):
     super(PreprocessImage, self).__init__()
     self.add(pr.ResizeImage(shape))
     self.add(pr.CastImage(float))
     if mean is None:
         self.add(pr.NormalizeImage())
     else:
         self.add(pr.SubtractMeanImage(mean))
예제 #2
0
파일: pipelines.py 프로젝트: najy97/paz
 def __init__(self, model, colors=None):
     super(PostprocessSegmentation, self).__init__()
     self.add(PreprocessImage())
     self.add(pr.ExpandDims(0))
     self.add(pr.Predict(model))
     self.add(pr.Squeeze(0))
     self.add(Round())
     self.add(MasksToColors(model.output_shape[-1], colors))
     self.add(pr.DenormalizeImage())
     self.add(pr.CastImage('uint8'))
     self.add(pr.ShowImage())
예제 #3
0
파일: demo.py 프로젝트: niqbal996/paz
 def __init__(self, model, colors=None):
     super(PostprocessSegmentation, self).__init__()
     self.add(pr.UnpackDictionary(['image_path']))
     self.add(pr.LoadImage())
     self.add(pr.ResizeImage(model.input_shape[1:3]))
     self.add(pr.ConvertColorSpace(pr.RGB2BGR))
     self.add(pr.SubtractMeanImage(pr.BGR_IMAGENET_MEAN))
     self.add(pr.ExpandDims(0))
     self.add(pr.Predict(model))
     self.add(pr.Squeeze(0))
     self.add(Round())
     self.add(MasksToColors(model.output_shape[-1], colors))
     self.add(pr.DenormalizeImage())
     self.add(pr.CastImage('uint8'))
     self.add(pr.ShowImage())
예제 #4
0
파일: pipelines.py 프로젝트: oarriaga/paz
 def __init__(self, shape=(48, 48)):
     self.shape = shape
     super(PostrocessEigenFace, self).__init__()
     self.add(pe.MinMaxNormalization(255.0))
     self.add(pe.Reshape(shape))
     self.add(pr.CastImage('uint8'))
예제 #5
0
 def __init__(self):
     super(PostProcessImage, self).__init__()
     self.add(pr.AddMeanImage(pr.BGR_IMAGENET_MEAN))
     self.add(pr.CastImage('uint8'))
     self.add(pr.ConvertColorSpace(pr.BGR2RGB))
예제 #6
0
 def __init__(self, num_classes, colors=None):
     super(PostprocessSegmentationIds, self).__init__()
     self.add(MasksToColors(num_classes, colors))
     self.add(pr.DenormalizeImage())
     self.add(pr.CastImage('uint8'))