Exemple #1
0
    def clipping(self, imgs):

        imgs = reverse_preprocess(imgs, self.intensity_range)
        imgs = np.clip(imgs, 0, self.max_val)
        imgs = preprocess(imgs, self.intensity_range)

        return imgs
Exemple #2
0
 def preprocess_arctanh(self, imgs):
     """ Do tan preprocess """
     imgs = reverse_preprocess(imgs, self.intensity_range)
     imgs = imgs / 255.0
     imgs = imgs - 0.5
     imgs = imgs * self.tanh_constant
     tanh_imgs = np.arctanh(imgs)
     return tanh_imgs
Exemple #3
0
    def preprocess_arctanh(self, imgs):

        imgs = reverse_preprocess(imgs, self.intensity_range)
        imgs /= 255.0
        imgs -= 0.5
        imgs *= self.tanh_constant
        tanh_imgs = np.arctanh(imgs)

        return tanh_imgs