def test_run_speed_matlab_runner(self): print 'test on running SPEED Matlab runner, with parallelization...' ref_path, dis_path, asset, asset_original = set_default_576_324_videos_for_testing( ) self.runner = SpEEDMatlabQualityRunner([asset, asset_original], None, fifo_mode=True, delete_workdir=True, result_store=None) self.runner.run(parallelize=True) results = self.runner.results self.assertAlmostEqual( results[0]['SpEED_Matlab_feature_sspeed_4_score'], 5.155523354166667, places=4) self.assertAlmostEqual( results[0]['SpEED_Matlab_feature_tspeed_4_score'], 15.091642416666668, places=4) self.assertAlmostEqual(results[0]['SpEED_Matlab_score'], 78.4927784076698, places=4) self.assertAlmostEqual( results[1]['SpEED_Matlab_feature_sspeed_4_score'], 0.0, places=4) self.assertAlmostEqual( results[1]['SpEED_Matlab_feature_tspeed_4_score'], 0.0, places=4) self.assertAlmostEqual(results[1]['SpEED_Matlab_score'], 0.0, places=4)
def test_run_strrred_runner(self): print 'test on running STRRED runner, with parallelization...' ref_path, dis_path, asset, asset_original = set_default_576_324_videos_for_testing( ) self.runner = StrredQualityRunner([asset, asset_original], None, fifo_mode=True, delete_workdir=True, result_store=None) self.runner.run(parallelize=True) results = self.runner.results self.assertEqual(self.runner.VERSION, "F1.3-1.1") self.assertAlmostEqual(results[0]['STRRED_feature_srred_score'], 3.0166328541666663, places=4) self.assertAlmostEqual(results[0]['STRRED_feature_trred_score'], 7.338665770833333, places=4) self.assertAlmostEqual(results[0]['STRRED_score'], 22.336452104611016, places=4) self.assertAlmostEqual(results[1]['STRRED_feature_srred_score'], 0.0, places=4) self.assertAlmostEqual(results[1]['STRRED_feature_trred_score'], 0.0, places=4) self.assertAlmostEqual(results[1]['STRRED_score'], 0.0, places=4)
def test_run_strredOpt_fextractor(self): print 'test on running STRREDopt feature extractor, no parallelization...' ref_path, dis_path, asset, asset_original = set_default_576_324_videos_for_testing( ) self.fextractor = StrredOptFeatureExtractor([asset, asset_original], None, fifo_mode=True, result_store=None) self.fextractor.run(parallelize=False) results = self.fextractor.results # notice that these numbers are the same with ST-RRED, since the opt version should always produce identical results self.assertAlmostEqual(results[0]['STRREDOpt_feature_srred_score'], 3.0166328541666663, places=4) self.assertAlmostEqual(results[0]['STRREDOpt_feature_trred_score'], 7.338665770833333, places=4) self.assertAlmostEqual(results[0]['STRREDOpt_feature_strred_score'], 22.336452104611016, places=4) self.assertAlmostEqual(results[1]['STRREDOpt_feature_srred_score'], 0.0, places=4) self.assertAlmostEqual(results[1]['STRREDOpt_feature_trred_score'], 0.0, places=4) self.assertAlmostEqual(results[1]['STRREDOpt_feature_strred_score'], 0.0, places=4)
def test_run_strred_fextractor(self): print 'test on running STRRED feature extractor, no parallelization...' ref_path, dis_path, asset, asset_original = set_default_576_324_videos_for_testing( ) self.fextractor = StrredFeatureExtractor([asset, asset_original], None, fifo_mode=True, result_store=None) self.fextractor.run(parallelize=False) results = self.fextractor.results self.assertAlmostEqual(results[0]['STRRED_feature_srred_score'], 3.0166328541666663, places=4) self.assertAlmostEqual(results[0]['STRRED_feature_trred_score'], 7.338665770833333, places=4) self.assertAlmostEqual(results[0]['STRRED_feature_strred_score'], 22.336452104611016, places=4) self.assertAlmostEqual( results[0]['STRRED_feature_strred_all_same_score'], 22.138060270044175, places=4) self.assertAlmostEqual(results[1]['STRRED_feature_srred_score'], 0.0, places=4) self.assertAlmostEqual(results[1]['STRRED_feature_trred_score'], 0.0, places=4) self.assertAlmostEqual(results[1]['STRRED_feature_strred_score'], 0.0, places=4)
def test_run_SpEED_matlab_fextractor(self): print 'test on running SpEED (Matlab) feature extractor, no paralellization...' ref_path, dis_path, asset, asset_original = set_default_576_324_videos_for_testing( ) self.fextractor = SpEEDMatlabFeatureExtractor([asset, asset_original], None, fifo_mode=True, result_store=None) self.fextractor.run(parallelize=False) results = self.fextractor.results # S-SpEED assertions on first frame self.assertAlmostEqual(results[0].result_dict[self.fextractor.TYPE + '_sspeed_2_scores'][0], 13.510418, places=4) self.assertAlmostEqual(results[0].result_dict[self.fextractor.TYPE + '_sspeed_3_scores'][0], 7.211881, places=4) self.assertAlmostEqual(results[0].result_dict[self.fextractor.TYPE + '_sspeed_4_scores'][0], 4.921501, places=4) # T-SpEED assertions on third frame self.assertAlmostEqual(results[0].result_dict[self.fextractor.TYPE + '_tspeed_2_scores'][2], 32.994605, places=4) self.assertAlmostEqual(results[0].result_dict[self.fextractor.TYPE + '_tspeed_3_scores'][2], 22.404285, places=4) self.assertAlmostEqual(results[0].result_dict[self.fextractor.TYPE + '_tspeed_4_scores'][2], 15.233468, places=4)
def test_run_stmad_fextractor(self): print 'test on running STMAD (Matlab) feature extractor, no parallelization...' ref_path, dis_path, asset, asset_original = set_default_576_324_videos_for_testing( ) self.fextractor = STMADFeatureExtractor([asset, asset_original], None, fifo_mode=True, result_store=None) self.fextractor.run(parallelize=False) results = self.fextractor.results self.assertAlmostEqual( results[0].result_dict['STMAD_feature_smad_all_same_scores'][0], 2.889626, places=4) self.assertAlmostEqual( results[0].result_dict['STMAD_feature_tmad_all_same_scores'][0], 5.649214, places=4) self.assertAlmostEqual( results[0].result_dict['STMAD_feature_stmad_all_same_scores'][0], 4.983220, places=4) self.assertAlmostEqual( results[1].result_dict['STMAD_feature_smad_all_same_scores'][0], 1.000000, places=4) self.assertAlmostEqual( results[1].result_dict['STMAD_feature_tmad_all_same_scores'][0], 0.000000, places=4) self.assertAlmostEqual( results[1].result_dict['STMAD_feature_stmad_all_same_scores'][0], -1.818097, places=4)