def _generate_result(self, asset): # routine to call the command-line executable and generate quality # scores in the log file. ref_workfile_path = asset.ref_workfile_path dis_workfile_path = asset.dis_workfile_path log_file_path = self._get_log_file_path(asset) current_dir = os.getcwd() + '/' ref_workfile_path = make_absolute_path(ref_workfile_path, current_dir) dis_workfile_path = make_absolute_path(dis_workfile_path, current_dir) log_file_path = make_absolute_path(log_file_path, current_dir) quality_width, quality_height = asset.quality_width_height strred_cmd = '''{matlab} -nodisplay -nosplash -nodesktop -r "run_strred('{ref}', '{dis}', {h}, {w}); exit;" >> {log_file_path}'''.format( matlab=VmafExternalConfig.get_and_assert_matlab(), ref=ref_workfile_path, dis=dis_workfile_path, w=quality_width, h=quality_height, log_file_path=log_file_path, ) if self.logger: self.logger.info(strred_cmd) os.chdir(self.MATLAB_WORKSPACE) run_process(strred_cmd, shell=True) os.chdir(current_dir)
def _generate_result(self, asset): # routine to call the command-line executable and generate quality # scores in the log file. ref_workfile_path = asset.ref_workfile_path dis_workfile_path = asset.dis_workfile_path log_file_path = self._get_log_file_path(asset) current_dir = os.getcwd() + '/' ref_workfile_path = make_absolute_path(ref_workfile_path, current_dir) dis_workfile_path = make_absolute_path(dis_workfile_path, current_dir) log_file_path = make_absolute_path(log_file_path, current_dir) quality_width, quality_height = asset.quality_width_height strred_cmd = '''{matlab} -nodisplay -nosplash -nodesktop -r "run_strred('{ref}', '{dis}', {h}, {w}); exit;" >> {log_file_path}'''.format( matlab=VmafExternalConfig.get_and_assert_matlab(), ref=ref_workfile_path, dis=dis_workfile_path, w=quality_width, h=quality_height, log_file_path=log_file_path, ) if self.logger: self.logger.info(strred_cmd) os.chdir(self.MATLAB_WORKSPACE) run_process(strred_cmd, shell=True) os.chdir(current_dir)