当前位置: 首页>>代码示例>>Python>>正文


Python VmafConfig.resource_path方法代码示例

本文整理汇总了Python中vmaf.config.VmafConfig.resource_path方法的典型用法代码示例。如果您正苦于以下问题:Python VmafConfig.resource_path方法的具体用法?Python VmafConfig.resource_path怎么用?Python VmafConfig.resource_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vmaf.config.VmafConfig的用法示例。


在下文中一共展示了VmafConfig.resource_path方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from vmaf.config import VmafConfig [as 别名]
# 或者: from vmaf.config.VmafConfig import resource_path [as 别名]
def main():

    dataset_filepaths = [
        VmafConfig.resource_path('dataset', 'NFLX_dataset_public_raw_last4outliers.py'),
        VmafConfig.resource_path('dataset', 'VQEGHD3_dataset_raw.py'),
    ]

    # ============ sample results =================

    subjective_model_classes = [
        MaximumLikelihoodEstimationModel,
        MosModel,

        # MaximumLikelihoodEstimationDmosModel,
        # DmosModel,
    ]

    # plot_sample_results(dataset_filepaths, subjective_model_classes)

    # ============ plot trends =================

    # ===== datasize growth =====
    # run_datasize_growth(dataset_filepaths)

    # ===== corrpution growth =====
    run_subject_corruption_growth(dataset_filepaths)
    # run_random_corruption_growth(dataset_filepaths)

    # run_subject_partial_corruption_growth(dataset_filepaths)

    # ===== random missing growth =====
    # run_missing_growth(dataset_filepaths)

    # ===== synthetic data =====
    # validate_with_synthetic_dataset()

    plt.show()
开发者ID:stoth68000,项目名称:vmaf,代码行数:39,代码来源:run_subjective_models.py

示例2: validate_with_synthetic_dataset

# 需要导入模块: from vmaf.config import VmafConfig [as 别名]
# 或者: from vmaf.config.VmafConfig import resource_path [as 别名]
def validate_with_synthetic_dataset():

    # use the dataset_filepath only for its dimensions and reference video mapping
    dataset_filepath = VmafConfig.resource_path('dataset', 'NFLX_dataset_public_raw_last4outliers.py')
    np.random.seed(0)
    _validate_with_synthetic_dataset(
        subjective_model_classes=[
            MaximumLikelihoodEstimationModel
        ],
        dataset_filepath=dataset_filepath,
        synthetic_result={
            'quality_scores': np.random.uniform(1, 5, 79),
            'observer_bias': np.random.normal(0, 1, 30),
            'observer_inconsistency': np.abs(np.random.uniform(0.0, 0.4, 30)),
            'content_bias': np.random.normal(0, 0.00001, 9),
            'content_ambiguity': np.abs(np.random.uniform(0.4, 0.6, 9)),
        }
    )
开发者ID:stoth68000,项目名称:vmaf,代码行数:20,代码来源:run_subjective_models.py

示例3: run_vmaf_cv

# 需要导入模块: from vmaf.config import VmafConfig [as 别名]
# 或者: from vmaf.config.VmafConfig import resource_path [as 别名]
__copyright__ = "Copyright 2016-2017, Netflix, Inc."
__license__ = "Apache, Version 2.0"

import matplotlib.pyplot as plt
import numpy as np

from vmaf.config import VmafConfig
from vmaf.routine import run_vmaf_cv, run_vmaf_kfold_cv

if __name__ == '__main__':

    # ==== Run simple cross validation: one training and one testing dataset ====

    run_vmaf_cv(
        train_dataset_filepath=VmafConfig.resource_path('dataset', 'NFLX_dataset_public.py'),
        test_dataset_filepath=VmafConfig.resource_path('dataset', 'VQEGHD3_dataset.py'),
        param_filepath=VmafConfig.resource_path('param', 'vmaf_v3.py'),
        output_model_filepath=VmafConfig.workspace_path('model', 'test_model1.pkl'),
    )

    # ==== Run cross validation across genres (tough test) ====

    nflx_dataset_path = VmafConfig.resource_path('dataset', 'NFLX_dataset_public.py')
    contentid_groups = [
        [0, 5], # cartoon: BigBuckBunny, FoxBird
        [1], # CG: BirdsInCage
        [2, 6, 7], # complex: CrowdRun, OldTownCross, Seeking
        [3, 4], # ElFuente: ElFuente1, ElFuente2
        [8], # sports: Tennis
    ]
    param_filepath = VmafConfig.resource_path('param', 'vmaf_v3.py')
开发者ID:stoth68000,项目名称:vmaf,代码行数:33,代码来源:run_vmaf_cross_validation.py

示例4: setUp

# 需要导入模块: from vmaf.config import VmafConfig [as 别名]
# 或者: from vmaf.config.VmafConfig import resource_path [as 别名]
 def setUp(self):
     self.raw_dataset_filepath = VmafConfig.resource_path("dataset", "NFLX_dataset_public_raw.py")
     self.derived_dataset_path = VmafConfig.workdir_path("test_derived_dataset.py")
     self.derived_dataset_path_pyc = VmafConfig.workdir_path("test_derived_dataset.pyc")
开发者ID:stoth68000,项目名称:vmaf,代码行数:6,代码来源:routine_test.py

示例5:

# 需要导入模块: from vmaf.config import VmafConfig [as 别名]
# 或者: from vmaf.config.VmafConfig import resource_path [as 别名]
from vmaf.config import VmafConfig
from vmaf.core.executor import run_executors_in_parallel
from vmaf.core.raw_extractor import DisYUVRawVideoExtractor
from vmaf.core.nn_train_test_model import ToddNoiseClassifierTrainTestModel
from vmaf.routine import read_dataset
from vmaf.tools.misc import import_python_file


# parameters
num_train = 500
num_test = 50
n_epochs = 30
seed = 0 # None

# read input dataset
dataset_path = VmafConfig.resource_path('dataset', 'BSDS500_noisy_dataset.py')
dataset = import_python_file(dataset_path)
assets = read_dataset(dataset)

# shuffle assets
np.random.seed(seed)
np.random.shuffle(assets)
assets = assets[:(num_train + num_test)]

raw_video_h5py_filepath = VmafConfig.workdir_path('rawvideo.hdf5')
raw_video_h5py_file = DisYUVRawVideoExtractor.open_h5py_file(raw_video_h5py_filepath)

print '======================== Extract raw YUVs =============================='

_, raw_yuvs = run_executors_in_parallel(
    DisYUVRawVideoExtractor,
开发者ID:stoth68000,项目名称:vmaf,代码行数:33,代码来源:run_toddnoiseclassifier.py


注:本文中的vmaf.config.VmafConfig.resource_path方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。