def getPCL(self, dpt, T):
        """
        Get pointcloud from frame
        :param dpt: depth image
        :param T: 2D transformation of crop
        """

        return Blender2Importer.depthToPCL(dpt, T)
Exemplo n.º 2
0
    def __init__(self, imgSeqs=None, basepath=None, localCache=True):
        """
        constructor
        """
        super(Blender2Dataset, self).__init__(imgSeqs, localCache)
        if basepath is None:
            basepath = '../../data/Blender/'

        self.lmi = Blender2Importer(basepath)
    if start_idx is None:
        print(
            'Start frame index can be specified: -s <start_idx> or enter now:')
        start_idx = input().lower()
        if len(start_idx.strip()) == 0:
            start_idx = 0
        else:
            start_idx = int(start_idx)
    else:
        print('Start frame index is {}'.format(start_idx))

    rng = numpy.random.RandomState(23455)

    if person == 'hpseq_loop_mv':
        di = Blender2Importer('../data/Blender/', useCache=False)
        Seq2 = di.loadSequence(person, camera=0, shuffle=False)
        hpe = Blender2HandposeEvaluation([j.gt3Dorig for j in Seq2.data],
                                         [j.gt3Dorig for j in Seq2.data])
        for idx, seq in enumerate(Seq2.data):
            Seq2.data[idx] = seq._replace(com=numpy.zeros((3, )))
    else:
        raise NotImplementedError("")

    # we need to detect all files
    subset_idxs = []

    output_path = di.basepath

    filename_dets = output_path + person + '/detections_' + username + '.txt'
    filename_log = output_path + person + '/detecttool_log_' + username + '.txt'
from data.transformations import transformPoint2D
from data.importers import Blender2Importer
from data.dataset import Blender2Dataset
from util.handpose_evaluation import Blender2HandposeEvaluation

if __name__ == '__main__':

    eval_prefix = 'BLEN_SA'
    if not os.path.exists('./eval/' + eval_prefix + '/'):
        os.makedirs('./eval/' + eval_prefix + '/')

    rng = numpy.random.RandomState(23455)

    print("create data")

    di = Blender2Importer('../data/Blender/')
    Seq1_0 = di.loadSequence('hpseq_loop_mv', camera=0, shuffle=False)
    trainSeqs = [Seq1_0]

    # create training data
    trainDataSet = Blender2Dataset(trainSeqs)
    dat = []
    gt = []
    for seq in trainSeqs:
        d, g = trainDataSet.imgStackDepthOnly(seq.name)
        dat.append(d)
        gt.append(g)
    train_data = numpy.concatenate(dat)
    train_gt3D = numpy.concatenate(gt)

    mb = (train_data.nbytes) / (1024 * 1024)