Example #1
0
    def get_path(self):
        truth_path = []
        curstate = 0
        costs = np.zeros((self.frame_count, self.score.state_count()))

        for t in range(0, self.frame_count):
            notes = self.get_notes(t*self.frame_duration)
            for i in range(0, self.score.state_count()):
                state_notes = self.score.states[i].notes
                if notes == state_notes:
                    costs[t,i] = 10
                else:
                    costs[t, i] =  1-float(len(notes.intersection(state_notes))) / len(notes.union(state_notes))
        
        truth_path = path.factory("dtw").calculate(costs, self.score)
        return truth_path
Example #2
0
 def __init__(self, lik_method, path_method):
     self.likproc = likelihood.factory(lik_method)
     self.pathproc = path.factory(path_method)
     self.lik_method = lik_method
     self.path_method = path_method
Example #3
0
 def __init__(self, lik_method, path_method):
     self.likproc = likelihood.factory(lik_method)
     self.pathproc = path.factory(path_method)
     self.lik_method = lik_method
     self.path_method = path_method