Esempio n. 1
0
    final_vis_holdenTraj_holden_initTrans = vis_traj_holden_initTrans
    """ Select Speak to visualize """
    final_vis_speak = [vis_b2speak_speak[i] for i in selectedIdx]
    """ Select Face to visualize """
    #Final slection to draw a subset
    final_vis_faceData = [vis_faceData[i] for i in selectedIdx]

    if bVisualize == False:
        continue

    ####################################################################################
    # Visualization
    """ Visualize Location + Orientation """
    glViewer.setPosOnly(final_vis_posData)
    glViewer.setFaceNormal(final_vis_faceNormalData)
    glViewer.setBodyNormal(final_vis_bodyNormalData)
    """Visualize Trajectory"""
    #glViewer.set_Holden_Trajectory_3(final_vis_holdenTraj, initTrans=final_vis_holdenTraj_holden_initTrans, initRot=final_vis_holdenTraj_holden_initRot)   #pred
    """Visualize Body"""
    glViewer.set_Holden_Data_73(final_vis_bodyData,
                                ignore_root=False,
                                initRot=final_vis_body_initRot,
                                initTrans=final_vis_body_initTrans,
                                bIsGT=False)
    """Visualize Speech"""
    glViewer.setSpeech_binary(final_vis_speak)
    """Visualize face"""
    #glViewer.SetFaceParmData(vis_faceData,False)
    vis_f2face_trans, vis_f2face_rot = utility.ComputeHeadOrientation(
        glViewer.g_skeletons, final_vis_faceNormalData)
    glViewer.SetFaceParmDataWithTrans(final_vis_faceData, True,
Esempio n. 2
0
        print(turnChange)
        selectedFrames = []
        for f in turnChange:
            fStart = max(f - 90, 0)
            fEnd = min(f + 90, frameLeng - 1)
            selectedFrames += range(fStart, fEnd)

        for i in range(len(posData)):
            posData[i] = posData[i][:, selectedFrames]
            faceNormalData[i] = faceNormalData[i][:, selectedFrames]
            bodyNormalData[i] = bodyNormalData[i][:, selectedFrames]

        glViewer.resetFrameLimit()
        glViewer.setPosOnly(posData)
        glViewer.setFaceNormal(faceNormalData)
        glViewer.setBodyNormal(bodyNormalData)

        # glViewer.init_gl()

        # """Generate Trajectory in Holden's form by pos and body orientation"""
        # #traj_list, initTrans_list,initRot_list = ConvertTrajectory_velocityForm(posData,bodyNormalData)
        # traj_list, initTrans_list,initRot_list = ConvertTrajectory_velocityForm([posData[0]],[bodyNormalData[0]])
        # glViewer.set_Holden_Trajectory_3(traj_list, initTrans=initTrans_list, initRot=initRot_list)
        glViewer.init_gl()

        # traj_list_seq.append(np.array(traj_list))

acc_avg = float(accuracy_sum) / cnt_sum

print("acc_avg: {}".format(acc_avg))
Esempio n. 3
0
        # vis_posData = [vis_posData[1], vis_posData[2], vis_posData[3] ]
        # vis_faceNormalData = [vis_faceNormalData[1], vis_faceNormalData[2], vis_faceNormalData[3] ]
        # vis_bodyNormalData = [vis_bodyNormalData[1], vis_bodyNormalData[2], vis_bodyNormalData[3] ]

        #Pred trajectory + inputBuyer, inputSeller
        vis_posData = [vis_posData[0], vis_posData[2], vis_posData[3] ]
        vis_faceNormalData = [vis_faceNormalData[0], vis_faceNormalData[2], vis_faceNormalData[3] ]
        vis_bodyNormalData = [vis_bodyNormalData[0], vis_bodyNormalData[2], vis_bodyNormalData[3] ]

        if bVisualize==False:
            continue

        """ Visualize Location + Orientation """
        glViewer.setPosOnly(vis_posData)
        glViewer.setFaceNormal(vis_faceNormalData)
        glViewer.setBodyNormal(vis_bodyNormalData)
        
        """Visualize Trajectory"""
        glViewer.set_Holden_Trajectory_3(traj_list_holdenForm, initTrans=pred_initTrans_list, initRot=pred_initRot_list)   #pred
        #glViewer.set_Holden_Trajectory_3(gt_traj_list_holdenForm, initTrans=gt_initTrans_list, initRot=gt_initRot_list)   #GT
        #glViewer.set_Holden_Trajectory_3([ bodyData[0][-7:-4,:], bodyData[1][-7:-4,:], bodyData[2][-7:-4,:] ], initRot=initRot, initTrans= initTrans)

        """Visualize Body"""
        #glViewer.set_Holden_Data_73([output_body_np],initTrans=initTrans_list,initRot=initRot_list)
        glViewer.set_Holden_Data_73(vis_bodyData, ignore_root=False, initRot=vis_bodyGT_initRot, initTrans= vis_bodyGT_initTrans, bIsGT=False)
        #glViewer.set_Holden_Data_73(vis_bodyData, ignore_root=False, initRot=vis_bodyGT_initRot, initTrans= vis_bodyGT_initTrans, bIsGT=True)

        """Visualize Speech"""
        glViewer.setSpeech_binary( vis_speech )
        
        """Render output to videos"""