class_docstr: Joint 3D Face Reconstruction and Dense Alignment with Position Map Regression Network
  Args:
      is_dlib(bool, optional): If true, dlib is used for detecting faces.
      prefix(str, optional): If run at another folder, the absolute path is needed to load the data.
class_docstr_tok: ["Joint","3D","Face","Reconstruction","and","Dense","Alignment","with","Position","Map","Regression","Network","Args",":","is_dlib","(","bool",",","optional",")",":","If","true",",","dlib","is","used","for","detecting","faces",".","prefix","(","str",",","optional",")",":","If","run","at","another","folder",",","the","absolute","path","is","needed","to","load","the","data","."]
docstr: Args:
      pos: the 3D position map. shape = (256, 256, 3).
  Returns:
      colors: the corresponding colors of vertices. shape = (num of points, 3). n is 45128 here.
docstr_tok: ["Args",":","pos",":","the","3D","position","map",".","shape","=","(","256",",","256",",","3",")",".","Returns",":","colors",":","the","corresponding","colors","of","vertices",".","shape","=","(","num","of","points",",","3",")",".","n","is","45128","here","."]
code: def get_colors(self, image, vertices):
      """
      Args:
          pos: the 3D position map. shape = (256, 256, 3).
      Returns:
          colors: the corresponding colors of vertices. shape = (num of points, 3). n is 45128 here.
      """
      [h, w, _] = image.shape
      vertices[:, 0] = np.minimum(
          np.maximum(vertices[:, 0], 0), w - 1
      )  # x
      vertices[:, 1] = np.minimum(
          np.maximum(vertices[:, 1], 0), h - 1
      )  # y
      ind = np.round(vertices).astype(np.int32)
      colors = image[ind[:, 1], ind[:, 0], :]  # n x 3
  
      return colors
  
file_path: PaddleHub/modules/image/image_processing/prnet/api.py
imports: import os
  from time import time
  import numpy
  import paddle
  from skimage.io import imread
  from skimage.io import imsave
  from skimage.transform import estimate_transform
  from skimage.transform import warp
  from .predictor import PosPrediction
label_desc: Use image node_id 9 for calling the PRN obj's underlying member method code with example usage: obj.get_colors(image, vertices) and returns: colors