Skip to content

Commit

Permalink
cambi.md: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nilfm99 committed Feb 15, 2024
1 parent 307e182 commit 6d77a02
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions resource/doc/cambi.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,25 +137,25 @@ ffmpeg -f rawvideo -pix_fmt gray16le -s 1280x720 -i heatmaps/cambi_heatmap_scale
CAMBI can also be invoked in the [Python library](python.md). Use `CambiFeatureExtractor` as the feature extractor, and `CambiQualityRunner` as the quality runner. Use `CambiFullReferenceFeatureExtractor` and `CambiFullReferenceQualityRunner` to run the full-reference version of CAMBI.

```
dis_path = VmafConfig.test_resource_path("yuv", "KristenAndSara_1280x720_8bit_processed.yuv")
asset = Asset(dataset="test", content_id=0, asset_id=0,
workdir_root=VmafConfig.workdir_path(),
ref_path=dis_path,
dis_path=dis_path,
asset_dict={'width': 1280, 'height': 720,
'dis_enc_width': 960, 'dis_enc_height': 540})
self.qrunner = CambiQualityRunner(
[asset, asset_original],
None, fifo_mode=False,
result_store=None,
optional_dict={}
)
self.qrunner.run(parallelize=True)
results = self.qrunner.results
# score: arithmetic mean score over all frames
self.assertAlmostEqual(results[0]['Cambi_score'],
1.218365, places=4)
dis_path = VmafConfig.test_resource_path("yuv", "KristenAndSara_1280x720_8bit_processed.yuv")
asset = Asset(dataset="test", content_id=0, asset_id=0,
workdir_root=VmafConfig.workdir_path(),
ref_path=dis_path,
dis_path=dis_path,
asset_dict={'width': 1280, 'height': 720,
'dis_enc_width': 960, 'dis_enc_height': 540})
self.qrunner = CambiQualityRunner(
[asset, asset_original],
None, fifo_mode=False,
result_store=None,
optional_dict={}
)
self.qrunner.run(parallelize=True)
results = self.qrunner.results
# score: arithmetic mean score over all frames
self.assertAlmostEqual(results[0]['Cambi_score'],
1.218365, places=4)
```

0 comments on commit 6d77a02

Please sign in to comment.