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","."]
code: def __init__(self, is_dlib=False, prefix="."):
      # resolution of input and output image size.
      self.resolution_inp = 256
      self.resolution_op = 256
  
      # ---- load detectors
      if is_dlib:
          import dlib
  
          detector_path = os.path.join(
              prefix, "Data/net-data/mmod_human_face_detector.dat"
          )
          self.face_detector = dlib.cnn_face_detection_model_v1(
              detector_path
          )
  
      # ---- load PRN
      params = paddle.load(
          os.path.join(prefix, "pd_model/model.pdparams")
      )
      self.pos_predictor = PosPrediction(
          params, self.resolution_inp, self.resolution_op
      )
  
      # uv file
      self.uv_kpt_ind = np.loadtxt(
          os.path.join(prefix, "Data/uv-data/uv_kpt_ind.txt")
      ).astype(
          np.int32
      )  # 2 x 68 get kpt
      self.face_ind = np.loadtxt(
          os.path.join(prefix, "Data/uv-data/face_ind.txt")
      ).astype(
          np.int32
      )  # get valid vertices in the pos map
      self.triangles = np.loadtxt(
          os.path.join(prefix, "Data/uv-data/triangles.txt")
      ).astype(
          np.int32
      )  # ntri x 3
  
      self.uv_coords = self.generate_uv_coords()
  
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 1 to create a new PRN object  with example: obj = PRN(is_dlib, prefix)