def classes_manyshot()

in datasets/epic_kitchens.py [0:0]


    def classes_manyshot(self) -> OrderedDict:
        """
        In EPIC-55, the recall computation was done for "many shot" classes,
        and not for all classes. So, for that version read the class names as
        provided by RULSTM.
        Function adapted from
        https://github.com/fpv-iplab/rulstm/blob/57842b27d6264318be2cb0beb9e2f8c2819ad9bc/RULSTM/main.py#L386
        """
        if self.version != EPIC55_VERSION:
            return super().classes_manyshot
        # read the list of many shot verbs
        many_shot_verbs = {
            el['verb']: el['verb_class']
            for el in pd.read_csv(self.annotation_dir /
                                  'EPIC_many_shot_verbs.csv').to_dict(
                                      'records')
        }
        # read the list of many shot nouns
        many_shot_nouns = {
            el['noun']: el['noun_class']
            for el in pd.read_csv(self.annotation_dir /
                                  'EPIC_many_shot_nouns.csv').to_dict(
                                      'records')
        }
        # create the list of many shot actions
        # an action is "many shot" if at least one
        # between the related verb and noun are many shot
        many_shot_actions = {}
        action_names = {val: key for key, val in self.action_classes.items()}
        for (verb_id, noun_id), action_id in self.verb_noun_to_action.items():
            if (verb_id in many_shot_verbs.values()) or (
                    noun_id in many_shot_nouns.values()):
                many_shot_actions[action_names[action_id]] = action_id
        return {
            'verb': many_shot_verbs,
            'noun': many_shot_nouns,
            'action': many_shot_actions,
        }