def test_run_vmaf_legacy_runner_not_unique(self): ref_path = config.ROOT + "/resource/yuv/src01_hrc00_576x324.yuv" dis_path = config.ROOT + "/resource/yuv/src01_hrc01_576x324.yuv" asset = Asset(dataset="test", content_id=0, asset_id=0, workdir_root=config.ROOT + "/workspace/workdir", ref_path=ref_path, dis_path=dis_path, asset_dict={ 'width': 576, 'height': 324 }) asset_original = Asset(dataset="test", content_id=0, asset_id=0, workdir_root=config.ROOT + "/workspace/workdir", ref_path=ref_path, dis_path=ref_path, asset_dict={ 'width': 576, 'height': 324 }) with self.assertRaises(AssertionError): self.runner = VmafLegacyQualityRunner([asset, asset_original], None, fifo_mode=True)
def test_executor_id(self): asset = Asset(dataset="test", content_id=0, asset_id=1, ref_path="dir/refvideo.yuv", dis_path="dir/disvideo.yuv", asset_dict={}) runner = VmafLegacyQualityRunner([asset], None) self.assertEquals(runner.executor_id, 'VMAF_legacy_V1.0')
def test_run_vamf_legacy_runner_10le(self): print 'test on running VMAF (legacy) runner on 10 bit le...' ref_path = config.ROOT + "/resource/yuv/src01_hrc00_576x324.yuv422p10le.yuv" dis_path = config.ROOT + "/resource/yuv/src01_hrc01_576x324.yuv422p10le.yuv" asset = Asset(dataset="test", content_id=0, asset_id=0, workdir_root=config.ROOT + "/workspace/workdir", ref_path=ref_path, dis_path=dis_path, asset_dict={ 'width': 576, 'height': 324, 'yuv_type': 'yuv422p10le' }) asset_original = Asset(dataset="test", content_id=0, asset_id=1, workdir_root=config.ROOT + "/workspace/workdir", ref_path=ref_path, dis_path=ref_path, asset_dict={ 'width': 576, 'height': 324, 'yuv_type': 'yuv422p10le' }) self.runner = VmafLegacyQualityRunner([asset, asset_original], None, fifo_mode=False, delete_workdir=True, result_store=None) self.runner.run() results = self.runner.results self.assertAlmostEqual(results[0]['VMAF_legacy_score'], 60.27316952679754) self.assertAlmostEqual(results[0]['VMAF_feature_vif_score'], 0.44455808333333313) self.assertAlmostEqual(results[0]['VMAF_feature_motion_score'], 3.5916076041666667) self.assertAlmostEqual(results[0]['VMAF_feature_adm_score'], 0.9155242291666666) self.assertAlmostEqual(results[0]['VMAF_feature_ansnr_score'], 22.533456770833329) self.assertAlmostEqual(results[1]['VMAF_legacy_score'], 95.65756240092573) self.assertAlmostEqual(results[1]['VMAF_feature_vif_score'], 1.0) self.assertAlmostEqual(results[1]['VMAF_feature_motion_score'], 3.5916076041666667) self.assertAlmostEqual(results[1]['VMAF_feature_adm_score'], 1.0) self.assertAlmostEqual(results[1]['VMAF_feature_ansnr_score'], 30.030914145833322)
def setUp(self): ref_path = config.ROOT + "/resource/yuv/checkerboard_1920_1080_10_3_0_0.yuv" dis_path = config.ROOT + "/resource/yuv/checkerboard_1920_1080_10_3_1_0.yuv" asset = Asset(dataset="test", content_id=0, asset_id=0, workdir_root=config.ROOT + "/workspace/workdir", ref_path=ref_path, dis_path=dis_path, asset_dict={'width':1920, 'height':1080}) self.runner = VmafLegacyQualityRunner( [asset], None, fifo_mode=True, delete_workdir=True, result_store=FileSystemResultStore(), ) self.runner.run() self.result = self.runner.results[0]
def test_run_vamf_legacy_runner_with_result_store(self): print 'test on running VMAF (legacy) runner with result store...' ref_path = config.ROOT + "/resource/yuv/src01_hrc00_576x324.yuv" dis_path = config.ROOT + "/resource/yuv/src01_hrc01_576x324.yuv" asset = Asset(dataset="test", content_id=0, asset_id=0, workdir_root=config.ROOT + "/workspace/workdir", ref_path=ref_path, dis_path=dis_path, asset_dict={ 'width': 576, 'height': 324 }) asset_original = Asset(dataset="test", content_id=0, asset_id=1, workdir_root=config.ROOT + "/workspace/workdir", ref_path=ref_path, dis_path=ref_path, asset_dict={ 'width': 576, 'height': 324 }) result_store = FileSystemResultStore(logger=None) self.runner = VmafLegacyQualityRunner([asset, asset_original], None, fifo_mode=True, delete_workdir=True, result_store=result_store) print ' running for the first time with fresh calculation...' self.runner.run() result0, result1 = self.runner.results # NOTE: since stored results are actually VMAF_feature's not VMAF's, # the two paths below shouldn't exist self.assertFalse( os.path.exists(result_store._get_result_file_path(result0))) self.assertFalse( os.path.exists(result_store._get_result_file_path(result1))) print ' running for the second time with stored results...' self.runner.run() results = self.runner.results self.assertAlmostEqual(results[0]['VMAF_legacy_score'], 60.27316952679754, places=4) self.assertAlmostEqual(results[0]['VMAF_feature_vif_score'], 0.44455808333333313, places=4) self.assertAlmostEqual(results[0]['VMAF_feature_motion_score'], 3.5916076041666667, places=4) self.assertAlmostEqual(results[0]['VMAF_feature_adm_score'], 0.9155242291666666, places=4) self.assertAlmostEqual(results[0]['VMAF_feature_ansnr_score'], 22.533456770833329, places=4) self.assertAlmostEqual(results[1]['VMAF_legacy_score'], 95.65756240092573, places=4) self.assertAlmostEqual(results[1]['VMAF_feature_vif_score'], 1.0, places=4) self.assertAlmostEqual(results[1]['VMAF_feature_motion_score'], 3.5916076041666667, places=4) self.assertAlmostEqual(results[1]['VMAF_feature_adm_score'], 1.0, places=4) self.assertAlmostEqual(results[1]['VMAF_feature_ansnr_score'], 30.030914145833322, places=4)