code: def get_all_mask_points_white_bg(masks_dir):
      mask_paths = sorted(utils.glob_imgs(masks_dir))
      mask_points_all = []
      mask_ims = []
      for path in mask_paths:
          img = mpimg.imread(path)
          cur_mask = img.max(axis=2) < 0.9
          mask_points = np.where(img.max(axis=2) < 0.9)
          xs = mask_points[1]
          ys = mask_points[0]
          mask_points_all.append(
              np.stack((xs, ys, np.ones_like(xs))).astype(float)
          )
          mask_ims.append(cur_mask)
      return mask_points_all, np.array(mask_ims)
  
file_path: insightface/reconstruction/PBIDR/code/preprocess/preprocess_cameras.py
imports: import numpy
  import matplotlib.image
  import matplotlib.pyplot
  import cv2
  import argparse
  from glob import glob
  import os
  import sys
  import pickle
  from scipy.spatial.transform import Rotation
  import utils.general
label_desc: Use image node_id 2 for calling a global function with example usage: get_all_mask_points_white_bg(masks_dir) and returns: mask_points_all,  np