Skip to content

Commit

Permalink
VCQ-156 extract QualityRunnerFromFeatureExtractor._create_result_dict.
Browse files Browse the repository at this point in the history
  • Loading branch information
li-zhi committed Aug 1, 2023
1 parent 7a1f14f commit a697068
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/vmaf/core/quality_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,17 @@ def _run_on_asset(self, asset):
vmaf_fassembler = self._get_feature_assembler_instance(asset)
vmaf_fassembler.run()
feature_result = vmaf_fassembler.results[0]
result_dict = self._create_result_dict(feature_result)
return Result(asset, self.executor_id, result_dict)

def _create_result_dict(self, feature_result):
result_dict = {}
result_dict.update(feature_result.result_dict.copy()) # add feature result
result_dict[self.get_scores_key()] = feature_result.result_dict[
self._get_feature_extractor_class().get_scores_key(self._get_feature_key_for_score())] # add score
del result_dict[self._get_feature_extractor_class().get_scores_key(self._get_feature_key_for_score())] # delete redundant
return Result(asset, self.executor_id, result_dict)
del result_dict[
self._get_feature_extractor_class().get_scores_key(self._get_feature_key_for_score())] # delete redundant
return result_dict

@override(Executor)
def _remove_result(self, asset):
Expand Down

0 comments on commit a697068

Please sign in to comment.