Skip to content

Commit

Permalink
Merge branch 'fabiofelix:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiofelix authored Nov 16, 2024
2 parents 7ba0bef + 0421da1 commit 0a2d0f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions step_recog/full/statemachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def smooth_probs(self, probabilities, type = SmoothType.MEDIAN):
for pb in probs[1:]:
move_avg[step] = self.ema_alpha * pb + (1 - self.ema_alpha) * move_avg[step]

#forces sum(move_avg) = 1.0
move_avg = move_avg / np.sum(move_avg)
max_prob = np.max(move_avg)
max_indices = np.where(move_avg == max_prob)[0]

Expand Down
3 changes: 1 addition & 2 deletions step_recog/full/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ def main(video_path, output_path='output.mp4', cfg_file=""):
psm.process_timestep(prob_step)
step_idx = np.argmax(prob_step)
step_desc = "No step" if step_idx >= len(model.STEPS) else model.STEPS[step_idx]

pbar.set_description(" ".join(f"{x:.0%}" for x in prob_step) + " | " + " ".join(f'{x}' for x in psm.current_state))
pbar.set_description(" ".join(f"{x:.0%}" for x in prob_step) + " | " + " ".join(f'{x}' for x in psm.current_state))

# draw the prediction (could be your bar chart) on the frame
plot_graph(frame, prob_step, step_desc, psm.current_state[:-1])
Expand Down

0 comments on commit 0a2d0f8

Please sign in to comment.