code: def compute_errors(gt, pred, valid_mask):
      l1 = np.abs((gt - pred) * valid_mask)
      l2 = l1**2
  
      image_dim = (1, 2)
      denominator = np.count_nonzero(valid_mask, axis=image_dim)
      l1_mean = np.sum(l1, image_dim) / denominator
      rmse = np.sqrt(np.sum(l2, image_dim) / denominator)
  
      return dict(L1=l1_mean, RMSE=rmse)
  
file_path: ARKitScenes/depth_upsampling/logs/eval.py
imports: from collections import defaultdict
  import numpy
  import torch
  import dataset_keys
  import image_utils
  from data_utils import image_hwc_to_chw, image_chw_to_hwc, batch_to_cuda
label_desc: Use image node_id 1 for calling a global function with example usage: compute_errors(gt, pred, valid_mask) and returns: dict