Skip to content

Commit

Permalink
allow for floating point differences on arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmin committed Jan 22, 2024
1 parent fe52738 commit 91fee56
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion python/test/feature_extractor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_run_vmaf_fextractor(self):

self.assertAlmostEqual(results[0]['VMAF_feature_vif_num_score'], 712650.023478, places=0)
self.assertAlmostEqual(results[0]['VMAF_feature_vif_den_score'], 1597314.95249, places=0)
self.assertAlmostEqual(results[0]['VMAF_feature_adm_num_score'], 371.80645372916666, places=4)
self.assertAlmostEqual(results[0]['VMAF_feature_adm_num_score'], 371.80645372916666, places=3)
self.assertAlmostEqual(results[0]['VMAF_feature_adm_den_score'], 397.83378972916671, places=4)
self.assertAlmostEqual(results[0]['VMAF_feature_anpsnr_score'], 34.164776875, places=4)

Expand Down
12 changes: 6 additions & 6 deletions python/test/quality_runner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def test_run_vmaf_runner_v1_model(self):
self.assertAlmostEqual(results[1]['VMAF_feature_adm_score'], 1.0, places=4)
self.assertAlmostEqual(results[1]['VMAF_feature_ansnr_score'], 31.2714392708, places=4)

self.assertAlmostEqual(results[0]['VMAF_score'], 77.17414738991636, places=4)
self.assertAlmostEqual(results[0]['VMAF_score'], 77.17414738991636, places=3)
self.assertAlmostEqual(results[1]['VMAF_score'], 100.0, places=4)

def test_run_vmaf_runner(self):
Expand Down Expand Up @@ -1045,7 +1045,7 @@ def test_run_bootstrap_vmaf_runner_residue_bootstrap_model(self):
self.assertAlmostEqual(results[0]['BOOTSTRAP_VMAF_bagging_score'], 73.09131553704874, places=4)
self.assertAlmostEqual(results[1]['BOOTSTRAP_VMAF_bagging_score'], 99.79000465995409, places=4)
self.assertAlmostEqual(results[0]['BOOTSTRAP_VMAF_stddev_score'], 1.1982762081883995, places=4)
self.assertAlmostEqual(results[1]['BOOTSTRAP_VMAF_stddev_score'], 1.3028824838324222, places=4)
self.assertAlmostEqual(results[1]['BOOTSTRAP_VMAF_stddev_score'], 1.3028824838324222, places=3)
self.assertAlmostEqual(results[0]['BOOTSTRAP_VMAF_ci95_low_score'], 70.81472328674501, places=4)
self.assertAlmostEqual(results[1]['BOOTSTRAP_VMAF_ci95_low_score'], 94.79667446930989, places=4)
self.assertAlmostEqual(results[0]['BOOTSTRAP_VMAF_ci95_high_score'], 74.83768715705374, places=4)
Expand Down Expand Up @@ -1311,7 +1311,7 @@ def test_run_vmaf_runner_input160x90(self):
with self.assertRaises(KeyError):
self.assertAlmostEqual(results[1]['VMAF_integer_feature_motion_score'], 1.0, places=4)

self.assertAlmostEqual(results[0]['VMAF_score'], 92.52344867729687, places=3)
self.assertAlmostEqual(results[0]['VMAF_score'], 92.52344867729687, places=2)
self.assertAlmostEqual(results[1]['VMAF_score'], 99.30930978456455, places=4)

def test_run_vmaf_runner_json_model(self):
Expand Down Expand Up @@ -1444,7 +1444,7 @@ def test_run_vmaf_runner_neg_mode(self):
self.runner.run(parallelize=False)
results = self.runner.results

self.assertAlmostEqual(results[0]['VMAFNEG_score'], 88.030463, places=4) # 132.7329528948058
self.assertAlmostEqual(results[0]['VMAFNEG_score'], 88.030463, places=3) # 132.7329528948058

self.assertAlmostEqual(results[0]['VMAF_integer_feature_vif_scale0_score'], 0.9837379749630343, places=4)
with self.assertRaises(KeyError):
Expand Down Expand Up @@ -1536,7 +1536,7 @@ def test_run_vmaf_runner_float_nvd6(self):
self.assertAlmostEqual(results[1]['VMAF_feature_motion2_score'], 3.8953518541666665, places=4)
self.assertAlmostEqual(results[1]['VMAF_feature_adm2_score'], 1.0, places=4)

self.assertAlmostEqual(results[0]['VMAF_score'], 80.61670115719328, places=4)
self.assertAlmostEqual(results[0]['VMAF_score'], 80.61670115719328, places=3)
self.assertAlmostEqual(results[1]['VMAF_score'], 99.946416604585025, places=4)

def test_run_vmaf_runner_rdh540(self):
Expand Down Expand Up @@ -1969,7 +1969,7 @@ def test_quality_runner_with_different_models(self):
self.assertAlmostEqual(results1[0]['VMAF_score'], 73.28968543912883, places=4)
self.assertAlmostEqual(results1[1]['VMAF_score'], 99.946416604585025, places=4)

self.assertAlmostEqual(results2[0]['VMAF_score'], 80.61670115719328, places=4)
self.assertAlmostEqual(results2[0]['VMAF_score'], 80.61670115719328, places=3)
self.assertAlmostEqual(results2[1]['VMAF_score'], 99.946416604585025, places=4)


Expand Down
6 changes: 3 additions & 3 deletions python/test/routine_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def test_test_on_dataset(self):
self.assertAlmostEqual(results[0]['VMAF_score'], 99.142659046424384, places=4)
self.assertAlmostEqual(results[1]['VMAF_score'], 35.066157497128764, places=4)
self.assertAlmostEqual(results[2]['VMAF_score'], 97.428042675471147, places=4)
self.assertAlmostEqual(results[3]['VMAF_score'], 97.427927701008869, places=4)
self.assertAlmostEqual(results[3]['VMAF_score'], 97.427927701008869, places=3)
self.assertAlmostEqual(test_assets[0].groundtruth, 100, places=4)
self.assertAlmostEqual(test_assets[1].groundtruth, 50, places=4)
self.assertAlmostEqual(test_assets[2].groundtruth, 100, places=4)
Expand Down Expand Up @@ -466,7 +466,7 @@ def test_test_on_dataset_raw(self):
self.assertAlmostEqual(results[0]['VMAF_score'], 99.142659046424384, places=4)
self.assertAlmostEqual(results[1]['VMAF_score'], 35.066157497128764, places=4)
self.assertAlmostEqual(results[2]['VMAF_score'], 97.428042675471147, places=4)
self.assertAlmostEqual(results[3]['VMAF_score'], 97.427927701008869, places=4)
self.assertAlmostEqual(results[3]['VMAF_score'], 97.427927701008869, places=3)
self.assertAlmostEqual(test_assets[0].groundtruth, 100, places=4)
self.assertAlmostEqual(test_assets[1].groundtruth, 50, places=4)
self.assertAlmostEqual(test_assets[2].groundtruth, 100, places=4)
Expand All @@ -489,7 +489,7 @@ def test_test_on_dataset_mle(self):
self.assertAlmostEqual(results[0]['VMAF_score'], 99.142659046424384, places=4)
self.assertAlmostEqual(results[1]['VMAF_score'], 35.066157497128764, places=4)
self.assertAlmostEqual(results[2]['VMAF_score'], 97.428042675471147, places=4)
self.assertAlmostEqual(results[3]['VMAF_score'], 97.427927701008869, places=4)
self.assertAlmostEqual(results[3]['VMAF_score'], 97.427927701008869, places=3)
self.assertAlmostEqual(test_assets[0].groundtruth, 100, places=4)
self.assertAlmostEqual(test_assets[1].groundtruth, 50, places=4)
self.assertAlmostEqual(test_assets[2].groundtruth, 90, places=4)
Expand Down
8 changes: 4 additions & 4 deletions python/test/vmafexec_feature_extractor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def test_run_float_vif_fextractor_with_debug(self):
self.assertAlmostEqual(results[0]['float_VIF_feature_vif_scale0_score'], 0.3634208125, places=6)
self.assertAlmostEqual(results[0]['float_VIF_feature_vif_scale1_score'], 0.7666474166666667, places=6)
self.assertAlmostEqual(results[0]['float_VIF_feature_vif_scale2_score'], 0.8628533333333334, places=5)
self.assertAlmostEqual(results[0]['float_VIF_feature_vif_scale3_score'], 0.9159719583333334, places=6)
self.assertAlmostEqual(results[0]['float_VIF_feature_vif_scale3_score'], 0.9159719583333334, places=5)
self.assertAlmostEqual(results[1]['float_VIF_feature_vif_scale0_score'], 1.0, places=5)
self.assertAlmostEqual(results[1]['float_VIF_feature_vif_scale1_score'], 1.0, places=5)
self.assertAlmostEqual(results[1]['float_VIF_feature_vif_scale2_score'], 1.0, places=5)
Expand Down Expand Up @@ -349,13 +349,13 @@ def test_run_float_adm_fextractor_with_debug(self):
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_scale3_score'], 0.9649663541666667, places=4)
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_score'], 0.9345148541666667, places=4)

self.assertAlmostEqual(results[0]['float_ADM_feature_adm_num_score'], 371.80645372916666, places=4)
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_num_score'], 371.80645372916666, places=3)
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_den_score'], 397.83379106250004, places=4)
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_num_scale0_score'], 45.526146958333335, places=4)
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_den_scale0_score'], 50.14385129166667, places=4)
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_num_scale1_score'], 66.574236, places=4)
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_den_scale1_score'], 74.47438383333333, places=4)
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_num_scale2_score'], 105.55483329166668, places=4)
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_num_scale2_score'], 105.55483329166668, places=3)
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_den_scale2_score'], 113.49725864583333, places=4)
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_num_scale3_score'], 154.15123754166666, places=4)
self.assertAlmostEqual(results[0]['float_ADM_feature_adm_den_scale3_score'], 159.7182974375, places=4)
Expand Down Expand Up @@ -476,7 +476,7 @@ def test_run_float_vif_fextractor_akiyo_multiply(self):
)
self.fextractor.run(parallelize=True)
results = self.fextractor.results
self.assertAlmostEqual(results[0]['float_VIF_feature_vif_scale0_score'], 1.0522544319369052, places=5)
self.assertAlmostEqual(results[0]['float_VIF_feature_vif_scale0_score'], 1.0522544319369052, places=4)
self.assertAlmostEqual(results[0]['float_VIF_feature_vif_scale1_score'], 1.0705609423182443, places=5)
self.assertAlmostEqual(results[0]['float_VIF_feature_vif_scale2_score'], 1.0731529493098957, places=4)
self.assertAlmostEqual(results[0]['float_VIF_feature_vif_scale3_score'], 1.0728060231246508, places=4)
Expand Down
12 changes: 6 additions & 6 deletions python/test/vmafexec_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def test_run_vmafexec_runner_akiyo_multiply(self):
self.assertAlmostEqual(results[0]['VMAFEXEC_vif_scale2_score'], 1.072518, places=4) # 1.0731529493098957
self.assertAlmostEqual(results[0]['VMAFEXEC_vif_scale3_score'], 1.072512, places=4) # 1.0728060231246508

self.assertAlmostEqual(results[0]['VMAFEXEC_score'], 132.732952, places=3) # 132.78849246495625
self.assertAlmostEqual(results[0]['VMAFEXEC_score'], 132.732952, places=2) # 132.78849246495625

def test_run_vmafexec_runner_akiyo_multiply_with_feature_enhn_gain_limit(self):
ref_path = VmafConfig.test_resource_path("yuv", "refp_vmaf_hacking_investigation_0_0_akiyo_cif_notyuv_0to0_identity_vs_akiyo_cif_notyuv_0to0_multiply_q_352x288")
Expand Down Expand Up @@ -667,7 +667,7 @@ def test_run_vmafexec_runner_akiyo_multiply_with_feature_enhn_gain_limit(self):
self.assertAlmostEqual(results[0]['VMAFEXEC_vif_scale2_egl_1_score'], 0.9984692380091739, places=4) # 1.0731529493098957
self.assertAlmostEqual(results[0]['VMAFEXEC_vif_scale3_egl_1_score'], 0.999146211879154, places=4) # 1.0728060231246508

self.assertAlmostEqual(results[0]['VMAFEXEC_score'], 88.030463, places=4) # 132.78849246495625
self.assertAlmostEqual(results[0]['VMAFEXEC_score'], 88.030463, places=3) # 132.78849246495625

def test_run_vmafexec_runner_akiyo_multiply_with_feature_enhn_gain_limit_custom(self):
ref_path = VmafConfig.test_resource_path("yuv", "refp_vmaf_hacking_investigation_0_0_akiyo_cif_notyuv_0to0_identity_vs_akiyo_cif_notyuv_0to0_multiply_q_352x288")
Expand Down Expand Up @@ -695,7 +695,7 @@ def test_run_vmafexec_runner_akiyo_multiply_with_feature_enhn_gain_limit_custom(
self.assertAlmostEqual(results[0]['VMAFEXEC_vif_scale2_egl_1.1_score'], 1.04852, places=4) # 1.0731529493098957
self.assertAlmostEqual(results[0]['VMAFEXEC_vif_scale3_egl_1.1_score'], 1.04892, places=4) # 1.0728060231246508

self.assertAlmostEqual(results[0]['VMAFEXEC_score'], 129.474226, places=3) # 132.78849246495625
self.assertAlmostEqual(results[0]['VMAFEXEC_score'], 129.474226, places=2) # 132.78849246495625

def test_run_vmafexec_runner_akiyo_multiply_disable_enhn_gain(self):
ref_path = VmafConfig.test_resource_path("yuv", "refp_vmaf_hacking_investigation_0_0_akiyo_cif_notyuv_0to0_identity_vs_akiyo_cif_notyuv_0to0_multiply_q_352x288")
Expand Down Expand Up @@ -723,7 +723,7 @@ def test_run_vmafexec_runner_akiyo_multiply_disable_enhn_gain(self):
self.assertAlmostEqual(results[0]['VMAFEXEC_vif_scale2_egl_1_score'], 0.9984692380091739, places=4) # 1.0731529493098957
self.assertAlmostEqual(results[0]['VMAFEXEC_vif_scale3_egl_1_score'], 0.999146211879154, places=4) # 1.0728060231246508

self.assertAlmostEqual(results[0]['VMAFEXEC_score'], 88.030463, places=4) # 132.78849246495625
self.assertAlmostEqual(results[0]['VMAFEXEC_score'], 88.030463, places=3) # 132.78849246495625

def test_run_vmafexec_runner_akiyo_multiply_no_enhn_gain_model(self):
ref_path = VmafConfig.test_resource_path("yuv", "refp_vmaf_hacking_investigation_0_0_akiyo_cif_notyuv_0to0_identity_vs_akiyo_cif_notyuv_0to0_multiply_q_352x288")
Expand Down Expand Up @@ -751,7 +751,7 @@ def test_run_vmafexec_runner_akiyo_multiply_no_enhn_gain_model(self):
self.assertAlmostEqual(results[0]['VMAFEXEC_vif_scale2_egl_1_score'], 0.9984692380091739, places=4) # 1.0731529493098957
self.assertAlmostEqual(results[0]['VMAFEXEC_vif_scale3_egl_1_score'], 0.999146211879154, places=4) # 1.0728060231246508

self.assertAlmostEqual(results[0]['VMAFEXEC_score'], 88.030463, places=4) # 132.78849246495625
self.assertAlmostEqual(results[0]['VMAFEXEC_score'], 88.030463, places=3) # 132.78849246495625

def test_run_vmafexec_runner_akiyo_multiply_no_enhn_gain_model_and_cmd_options(self):
ref_path = VmafConfig.test_resource_path("yuv", "refp_vmaf_hacking_investigation_0_0_akiyo_cif_notyuv_0to0_identity_vs_akiyo_cif_notyuv_0to0_multiply_q_352x288")
Expand Down Expand Up @@ -780,7 +780,7 @@ def test_run_vmafexec_runner_akiyo_multiply_no_enhn_gain_model_and_cmd_options(s
self.assertAlmostEqual(results[0]['VMAFEXEC_vif_scale2_egl_1_score'], 0.9984692380091739, places=4) # 1.0731529493098957
self.assertAlmostEqual(results[0]['VMAFEXEC_vif_scale3_egl_1_score'], 0.999146211879154, places=4) # 1.0728060231246508

self.assertAlmostEqual(results[0]['VMAFEXEC_score'], 122.804272, places=3) # 132.78849246495625
self.assertAlmostEqual(results[0]['VMAFEXEC_score'], 122.804272, places=2) # 132.78849246495625

def test_run_vmafexec_runner_akiyo_multiply_no_enhn_gain_model_and_cmd_options_illegal(self):
ref_path = VmafConfig.test_resource_path("yuv", "refp_vmaf_hacking_investigation_0_0_akiyo_cif_notyuv_0to0_identity_vs_akiyo_cif_notyuv_0to0_multiply_q_352x288")
Expand Down

0 comments on commit 91fee56

Please sign in to comment.