code: def postprocess(
      self, outputs, visualization=False, output_dir="output"
  ):
      results = []
      if visualization and not os.path.exists(output_dir):
          os.mkdir(output_dir)
  
      for i in range(outputs.shape[0]):
          # normalization
          pred = 1.0 - outputs[i, 0, :, :]
  
          pred = self.normPRED(pred)
  
          # convert torch tensor to numpy array
          pred = pred.squeeze()
          pred = (pred * 255).astype(np.uint8)
  
          results.append(pred)
  
          if visualization:
              cv2.imwrite(
                  os.path.join(output_dir, "result_%d.png" % i), pred
              )
  
      return results
  
file_path: PaddleHub/modules/image/Image_gan/style_transfer/U2Net_Portrait/processor.py
imports: import os
  import cv2
  import numpy
  import paddlehub
label_desc: Use image node_id 5 for calling the Processor obj's underlying member method code with example usage: obj.postprocess(outputs, visualization, output_dir) and returns: results