cutcutcodec.core.analysis.video.metrics
Gathers all video metrics.
Functions
|
Simultaneously calculate multiple video metrics, comparative and no-reference. |
Details
- cutcutcodec.core.analysis.video.metrics.video_metrics(dis: Path | str | bytes, ref: Path | str | bytes | None = None, **metrics) dict[str, list[float]][source]
Simultaneously calculate multiple video metrics, comparative and no-reference.
Parameters
- dispathlike
The distorted video file.
- refpathlike, optional
The reference video file, used for comparative metrics only.
- lpips_alexboolean, default=False
Trigger the spacial comparative quality LPIPS metric with medium alex network. Call
cutcutcodec.core.analysis.video.quality.lpips()on every frame.- lpips_vggboolean, default=False
Trigger the spacial comparative quality LPIPS metric with big vgg network. Call
cutcutcodec.core.analysis.video.quality.lpips()on every frame.- psnrboolean, dafault=False
Trigger the spacial comparative quality PSNR metric. Call
cutcutcodec.core.analysis.video.quality.psnr()on every frame.- ssimboolean, default=False
Trigger the spacial comparative quality SSIM metric. Call
cutcutcodec.core.analysis.video.quality.ssim()on every frame.- uvqboolean, default=False
Trigger the spacial and temporal no-reference quality UVQ metric. Call
cutcutcodec.core.analysis.video.quality.uvq().- vmafboolean, default=False
Trigger the spacial comparative quality VMAF metric. Call
cutcutcodec.core.analysis.video.quality.vmaf.vmaf()on every frame.
Returns
- metricsdict[str, list[float]]
Associate the corresponding scalar values with each metric.
Notes
The color space of the distorted video is converted to the same as the reference video.
Examples
>>> import pprint >>> from cutcutcodec.core.analysis.video.metrics import video_metrics >>> from cutcutcodec.utils import get_project_root >>> video = get_project_root() / "media" / "video" / "intro.webm" >>> res = video_metrics(video, video, psnr=True, ssim=True) >>> pprint.pprint(res) {'psnr': [100.0, 100.0, ..., 100.0, 100.0], 'ssim': [1.0, 1.0, ..., 1.0, 1.0]} >>>
SeeAlso