Skip to content

Commit

Permalink
Make track object keep predictions of its actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalior committed Aug 27, 2018
1 parent 94b8ad5 commit e9bc1e3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions action_recognition/tracker/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def __init__(self):
self.track = []
self.frame_assigned = []
self.last_frame_update = -1
self.predictions = {}

def __len__(self):
return len(self.track)
Expand Down Expand Up @@ -416,3 +417,12 @@ def reset_keypoints(self):
"""
for person in self.track:
person.reset_keypoints()

def add_prediction(self, label, confidence, frame):
"""Adds a prediction to the track.
Predictions are stored as a dict with 'label' and 'confidence' with a
surrounding dict which connects the current frame to the prediction.
"""
self.predictions[frame] = {'label': label, 'confidence': confidence}

0 comments on commit e9bc1e3

Please sign in to comment.