cutcutcodec.core.analysis.video.quality.vmaf_torch.vmaf.VMAF

class cutcutcodec.core.analysis.video.quality.vmaf_torch.vmaf.VMAF(enable_motion=True, clip_score=False, NEG=False, model_json_path=None)[source]

VMAF module Args:

enable_motion (bool): if False set motion for all frames to 0 e.g. when computing on batch of images instead of video clip_score (bool): if True clip final VMAF score to [0,100] NEG (bool): if True compute VMAF NEG version, if False compute regular VMAF model_json_path (str): path to custom SVM model json, if None default model is used

Initialize internal Module state, shared by both nn.Module and ScriptModule.

compute_adm_features(ref, dist)[source]

Compute one ADM feature for each scale

compute_adm_features_and_score(ref, dist)[source]

Compute ADM features and score (faster then calling individual functions due to computation sharing)

compute_adm_score(ref, dist)[source]

Compute ADM score using all 4 image scales

compute_motion2(ref)[source]

Compute motion2 feature

compute_vif_features(ref, dist)[source]

Compute one VIF feature for each scale

compute_vif_features_and_score(ref, dist)[source]

Compute VIF features and score (faster then calling individual functions due to computation sharing)

compute_vif_score(ref, dist)[source]

Compute VIF score using all 4 image scales

compute_vmaf_features_and_score(ref, dist)[source]

Compute VMAF score and needed features (faster then calling individual functions due to computation sharing)

compute_vmaf_score(ref, dist)[source]

Computation of VMAF score Args:

ref: An input tensor with [N, 1, H, W] shape, reference image, Y channel only, in range [0,255]

first dimension is frame dimension for video or batch dimension for batch of images

dist: An input tensor with [N, 1, H, W] shape, distorted image, Y channel only, in range [0,255],

order of arguments matters!

Returns:

Value of VMAF metric.

forward(ref, dist)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

table(ref, dist)[source]

Compute table with features and score for each frame similar to csv produced by vmaf command line tool with –csv argument Args:

ref: An input tensor with [N, 1, H, W] shape, reference image, Y channel only, in range [0,255]

first dimension is frame dimension for video or batch dimension for batch of images

dist: An input tensor with [N, 1, H, W] shape, distorted image, Y channel only, in range [0,255],

order of arguments matters!

Returns:

pandas DataFrame