Пример #1
0
    def _generate_result(self, asset):
        # routine to call the command-line executable and generate feature
        # scores in the log file.

        quality_width, quality_height = asset.quality_width_height
        log_file_path = self._get_log_file_path(asset)

        yuv_type = self._get_workfile_yuv_type(asset)
        ref_path = asset.ref_procfile_path
        dis_path = asset.dis_procfile_path
        w = quality_width
        h = quality_height
        logger = self.logger

        ExternalProgramCaller.call_vmafexec_multi_features(
            ['float_adm', 'float_vif', 'float_motion', 'float_ansnr'],
            yuv_type,
            ref_path,
            dis_path,
            w,
            h,
            log_file_path,
            logger,
            options={
                'float_adm': {
                    'debug': True
                },
                'float_vif': {
                    'debug': True
                },
                'float_motion': {
                    'debug': True
                },
            })
Пример #2
0
    def _generate_result(self, asset):

        quality_width, quality_height = asset.quality_width_height
        log_file_path = self._get_log_file_path(asset)

        yuv_type = self._get_workfile_yuv_type(asset)
        ref_path = asset.ref_procfile_path
        dis_path = asset.dis_procfile_path
        w = quality_width
        h = quality_height
        logger = self.logger

        ExternalProgramCaller.call_vmafexec_multi_features(
            ['adm', 'vif', 'motion', 'float_ansnr'],
            yuv_type,
            ref_path,
            dis_path,
            w,
            h,
            log_file_path,
            logger,
            options={
                'adm': {
                    'debug': True
                },
                'vif': {
                    'debug': True
                },
                'motion': {
                    'debug': True
                },
            })
Пример #3
0
    def _generate_result(self, asset):
        # routine to call the command-line executable and generate quality
        # scores in the log file.

        quality_width, quality_height = asset.quality_width_height
        assert asset.dis_encode_width_height is not None, \
            'For Cambi, dis_encode_width_height cannot be None. One can specify dis_encode_width_height by adding ' \
            'the following fields to asset_dict: 1) dis_enc_width and dis_enc_height, or 2) dis_width and ' \
            'dis_height, or 3) width and height.'
        encode_width, encode_height = asset.dis_encode_width_height

        if encode_width != quality_width or encode_height != quality_height:
            # hacky: unintended consequence of modifying the input. TODO: improve.
            if self.optional_dict is None:
                self.optional_dict = dict()
            self.optional_dict['enc_width'] = encode_width
            self.optional_dict['enc_height'] = encode_height

        log_file_path = self._get_log_file_path(asset)

        yuv_type = self._get_workfile_yuv_type(asset)
        ref_path = asset.ref_procfile_path
        dis_path = asset.dis_procfile_path
        logger = self.logger

        ExternalProgramCaller.call_vmafexec_single_feature(
            'cambi',
            yuv_type,
            ref_path,
            dis_path,
            quality_width,
            quality_height,
            log_file_path,
            logger,
            options=self.optional_dict)
Пример #4
0
    def _generate_result(self, asset):
        # routine to call the command-line executable and generate quality
        # scores in the log file.

        quality_width, quality_height = asset.quality_width_height
        encode_width, encode_height = asset.dis_encode_width_height

        if encode_width != quality_width or encode_height != quality_height:
            self.optional_dict['enc_width'] = encode_width
            self.optional_dict['enc_height'] = encode_height

        log_file_path = self._get_log_file_path(asset)

        yuv_type = self._get_workfile_yuv_type(asset)
        ref_path = asset.ref_procfile_path
        dis_path = asset.dis_procfile_path
        logger = self.logger

        ExternalProgramCaller.call_vmafexec_single_feature(
            'cambi',
            yuv_type,
            ref_path,
            dis_path,
            quality_width,
            quality_height,
            log_file_path,
            logger,
            options=self.optional_dict)
Пример #5
0
    def _generate_result(self, asset):
        # routine to call the command-line executable and generate quality
        # scores in the log file.

        log_file_path = self._get_log_file_path(asset)

        if self.optional_dict is not None \
                and 'model_filepath' in self.optional_dict \
                and self.optional_dict['model_filepath'] is not None:
            model_filepath = self.optional_dict['model_filepath']
        else:
            model_filepath = self.DEFAULT_MODEL_FILEPATH

        if self.optional_dict is not None and 'disable_clip_score' in self.optional_dict:
            disable_clip_score = self.optional_dict['disable_clip_score']
        else:
            disable_clip_score = False

        if self.optional_dict is not None and 'enable_transform_score' in self.optional_dict:
            enable_transform_score = self.optional_dict[
                'enable_transform_score']
        else:
            enable_transform_score = False

        if self.optional_dict is not None and 'phone_model' in self.optional_dict:
            phone_model = self.optional_dict['phone_model']
        else:
            phone_model = False

        if self.optional_dict is not None and 'disable_avx' in self.optional_dict:
            disable_avx = self.optional_dict['disable_avx']
        else:
            disable_avx = False

        if self.optional_dict is not None and 'thread' in self.optional_dict:
            n_thread = self.optional_dict['thread']
        else:
            n_thread = 0

        if self.optional_dict is not None and 'subsample' in self.optional_dict:
            n_subsample = self.optional_dict['subsample']
        else:
            n_subsample = 1

        quality_width, quality_height = asset.quality_width_height

        fmt = self._get_workfile_yuv_type(asset)
        w = quality_width
        h = quality_height
        ref_path = asset.ref_workfile_path
        dis_path = asset.dis_workfile_path
        model = model_filepath
        exe = self._get_exec()
        logger = self.logger

        ExternalProgramCaller.call_vmafossexec(
            fmt, w, h, ref_path, dis_path, model, log_file_path,
            disable_clip_score, enable_transform_score, phone_model,
            disable_avx, n_thread, n_subsample, exe, logger)
Пример #6
0
    def _generate_result(self, asset):

        quality_width, quality_height = asset.quality_width_height
        log_file_path = self._get_log_file_path(asset)

        yuv_type = self._get_workfile_yuv_type(asset)
        ref_path = asset.ref_procfile_path
        dis_path = asset.dis_procfile_path
        w = quality_width
        h = quality_height
        logger = self.logger

        features = ['adm', 'vif', 'motion', 'float_ansnr']
        options = {
            'adm': {
                'debug': True
            },
            'vif': {
                'debug': True
            },
            'motion': {
                'debug': True
            },
        }

        if self.optional_dict is not None:
            for opt in self.optional_dict:
                if opt == 'vif_enhn_gain_limit':
                    options['vif']['vif_enhn_gain_limit'] = self.optional_dict[
                        'vif_enhn_gain_limit']
                elif opt == 'adm_enhn_gain_limit':
                    options['adm']['adm_enhn_gain_limit'] = self.optional_dict[
                        'adm_enhn_gain_limit']
                elif opt == 'adm_norm_view_dist':
                    options['adm']['adm_norm_view_dist'] = self.optional_dict[
                        'adm_norm_view_dist']
                elif opt == 'adm_ref_display_height':
                    options['adm'][
                        'adm_ref_display_height'] = self.optional_dict[
                            'adm_ref_display_height']
                elif opt == 'motion_force_zero':
                    options['motion'][
                        'motion_force_zero'] = self.optional_dict[
                            'motion_force_zero']
                else:
                    pass

        ExternalProgramCaller.call_vmafexec_multi_features(features,
                                                           yuv_type,
                                                           ref_path,
                                                           dis_path,
                                                           w,
                                                           h,
                                                           log_file_path,
                                                           logger,
                                                           options=options)
Пример #7
0
    def _generate_result(self, asset):
        # routine to call the command-line executable and generate quality
        # scores in the log file.

        quality_width, quality_height = asset.quality_width_height
        log_file_path = self._get_log_file_path(asset)

        yuv_type=self._get_workfile_yuv_type(asset)
        ref_path=asset.ref_workfile_path
        dis_path=asset.dis_workfile_path
        w=quality_width
        h=quality_height
        logger = self.logger

        ExternalProgramCaller.call_ms_ssim(yuv_type, ref_path, dis_path, w, h, log_file_path, logger)
Пример #8
0
    def _generate_result(self, asset):
        # routine to call the command-line executable and generate quality
        # scores in the log file.

        quality_width, quality_height = asset.quality_width_height
        log_file_path = self._get_log_file_path(asset)

        yuv_type=self._get_workfile_yuv_type(asset)
        ref_path=asset.ref_workfile_path
        dis_path=asset.dis_workfile_path
        w=quality_width
        h=quality_height
        logger = self.logger

        ExternalProgramCaller.call_ms_ssim(yuv_type, ref_path, dis_path, w, h, log_file_path, logger)
Пример #9
0
    def _generate_result(self, asset):
        # routine to call the command-line executable and generate quality
        # scores in the log file.

        quality_width, quality_height = asset.quality_width_height
        log_file_path = self._get_log_file_path(asset)

        yuv_type=self._get_workfile_yuv_type(asset)
        ref_path=asset.ref_procfile_path
        dis_path=asset.dis_procfile_path
        w=quality_width
        h=quality_height
        logger = self.logger

        ExternalProgramCaller.call_vmafrc_single_feature('float_ms_ssim', yuv_type, ref_path, dis_path, w, h,
                                                         log_file_path, logger, options={'enable_lcs': True})
Пример #10
0
    def _generate_result(self, asset):
        # routine to call the command-line executable and generate quality
        # scores in the log file.

        log_file_path = self._get_log_file_path(asset)

        if self.optional_dict is not None \
                and 'model_filepath' in self.optional_dict \
                and self.optional_dict['model_filepath'] is not None:
            model_filepath = self.optional_dict['model_filepath']
        else:
            model_filepath = self.DEFAULT_MODEL_FILEPATH

        if self.optional_dict is not None and 'disable_clip_score' in self.optional_dict:
            disable_clip_score = self.optional_dict['disable_clip_score']
        else:
            disable_clip_score = False

        if self.optional_dict is not None and 'enable_transform_score' in self.optional_dict:
            enable_transform_score = self.optional_dict['enable_transform_score']
        else:
            enable_transform_score = False

        if self.optional_dict is not None and 'phone_model' in self.optional_dict:
            phone_model = self.optional_dict['phone_model']
        else:
            phone_model = False

        if self.optional_dict is not None and 'disable_avx' in self.optional_dict:
            disable_avx = self.optional_dict['disable_avx']
        else:
            disable_avx = False

        quality_width, quality_height = asset.quality_width_height

        fmt=self._get_workfile_yuv_type(asset)
        w=quality_width
        h=quality_height
        ref_path=asset.ref_workfile_path
        dis_path=asset.dis_workfile_path
        model=model_filepath
        exe=self._get_exec()
        logger = self.logger

        ExternalProgramCaller.call_vmafossexec(fmt, w, h, ref_path, dis_path, model, log_file_path,
                                               disable_clip_score, enable_transform_score,
                                               phone_model, disable_avx, exe, logger)
Пример #11
0
    def _generate_result(self, asset):
        # routine to call the command-line executable and generate feature
        # scores in the log file.

        quality_width, quality_height = asset.quality_width_height
        log_file_path = self._get_log_file_path(asset)

        yuv_type = self._get_workfile_yuv_type(asset)
        ref_path = asset.ref_procfile_path
        dis_path = asset.dis_procfile_path
        w = quality_width
        h = quality_height
        logger = self.logger

        features = ['float_adm', 'float_vif', 'float_motion', 'float_ansnr']
        options = {
            'float_adm': {
                'debug': True
            },
            'float_vif': {
                'debug': True
            },
            'float_motion': {
                'debug': True
            },
        }

        if self.optional_dict is not None:
            for opt in self.optional_dict:
                if opt == 'vif_enhn_gain_limit':
                    options['float_vif'][
                        'vif_enhn_gain_limit'] = self.optional_dict[
                            'vif_enhn_gain_limit']
                elif opt == 'vif_kernelscale':
                    options['float_vif'][
                        'vif_kernelscale'] = self.optional_dict[
                            'vif_kernelscale']
                elif opt == 'adm_enhn_gain_limit':
                    options['float_adm'][
                        'adm_enhn_gain_limit'] = self.optional_dict[
                            'adm_enhn_gain_limit']
                elif opt == 'adm_norm_view_dist':
                    options['float_adm'][
                        'adm_norm_view_dist'] = self.optional_dict[
                            'adm_norm_view_dist']
                elif opt == 'adm_ref_display_height':
                    options['float_adm'][
                        'adm_ref_display_height'] = self.optional_dict[
                            'adm_ref_display_height']
                elif opt == 'motion_force_zero':
                    options['float_motion'][
                        'motion_force_zero'] = self.optional_dict[
                            'motion_force_zero']
                else:
                    pass

        if self.optional_dict2 is not None:
            for opt in self.optional_dict2:
                if opt == 'disable_avx':
                    options['disable_avx'] = self.optional_dict2['disable_avx']

        ExternalProgramCaller.call_vmafexec_multi_features(features,
                                                           yuv_type,
                                                           ref_path,
                                                           dis_path,
                                                           w,
                                                           h,
                                                           log_file_path,
                                                           logger,
                                                           options=options)