dssim icon indicating copy to clipboard operation
dssim copied to clipboard

Feature request: set `scale_weights` in CLI

Open homm opened this issue 2 years ago • 7 comments

In my understanding this is a key parameter which should not be hardcoded, since it mostly depends on how the image is showed to the user. At least I believe scale_weights should be different for 2x and 1x images.

The possible syntax:

dssim --weights 0.028,0.197,0.322,0.298,0.155 file.png modified1.png

As a bonus, this unleashes the easy way to turn multiple-resolution comparison to single-resolution just by defining --weights 1.

By the way I'm wondering how the current DEFAULT_WEIGHTS was chosen. There is a comment in the code: "inspired by the IW-SSIM, but details of the algorithm and weights are different" but without details.

homm avatar May 15 '22 13:05 homm

These hyperparameters are dependent on viewing conditions indeed. They've been tuned (or overfitted 😄) for the TID2013 dataset.

It would be nice to have something for 2x images. Perhaps just shifting them by one would be okay? But without a dataset to validate this, it'd be only guessing.

I'd rather not expose that in CLI as raw numbers, because if I don't have a way to set better values, I don't expect users to be able to either.

kornelski avatar May 16 '22 12:05 kornelski

Perhaps just shifting them by one would be okay?

Hmm, this will mean that the best 2x image is a good quality 1x image scale up bicubically :-)

To be honest, I'm surprised that the first layer is 7 times less significant than second. This is the first thing I'd like to experiment with if this functionality will be available.

homm avatar May 17 '22 08:05 homm

You can experiment with it by recompiling the program. Compiling Rust is a bit slow, but not difficult.

kornelski avatar May 18 '22 12:05 kornelski

To be honest, I'm surprised that the first layer is 7 times less significant than second.

Agree. I've experimented with only 2 scales (WEIGHTS = [0.2, 0.8]) and it shows reasonable results.

igv avatar May 19 '22 02:05 igv

How did you verify "reasonable"? The weights affect the TID benchmark by about 3%, so it's not something you can eyeball.

kornelski avatar May 19 '22 12:05 kornelski

I've used images from this comparison and compared results to VIFp (I think now I prefer this metric over MS-SSIM).

igv avatar May 19 '22 13:05 igv

I'm sure you've already seen this thread, but I'd like to add it here for others who will read the issue.

There's no excuse for using 1x density in any modern codec test, unless you're testing specifically for a minority of users. Jake Archibald, Developer advocate working on Chrome

https://twitter.com/jaffathecake/status/1531337906027102210

homm avatar May 31 '22 12:05 homm