예제 #1
0
    def test_run_psnr_runner_with_notyuv(self):
        print 'test on running PSNR runner...'
        ref_path = VmafConfig.test_resource_path("mp4",
                                                 "Seeking_10_288_375.mp4")
        dis_path = VmafConfig.test_resource_path("mp4",
                                                 "Seeking_10_288_375.mp4")
        asset = Asset(dataset="test",
                      content_id=0,
                      asset_id=0,
                      workdir_root=VmafConfig.workdir_path(),
                      ref_path=ref_path,
                      dis_path=dis_path,
                      asset_dict={
                          'yuv_type': 'notyuv',
                          'quality_width': 720,
                          'quality_height': 480,
                      })
        self.runner = PsnrQualityRunner([asset],
                                        None,
                                        fifo_mode=True,
                                        delete_workdir=True,
                                        result_store=None)
        self.runner.run()

        results = self.runner.results
        self.assertAlmostEqual(results[0]['PSNR_score'], 60.0, places=4)
예제 #2
0
    def test_run_psnr_runner_with_notyuv_gblur(self):

        ref_path = VmafConfig.test_resource_path("mp4",
                                                 "Seeking_10_288_375.mp4")
        dis_path = VmafConfig.test_resource_path("mp4",
                                                 "Seeking_10_288_375.mp4")
        asset = Asset(dataset="test",
                      content_id=0,
                      asset_id=0,
                      workdir_root=VmafConfig.workdir_path(),
                      ref_path=ref_path,
                      dis_path=dis_path,
                      asset_dict={
                          'yuv_type': 'notyuv',
                          'quality_width': 720,
                          'quality_height': 480,
                          'dis_gblur_cmd': 'sigma=0.01:steps=1',
                      })
        self.runner = PsnrQualityRunner([asset],
                                        None,
                                        fifo_mode=False,
                                        delete_workdir=True,
                                        result_store=None)
        self.runner.run()

        results = self.runner.results
        self.assertAlmostEqual(results[0]['PSNR_score'],
                               50.99313338666667,
                               places=4)
예제 #3
0
    def test_run_psnr_runner_with_frames_proc(self):

        ref_path = VmafConfig.test_resource_path("yuv", "src01_hrc00_576x324.yuv")
        dis_path = VmafConfig.test_resource_path("yuv", "src01_hrc01_576x324.yuv")
        asset = Asset(dataset="test", content_id=0, asset_id=0,
                      workdir_root=VmafConfig.workdir_path(),
                      ref_path=ref_path,
                      dis_path=dis_path,
                      asset_dict={'width': 576, 'height': 324,
                                  'start_frame': 2, 'end_frame': 2,
                                  'ref_proc_callback': 'identity',
                                  })
        asset2 = Asset(dataset="test", content_id=0, asset_id=0,
                      workdir_root=VmafConfig.workdir_path(),
                      ref_path=ref_path,
                      dis_path=dis_path,
                      asset_dict={'width': 576, 'height': 324,
                                  'ref_start_frame': 2, 'ref_end_frame': 2,
                                  'dis_start_frame': 6, 'dis_end_frame': 6,
                                  'dis_proc_callback': 'identity',
                                  })
        self.runner = PsnrQualityRunner(
            [asset, asset2],
            None, fifo_mode=True,
            delete_workdir=True,
            result_store=None
        )
        self.runner.run(parallelize=False)

        results = self.runner.results
        self.assertAlmostEqual(results[0]['PSNR_score'], 30.993823, places=4)
        self.assertAlmostEqual(results[1]['PSNR_score'], 19.393160, places=4)
예제 #4
0
    def test_run_psnr_runner_with_notyuv(self):
        ref_path = VmafConfig.test_resource_path(
            "tiff", "src01_hrc00_576x324%05d.tiff", bypass_download=True)
        dis_path = VmafConfig.test_resource_path(
            "tiff", "src01_hrc01_576x324%05d.tiff", bypass_download=True)
        asset = Asset(dataset="test",
                      content_id=0,
                      asset_id=0,
                      workdir_root=VmafConfig.workdir_path(),
                      ref_path=ref_path,
                      dis_path=dis_path,
                      asset_dict={
                          'yuv_type': 'notyuv',
                          'quality_width': 576,
                          'quality_height': 324,
                      })
        self.runner = PsnrQualityRunner([asset],
                                        None,
                                        fifo_mode=False,
                                        delete_workdir=True,
                                        result_store=None)
        self.runner.run()

        results = self.runner.results
        pprint.pprint(results[0]['PSNR_scores'])
        pprint.pprint(results[0]['PSNR_score'])
        self.assertAlmostEqual(results[0]['PSNR_score'], 32.12685675, places=4)