os.path.split(__file__)[1], eval_prefix), "wb"), protocol=cPickle.HIGHEST_PROTOCOL) print "Testing baseline" ################################# # BASELINE # Load the evaluation data_baseline = di.loadBaseline('../data/ICVL/LRF_Results_seq_1.txt') hpe_base = ICVLHandposeEvaluation(gt3D, data_baseline) hpe_base.subfolder += '/' + eval_prefix + '/' print("Mean error: {}mm".format(hpe_base.getMeanError())) hpe.plotEvaluation(eval_prefix, methodName='Our regr', baseline=[('Tang et al.', hpe_base)]) ind = 0 for i in testSeqs[0].data: if ind % 20 != 0: ind += 1 continue jt = joints[ind] jtI = di.joints3DToImg(jt) for joint in range(jt.shape[0]): t = transformPoint2D(jtI[joint], i.T) jtI[joint, 0] = t[0] jtI[joint, 1] = t[1] hpe.plotResult(i.dpt, i.gtcrop, jtI, "{}_{}".format(eval_prefix, ind)) ind += 1
print("{}".format([hpe[ind].getJointMeanError(j) for j in range(joints[0].shape[0])])) print("{}".format([hpe[ind].getJointMaxError(j) for j in range(joints[0].shape[0])])) print "Testing baseline" ################################# # BASELINE # Load the evaluation di = ICVLImporter('../dataset/ICVL/', cacheDir='../dataset/cache/') data_baseline = di.loadBaseline('../dataset/ICVL/Results/LRF_Results_seq_1.txt') hpe_base = ICVLHandposeEvaluation(gt3D, data_baseline) hpe_base.subfolder += eval_prefix[0]+'/' print("Mean error: {}mm".format(hpe_base.getMeanError())) plot_list = zip(model, hpe) hpe_base.plotEvaluation(eval_prefix[0], methodName='Tang et al.', baseline=plot_list) Seq2_1 = di.loadSequence('test_seq_1') Seq2_2 = di.loadSequence('test_seq_2') testSeqs = [Seq2_1, Seq2_2] for index in xrange(len(hpe)): ind = 0 for i in testSeqs[0].data: if ind % 20 != 0: ind += 1 continue jt = pred_joints[index][ind] jtI = di.joints3DToImg(jt) for joint in range(jt.shape[0]): t=transformPoint2D(jtI[joint], i.T)