Exemplo n.º 1
0
    def add_to_report(self, report):
        # TODO: Later gather whole report for no opinions
        report.scores = gather_tensor(report.scores).view(-1, report.scores.size(-1))
        report.question_id = gather_tensor(report.question_id).view(-1)

        if not is_main_process():
            return

        results = self.current_dataset.format_for_evalai(report)

        self.report = self.report + results
Exemplo n.º 2
0
    def add_to_report(self, report):
        # TODO: Later gather whole report for no opinions
        if self.current_dataset._name == "coco":
            report.captions = gather_tensor(report.captions)
            if isinstance(report.image_id, torch.Tensor):
                report.image_id = gather_tensor(report.image_id).view(-1)
        else:
            report.scores = gather_tensor(report.scores).view(
                -1, report.scores.size(-1))
            report.question_id = gather_tensor(report.question_id).view(-1)

        if not is_main_process():
            return

        results = self.current_dataset.format_for_evalai(report)

        self.report = self.report + results