Vship icon indicating copy to clipboard operation
Vship copied to clipboard

Differing Results from vszip/julek plugins

Open gianni-rosato opened this issue 1 year ago • 2 comments

Hello,

Love the project, big fan :) just running into one small issue which is likely user error on my part, but I want to open this issue in GitHub for transparency.

My vapoursynth config is as follows:

core = vs.core
if self.gpu_threads:
    core.num_threads = self.gpu_threads
video = core.ffms2.Source(source=self.path, cache=False, threads=int(-1))
video = video.resize.Bicubic(format=vs.RGBS, matrix_in_s="709")
if self.e > 1:
    video = video.std.SelectEvery(cycle=self.e, offsets=0)

And my vship invocations are detailed below:

SSIMULACRA2

if self.gpu_threads:
    print("Using GPU threads for SSIMULACRA2 calculation.")
    ssimu2_obj = src.video.vship.SSIMULACRA2(self.video)
else:
    ssimu2_obj = src.video.vszip.Metrics(self.video, [0])

ssimu2_list: list[float] = []
with tqdm(
    total=ssimu2_obj.num_frames,
    desc="Calculating SSIMULACRA2 scores",
    unit=" frame",
    colour="blue",
) as pbar:
    for i, f in enumerate(ssimu2_obj.frames()):
        ssimu2_list.append(f.props["_SSIMULACRA2"])
        pbar.update(1)
        if not i % 24:
            avg: float = sum(ssimu2_list) / len(ssimu2_list)
            pbar.set_postfix(
                {
                    "avg": f"{avg:.2f}",
                }
            )

self.ssimu2_avg, self.ssimu2_hmn, self.ssimu2_sdv, self.ssimu2_p10 = (
    calc_some_scores(ssimu2_list)
)

Butteraugli

if self.gpu_threads:
    print("Using GPU threads for Butteraugli calculation.")
    butter_obj = src.video.vship.BUTTERAUGLI(self.video)
else:
    butter_obj = src.video.julek.Butteraugli(self.video, [0])

butter_distance_list: list[float] = []
with tqdm(
    total=butter_obj.num_frames,
    desc="Calculating Butteraugli scores",
    unit=" frame",
    colour="yellow",
) as pbar:
    for i, f in enumerate(butter_obj.frames()):
        d: float = f.props["_FrameButteraugli"] if not self.gpu_threads else f.props["_BUTTERAUGLI_INFNorm"]
        butter_distance_list.append(d)
        pbar.update(1)
        if not i % 24:
            dis: float = sum(butter_distance_list) / len(butter_distance_list)
            pbar.set_postfix(
                {
                    "dis": f"{dis:.2f}",
                }
            )

I'm getting the following scores on a sample clip run on park_joy_444_720p25.m4v:

CPU-only (vszip & julek plugins):

SSIMULACRA2 scores for every 1 frame:
 Average:       59.44028
 Harmonic Mean: 59.25975
 Std Deviation: 3.40644
 10th Pctile:   56.21839
Butteraugli scores for every 1 frame:
 Distance:      5.52357
 Max Distance:  15.24870

GPU (vship):

SSIMULACRA2 scores for every 1 frame:
 Average:       63.24196
 Harmonic Mean: 63.09160
 Std Deviation: 3.19993
 10th Pctile:   60.31424
Butteraugli scores for every 1 frame:
 Distance:      5.42507
 Max Distance:  14.55254

These scores are pretty dramatically different between vszip and vship. Am I doing something incorrectly with my Vapoursynth configuration? Any help or advice would be appreciated, thanks so much!

gianni-rosato avatar Feb 08 '25 01:02 gianni-rosato

Source: https://fileditchfiles.me/file.php?f=/s21/qLbcfewBFYMbVdDtNFXH.m4v Encode (ivf file contained): encode_test.zip

gianni-rosato avatar Feb 08 '25 02:02 gianni-rosato

Thank you very much for the issue! I was able to find the problem. I downscaled the gamma rgb instead of the linear rgb

SSIMU2 for files qLbcfewBFYMbVdDtNFXH.mp4 and encode_test.ivf Mean : 59.63370409011841 Standard deviation : 3.426783091943927 Median : 58.7172966003418 5th percentile : 55.774532318115234 95th percentile : 68.77005004882812

vship ssimu2 had 64.65414773157309 fps


SSIMU2 for files qLbcfewBFYMbVdDtNFXH.mp4 and encode_test.ivf Mean : 59.537290640566845 Standard deviation : 3.420030442505646 Median : 58.618131299070136 5th percentile : 55.698373733125585 95th percentile : 68.6753085644906

result now

Line-fr avatar Feb 12 '25 19:02 Line-fr