code: def batch_post_process_disparity(l_disp, r_disp):
      """Apply the disparity post-processing method as introduced in Monodepthv1"""
      _, h, w = l_disp.shape
      m_disp = 0.5 * (l_disp + r_disp)
      l, _ = np.meshgrid(np.linspace(0, 1, w), np.linspace(0, 1, h))
      l_mask = (1.0 - np.clip(20 * (l - 0.05), 0, 1))[None, ...]
      r_mask = l_mask[:, :, ::-1]
      return (
          r_mask * l_disp
          + l_mask * r_disp
          + (1.0 - l_mask - r_mask) * m_disp
      )
  
file_path: gluon-cv/scripts/depth/test.py
imports: from __future__ import absolute_import, division, print_function
  import os
  import time
  from tqdm import tqdm
  import cv2
  import numpy
  import mxnet
  from mxnet import gluon
  from gluoncv.data import KITTIRAWDataset
  from gluoncv.data.kitti.kitti_utils import dict_batchify_fn, readlines
  from gluoncv.model_zoo import get_model
  from gluoncv.model_zoo.monodepthv2.layers import disp_to_depth, compute_depth_errors
  from options import MonodepthOptions
label_desc: Use image node_id 1 for calling a global function with example usage: batch_post_process_disparity(l_disp, r_disp) and returns: unknown