本文整理汇总了Python中vmaf.config.VmafConfig.workspace_path方法的典型用法代码示例。如果您正苦于以下问题:Python VmafConfig.workspace_path方法的具体用法?Python VmafConfig.workspace_path怎么用?Python VmafConfig.workspace_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vmaf.config.VmafConfig
的用法示例。
在下文中一共展示了VmafConfig.workspace_path方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_vmaf_cv_from_raw
# 需要导入模块: from vmaf.config import VmafConfig [as 别名]
# 或者: from vmaf.config.VmafConfig import workspace_path [as 别名]
def run_vmaf_cv_from_raw(train_dataset_raw_filepath, test_dataset_raw_filepath,
param_filepath, output_model_filepath, **kwargs):
if 'train_quality_wh' in kwargs:
train_quality_width, train_quality_height = kwargs['train_quality_wh']
else:
train_quality_width = None
train_quality_height = None
if 'test_quality_wh' in kwargs:
test_quality_width, test_quality_height = kwargs['test_quality_wh']
else:
test_quality_width = None
test_quality_height = None
if 'train_transform_final' in kwargs:
train_transform_final = kwargs['train_transform_final']
else:
train_transform_final = None
if 'test_transform_final' in kwargs:
test_transform_final = kwargs['test_transform_final']
else:
test_transform_final = None
train_output_dataset_filepath = VmafConfig.workspace_path('dataset', 'train_dataset.py')
generate_dataset_from_raw(raw_dataset_filepath=train_dataset_raw_filepath,
output_dataset_filepath=train_output_dataset_filepath,
quality_width=train_quality_width,
quality_height=train_quality_height,
transform_final=train_transform_final,
**kwargs)
test_output_dataset_filepath = VmafConfig.workspace_path('dataset', 'test_dataset.py') \
if test_dataset_raw_filepath is not None else None
generate_dataset_from_raw(raw_dataset_filepath=test_dataset_raw_filepath,
output_dataset_filepath=test_output_dataset_filepath,
quality_width=test_quality_width,
quality_height=test_quality_height,
transform_final=test_transform_final,
**kwargs)
run_vmaf_cv(
train_dataset_filepath=train_output_dataset_filepath,
test_dataset_filepath=test_output_dataset_filepath,
param_filepath=param_filepath,
output_model_filepath=output_model_filepath,
**kwargs
)
示例2: setUp
# 需要导入模块: from vmaf.config import VmafConfig [as 别名]
# 或者: from vmaf.config.VmafConfig import workspace_path [as 别名]
def setUp(self):
train_dataset_path = VmafConfig.test_resource_path('test_image_dataset_diffdim.py')
train_dataset = import_python_file(train_dataset_path)
train_assets = read_dataset(train_dataset)
self.h5py_filepath = VmafConfig.workdir_path('test.hdf5')
self.h5py_file = DisYUVRawVideoExtractor.open_h5py_file(self.h5py_filepath)
optional_dict2 = {'h5py_file': self.h5py_file}
runner = DisYUVRawVideoExtractor(
train_assets,
None,
fifo_mode=True,
delete_workdir=True,
result_store=None,
optional_dict=None,
optional_dict2=optional_dict2,
)
runner.run(parallelize=False) # CAN ONLY USE SERIAL MODE FOR DisYRawVideoExtractor
self.features = runner.results
self.model_filename = VmafConfig.workspace_path("model", "test_save_load.pkl")
示例3: run_vmaf_cv
# 需要导入模块: from vmaf.config import VmafConfig [as 别名]
# 或者: from vmaf.config.VmafConfig import workspace_path [as 别名]
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')
aggregate_method = np.mean
示例4: setUp
# 需要导入模块: from vmaf.config import VmafConfig [as 别名]
# 或者: from vmaf.config.VmafConfig import workspace_path [as 别名]
def setUp(self):
self.output_model_filepath = VmafConfig.workspace_path("model", "test_output_model.pkl")