(self, skeleton)
return prediced_label
Predict the class (string) of the input raw skeleton
Predict the class (string) of the input raw skeleton
Predict the class ( string ) of the input raw skeleton
def predict(self, skeleton):
        ''' Predict the class (string) of the input raw skeleton '''
        LABEL_UNKNOWN = ""
        is_features_good, features = self.feature_generator.add_cur_skeleton(
            skeleton)

        if is_features_good:
            # convert to 2d array
            features = features.reshape(-1, features.shape[0])

            curr_scores = self.model._predict_proba(features)[0]
            self.scores = self.smooth_scores(curr_scores)

            if self.scores.max() < self.THRESHOLD_SCORE_FOR_DISP:  # If lower than threshold, bad
                prediced_label = LABEL_UNKNOWN
            else:
                predicted_idx = self.scores.argmax()
                prediced_label = self.action_labels[predicted_idx]
        else:
            prediced_label = LABEL_UNKNOWN
        return prediced_label
def predict ( self , skeleton ) : LABEL_UNKNOWN = "" is_features_good , features = self . feature_generator . add_cur_skeleton ( skeleton ) if is_features_good : # convert to 2d array features = features . reshape ( - 1 , features . shape [ 0 ] ) curr_scores = self . model . _predict_proba ( features ) [ 0 ] self . scores = self . smooth_scores ( curr_scores ) if self . scores . max ( ) < self . THRESHOLD_SCORE_FOR_DISP : # If lower than threshold, bad prediced_label = LABEL_UNKNOWN else : predicted_idx = self . scores . argmax ( ) prediced_label = self . action_labels [ predicted_idx ] else : prediced_label = LABEL_UNKNOWN return prediced_label