(self, filename, gt=None)
Load baseline data
        :param filename: file name of data
        :return: list with joint coordinates
Load baseline data
        :param filename: file name of data
        :return: list with joint coordinates
Load baseline data : param filename : file name of data : return : list with joint coordinates
def loadBaseline(self, filename, gt=None):
        """
        Load baseline data
        :param filename: file name of data
        :return: list with joint coordinates
        """

        if gt is not None:
            mat = scipy.io.loadmat(filename)
            names = mat['conv_joint_names'][0]
            joints = mat['pred_joint_uvconf'][0]

            self.numJoints = names.shape[0]

            data = []
            for dat in range(min(joints.shape[0], gt.shape[0])):
                fname = '{0:s}/depth_1_{1:07d}.png'.format(os.path.split(filename)[0], dat+1)
                if not os.path.isfile(fname):
                    continue
                dm = self.loadDepthMap(fname)
                # joints in image coordinates
                ev = np.zeros((self.numJoints, 3), np.float32)
                jt = 0
                for i in range(joints.shape[1]):
                    if np.count_nonzero(joints[dat, i, :]) == 0:
                        continue
                    ev[jt, 0] = joints[dat, i, 0]
                    ev[jt, 1] = joints[dat, i, 1]
                    ev[jt, 2] = dm[int(ev[jt, 1]), int(ev[jt, 0])]
                    jt += 1

                for jt in range(ev.shape[0]):
                    #if ev[jt,2] == 2001. or ev[jt,2] == 0.:
                    if abs(ev[jt, 2] - gt[dat, 13, 2]) > 150.:
                        ev[jt, 2] = gt[dat, jt, 2]#np.clip(ev[jt,2],gt[dat,13,2]-150.,gt[dat,13,2]+150.) # set to groundtruth if unknown

                ev3D = self.jointsImgTo3D(ev)
                data.append(ev3D)

            return data
        else:

            def nonblank_lines(f):
                for l in f:
                    line = l.rstrip()
                    if line:
                        yield line

            inputfile = open(filename)
            # first line specifies the number of 3D joints
            self.numJoints = len(inputfile.readline().split(' ')) / 3
            inputfile.seek(0)

            data = []
            for line in nonblank_lines(inputfile):
                part = line.split(' ')
                # joints in image coordinates
                ev = np.zeros((self.numJoints, 3), np.float32)
                for joint in range(ev.shape[0]):
                    for xyz in range(0, 3):
                        ev[joint, xyz] = part[joint*3+xyz]

                gt3Dworld = self.jointsImgTo3D(ev)

                data.append(gt3Dworld)

            return data
def loadBaseline ( self , filename , gt = None ) : if gt is not None : mat = scipy . io . loadmat ( filename ) names = mat [ 'conv_joint_names' ] [ 0 ] joints = mat [ 'pred_joint_uvconf' ] [ 0 ] self . numJoints = names . shape [ 0 ] data = [ ] for dat in range ( min ( joints . shape [ 0 ] , gt . shape [ 0 ] ) ) : fname = '{0:s}/depth_1_{1:07d}.png' . format ( os . path . split ( filename ) [ 0 ] , dat + 1 ) if not os . path . isfile ( fname ) : continue dm = self . loadDepthMap ( fname ) # joints in image coordinates ev = np . zeros ( ( self . numJoints , 3 ) , np . float32 ) jt = 0 for i in range ( joints . shape [ 1 ] ) : if np . count_nonzero ( joints [ dat , i , : ] ) == 0 : continue ev [ jt , 0 ] = joints [ dat , i , 0 ] ev [ jt , 1 ] = joints [ dat , i , 1 ] ev [ jt , 2 ] = dm [ int ( ev [ jt , 1 ] ) , int ( ev [ jt , 0 ] ) ] jt += 1 for jt in range ( ev . shape [ 0 ] ) : #if ev[jt,2] == 2001. or ev[jt,2] == 0.: if abs ( ev [ jt , 2 ] - gt [ dat , 13 , 2 ] ) > 150. : ev [ jt , 2 ] = gt [ dat , jt , 2 ] #np.clip(ev[jt,2],gt[dat,13,2]-150.,gt[dat,13,2]+150.) # set to groundtruth if unknown ev3D = self . jointsImgTo3D ( ev ) data . append ( ev3D ) return data else : def nonblank_lines ( f ) : for l in f : line = l . rstrip ( ) if line : yield line inputfile = open ( filename ) # first line specifies the number of 3D joints self . numJoints = len ( inputfile . readline ( ) . split ( ' ' ) ) / 3 inputfile . seek ( 0 ) data = [ ] for line in nonblank_lines ( inputfile ) : part = line . split ( ' ' ) # joints in image coordinates ev = np . zeros ( ( self . numJoints , 3 ) , np . float32 ) for joint in range ( ev . shape [ 0 ] ) : for xyz in range ( 0 , 3 ) : ev [ joint , xyz ] = part [ joint * 3 + xyz ] gt3Dworld = self . jointsImgTo3D ( ev ) data . append ( gt3Dworld ) return data