cutcutcodec.core.analysis.video.metrics.video_metrics¶
- 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.
Note
The distorted video is “aligned” on the reference video. This means that the rate, resolution and colorspace are automatically managed in a consistent manner.
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, default=False
Trigger the spacial comparative quality PSNR metric. Call
cutcutcodec.core.analysis.video.quality.psnr()on every frame.- rms_sobelboolean, default=False
Trigger the spacial root mean square sobel gradient complexity. Call
cutcutcodec.core.analysis.video.complexity.rms_sobel()on every frame.- rms_time_diffboolean, default=False
Trigger the temporal root mean square time difference complexity. Call
cutcutcodec.core.analysis.video.complexity.rms_time_diff()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().- vifboolean, default=False
Trigger the spacial comparative quality VIF metric. Call
cutcutcodec.core.analysis.video.quality.vif()on every frame.- 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.
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, rms_sobel=True) >>> pprint.pprint(res) {'psnr': [100.0, 100.0, ..., 100.0, 100.0], 'rms_sobel': [0.0036468505859375, 0.0036468505859375, ..., 0.0033111572265625, 0.000560760498046875], 'ssim': [1.0, 1.0, ..., 1.0, 1.0]} >>>
SeeAlso¶