677467e2ae6a25911428540620b5e992cd64f482,src/predict/predict.py,Predictor,forward_pass,#Predictor#,54

Before Change


                imwrite(output_path, sr_img)

    def forward_pass(self, file_path):
        lr_img = imread(str(file_path)) / 255.0
        lr_img = np.expand_dims(lr_img, axis=0)
        sr_img = self.model.rdn.predict(lr_img)
        return np.clip(sr_img, 0, 1) * 255

After Change



    def forward_pass(self, file_path):
        lr_img = imread(file_path)
        if lr_img.shape[2] == 3:
            lr_img = lr_img / 255.0
            lr_img = np.expand_dims(lr_img, axis=0)
            sr_img = self.model.rdn.predict(lr_img)
            return np.clip(sr_img, 0, 1) * 255
        else:
            error(" {} is not an image with 3-dim.".format(file_path))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: idealo/image-super-resolution
Commit Name: 677467e2ae6a25911428540620b5e992cd64f482
Time: 2018-12-20
Author: testadicardi@gmail.com
File Name: src/predict/predict.py
Class Name: Predictor
Method Name: forward_pass


Project Name: DenisTome/Lifting-from-the-Deep-release
Commit Name: 70f229dde624412adb0bc466b4eee4929fcc1d91
Time: 2017-07-13
Author: dario.turchi@ocado.com
File Name: demo.py
Class Name:
Method Name:


Project Name: nilearn/nilearn
Commit Name: 9b9095f877f603d91495c72f91e4fddf61f1724e
Time: 2019-07-22
Author: jerome@dockes.org
File Name: examples/02_decoding/plot_haxby_stimuli.py
Class Name:
Method Name: