(self, curr_skels)
return self._dict_id2skeleton
Track the input skeletons by matching them with previous skeletons,
            and then obtain their corresponding human id. 
        Arguments:
            curr_skels {list of list}: each sub list is a person's skeleton.
        Returns:
            self._dict_id2skeleton {dict}:  a dict mapping human id to his/her skeleton.
Track the input skeletons by matching them with previous skeletons,
            and then obtain their corresponding human id. 
        Arguments:
            curr_skels {list of list}: each sub list is a person's skeleton.
        Returns:
            self._dict_id2skeleton {dict}:  a dict mapping human id to his/her skeleton.
Track the input skeletons by matching them with previous skeletons and then obtain their corresponding human id . Arguments : curr_skels { list of list } : each sub list is a person s skeleton . Returns : self . _dict_id2skeleton { dict } : a dict mapping human id to his / her skeleton .
def track(self, curr_skels):
        ''' Track the input skeletons by matching them with previous skeletons,
            and then obtain their corresponding human id. 
        Arguments:
            curr_skels {list of list}: each sub list is a person's skeleton.
        Returns:
            self._dict_id2skeleton {dict}:  a dict mapping human id to his/her skeleton.
        '''

        curr_skels = self._sort_skeletons_by_dist_to_center(curr_skels)
        N = len(curr_skels)

        # Match skeletons between curr and prev
        if len(self._dict_id2skeleton) > 0:
            ids, prev_skels = map(list, zip(*self._dict_id2skeleton.items()))
            good_matches = self._match_features(prev_skels, curr_skels)

            self._dict_id2skeleton = {}
            is_matched = [False]*N
            for i2, i1 in good_matches.items():
                human_id = ids[i1]
                self._dict_id2skeleton[human_id] = np.array(curr_skels[i2])
                is_matched[i2] = True
            unmatched_idx = [i for i, matched in enumerate(
                is_matched) if not matched]
        else:
            good_matches = []
            unmatched_idx = range(N)

        # Add unmatched skeletons (which are new skeletons) to the list
        num_humans_to_add = min(len(unmatched_idx),
                                self._max_humans - len(good_matches))
        for i in range(num_humans_to_add):
            self._cnt_humans += 1
            self._dict_id2skeleton[self._cnt_humans] = np.array(
                curr_skels[unmatched_idx[i]])

        return self._dict_id2skeleton
def track ( self , curr_skels ) : curr_skels = self . _sort_skeletons_by_dist_to_center ( curr_skels ) N = len ( curr_skels ) # Match skeletons between curr and prev if len ( self . _dict_id2skeleton ) > 0 : ids , prev_skels = map ( list , zip ( * self . _dict_id2skeleton . items ( ) ) ) good_matches = self . _match_features ( prev_skels , curr_skels ) self . _dict_id2skeleton = { } is_matched = [ False ] * N for i2 , i1 in good_matches . items ( ) : human_id = ids [ i1 ] self . _dict_id2skeleton [ human_id ] = np . array ( curr_skels [ i2 ] ) is_matched [ i2 ] = True unmatched_idx = [ i for i , matched in enumerate ( is_matched ) if not matched ] else : good_matches = [ ] unmatched_idx = range ( N ) # Add unmatched skeletons (which are new skeletons) to the list num_humans_to_add = min ( len ( unmatched_idx ) , self . _max_humans - len ( good_matches ) ) for i in range ( num_humans_to_add ) : self . _cnt_humans += 1 self . _dict_id2skeleton [ self . _cnt_humans ] = np . array ( curr_skels [ unmatched_idx [ i ] ] ) return self . _dict_id2skeleton