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
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
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