Exemplo n.º 1
0
    jts = poseNet.computeOutput([test_data1, test_data12, test_data14])
    for i in xrange(test_data1.shape[0]):
        joints.append(jts[i].reshape(1, 3) *
                      (testSeqs[0].config['cube'][2] / 2.) +
                      testSeqs[0].data[i].com)

    gt3D.extend([j.gt3Dorig[13].reshape(1, 3) for j in testSeqs[1].data])
    jts = poseNet.computeOutput([test_data2, test_data22, test_data24])
    for i in range(test_data2.shape[0]):
        joints.append(jts[i].reshape(1, 3) *
                      (testSeqs[1].config['cube'][2] / 2.) +
                      testSeqs[1].data[i].com)

    hpe = NYUHandposeEvaluation(gt3D, joints)
    hpe.subfolder += '/' + eval_prefix + '/'
    mean_error = hpe.getMeanError()
    max_error = hpe.getMaxError()
    print("Mean error: {}mm, max error: {}mm".format(mean_error, max_error))

    # save results
    cPickle.dump(joints,
                 open(
                     "./eval/{}/result_{}_{}.pkl".format(
                         eval_prefix,
                         os.path.split(__file__)[1], eval_prefix), "wb"),
                 protocol=cPickle.HIGHEST_PROTOCOL)

    print "Testing baseline"

    #################################
    # BASELINE
Exemplo n.º 2
0
        test_data, _ = testDataSet.imgStackDepthOnly(seq.name)
        jts_embed = poseNet.computeOutput(test_data)
        # Backtransform from embedding
        # jts = pca.inverse_transform(jts_embed)
        jts = jts_embed
        for i in xrange(test_data.shape[0]):
            joints.append(jts[i].reshape((-1, 3)) *
                          (seq.config['cube'][2] / 2.) + seq.data[i].com)

    joints = numpy.array(joints)

    hpe = NYUHandposeEvaluation(gt3D, joints)
    hpe.subfolder += '/' + eval_prefix + '/'
    print("Train samples: {}, test samples: {}".format(train_data.shape[0],
                                                       len(gt3D)))
    print("Mean error: {}mm, max error: {}mm".format(hpe.getMeanError(),
                                                     hpe.getMaxError()))
    print("{}".format(
        [hpe.getJointMeanError(j) for j in range(joints[0].shape[0])]))
    print("{}".format(
        [hpe.getJointMaxError(j) for j in range(joints[0].shape[0])]))

    # save results
    cPickle.dump(joints,
                 open(
                     "./eval/{}/result_{}_{}.pkl".format(
                         eval_prefix,
                         os.path.split(__file__)[1], eval_prefix), "wb"),
                 protocol=cPickle.HIGHEST_PROTOCOL)

    print "Testing baseline"
Exemplo n.º 3
0
        hpe[-1].plotEvaluation('ablation',
                               methodName='Final',
                               baseline=plot_list[:-1])
    else:
        # plot list
        plot_list = []

        # Comparison
        # siggraph
        data_siggrpah = di.loadBaseline(
            '../dataset/NYU/test/test_predictions.mat', np.asarray(gt3D))

        hpe_siggrpah = NYUHandposeEvaluation(gt3D, data_siggrpah)
        hpe_siggrpah.subfolder += 'comparison/'
        print("Tompson et al. Siggraph 2014")
        print("Mean error: {}mm".format(hpe_siggrpah.getMeanError()))
        plot_list.append(('HeatMap', hpe_siggrpah))

        # cvww15 deeppriori
        data_deeppriori = di.loadBaseline(
            '../result/CVWW15/CVWW15_NYU_Prior-Refinement.txt')
        hpe_deeppriori = NYUHandposeEvaluation(gt3D, data_deeppriori)
        hpe_deeppriori.subfolder += 'comparison/'
        print("Oberweger et al. CVWW 2015")
        print("Mean error: {}mm".format(hpe_deeppriori.getMeanError()))
        plot_list.append(('DeepPrior', hpe_deeppriori))

        # iccv15 deep loopback
        data_loopback = di.loadBaseline(
            '../result/ICCV15/ICCV15_NYU_Feedback.txt')
        hpe_loopback = NYUHandposeEvaluation(gt3D, data_loopback)