code: def read_3d(self, which="scale", mode="dt_ft"):
      if self.gt_trainset is None:
          self.gt_trainset = self.real_read("train")
      if self.gt_testset is None:
          self.gt_testset = self.real_read("test")
  
      # normalize
      train_labels = np.empty((len(self.gt_trainset), 17, 3))
      test_labels = np.empty((len(self.gt_testset), 17, 3))
      if which == "scale":
          # map to [-1, 1]
          for idx, item in enumerate(self.gt_trainset):
              camera_name = item["camera_param"]["name"]
              if camera_name == "54138969" or camera_name == "60457274":
                  res_w, res_h = 1000, 1002
              elif (
                  camera_name == "55011271" or camera_name == "58860488"
              ):
                  res_w, res_h = 1000, 1000
              else:
                  assert 0, (
                      "%d data item has an invalid camera name" % idx
                  )
              train_labels[idx, :, :2] = item["joint_3d_image"][
                  :, :2
              ] / res_w * 2 - [1, res_h / res_w]
              train_labels[idx, :, 2:] = (
                  item["joint_3d_image"][:, 2:] / res_w * 2
              )
          for idx, item in enumerate(self.gt_testset):
              camera_name = item["camera_param"]["name"]
              if camera_name == "54138969" or camera_name == "60457274":
                  res_w, res_h = 1000, 1002
              elif (
                  camera_name == "55011271" or camera_name == "58860488"
              ):
                  res_w, res_h = 1000, 1000
              else:
                  assert 0, (
                      "%d data item has an invalid camera name" % idx
                  )
              test_labels[idx, :, :2] = item["joint_3d_image"][
                  :, :2
              ] / res_w * 2 - [1, res_h / res_w]
              test_labels[idx, :, 2:] = (
                  item["joint_3d_image"][:, 2:] / res_w * 2
              )
      else:
          assert 0, "not support normalize type %s" % which
  
      # reshape
      train_labels, test_labels = train_labels.reshape(
          (-1, 17 * 3)
      ).astype(np.float32), test_labels.reshape((-1, 17 * 3)).astype(
          np.float32
      )
  
      return train_labels, test_labels
  
file_path: TensorLayer/tensorlayer/app/human_pose_estimation/common.py
imports: import tensorflow
  import numpy
  import pickle
  import matplotlib.pyplot
  import os
  import matplotlib.gridspec
label_desc: Use image node_id 4 for calling the DataReader obj's underlying member method code with example usage: obj.read_3d(which, mode) and returns: train_labels,  test_labels