Skip to content

CvHadesSun/Human-Motion-Compare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Human-Motion-Compare

implement the human motion compare in serval seconds

Ready

  • transform the joints' order to defined order, which is show in the picture(in this rep, we use Blaze-pose to estimate the joints):12

joints

  • the defined angle is: (8 angles)

angles

  • for every motion,should define the weight of joints and angles in the comparation to value different importance

the shape is num_jointsx2, type is numpy,weight[:,0] is for 12 joints distance importance for one motion, and weight[:,1] is for 8 angles ,and end of weight[:,1] 4 elements are 0. there are in [0,1].

#example:
weight=np.array([
    [1,1],
    [1,1],
    [0.5,1],
    [0.5,1],
    [0.5,1],
    [0.5,1],
    [0.5,0.5],
    [0.5,1],
    [0.5,0],  #angle weight is 0
    [0.5,0],  #angle weight is 0
    [0.5,0],  #angle weight is 0
    [0.5,0]   #angle weight is 0
])   #the invisible joints's weight is small

The function's usage is in the utils.py

StandMotionPorcess(video_path,save_txt_path,mode='torso') #process the coach one motion, and mode parameter is for selecting root origin, there are 3 mode:'left_hip', 'right_hip' and 'torso'(default,detail is in the function note)

ProcessVideo(video_path,action_path,num_joints,frame_ratio,weight,mode='torso') #to process ordinary human motion in time, default num_joints=12, default frame_ratio is 30, and weight is defined by you. action_path is standard motion txt file path

Process (coach motion)

Process (student motion)

student motion

experiments

  • example video(contains 3 class motion)

example video

  • selected motion to be coach's motion(cut from the example video)

action video

  • results:(joints mean distance and angles mean distance) joints mean distance angles mean distance

Some new function

(add some new function into utils.py file, contains new joints normalization function,about scoring function.etc. you can use the parametersTrain.py to find the best parameters adapts human's experiments in motion scoring.)

  • new normalization function

joints norm

  • angles normalization

angles norm

  • score

distance error : angle error is propotion ,if overall score is 100.0:

scores

  • scoring funtion

funtion

picture of funtion

(we design the two group parameters for distance error and angle error.First, the dist_parameter: alpha is for error redundancy, it is maybe in [0,1], k controls speed of decent of curve, init value could assign 1, and by testing ,assign other suitable value. beta is to punish the relatively large error value. Second, the angle parameters: this error is in [0,pi],so you should assign the relatively small parameters for initialization)

Fix bug in utils.py:assignWeight

return return joints_scale+angle_score ---> return joints_score+angle_score

Add the distance feature into score function. (add another compare feature into score function)

  • pose2dist

dist

  • jointVoteWithDist

About

motion compare and scoring

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages