@@ -326,10 +326,15 @@ def plot_y_score(self, name: str, idx_list: list, dpi : int = 300) -> None:
326326 rows = 2
327327 figure = Figure (figsize = (max ([6 ,int (len (self .score_y )/ 50 )]), rows * 3 + 1 ), dpi = dpi )
328328 ax = figure .add_subplot (2 ,1 ,1 ) # Rows, Columns, Position
329- ax .plot (self .score_y [idx_list [0 ]:idx_list [- 1 ]])
329+ ax .title .set_text ('Motion in y direction' )
330+ # TODO why is there an offset of 1 in the data?
331+ ax .plot (self .score_y [max ((0 ,idx_list [0 ]- 1 )):idx_list [- 1 ]])
330332 ax .plot (idx_list , [self .score_y [idx ] for idx in idx_list ], 'o' )
333+ ax .legend (['Tracker Prediction' ,'Local Max and Min' ], loc = 'upper right' )
331334 ax = figure .add_subplot (2 ,1 ,2 )
335+ ax .title .set_text ('Funscript' )
332336 ax .plot (idx_list , [self .score_y [idx ] for idx in idx_list ])
337+ ax .plot (idx_list , [self .score_y [idx ] for idx in idx_list ], 'o' )
333338 figure .savefig (fname = name , dpi = dpi , bbox_inches = 'tight' )
334339
335340
@@ -551,7 +556,7 @@ def run(self) -> None:
551556 else :
552557 idx_list = sp .get_local_max_and_min_idx (self .score_x , self .fps )
553558
554- if False :
559+ if True :
555560 if self .params .direction != 'x' : self .plot_y_score ('debug_001.png' , idx_list )
556561 self .plot_scores ('debug_002.png' )
557562
0 commit comments