I completed the development of vs-deoldify 4.5.0.
I attached the last version RC20 (I hope).
Respect to the previous version, now it is raised an exception in the case ColorMNet[remote] could not be initialized.
I also improved the change scene detection implementation.
I spent a lot of time trying the available scene detection implementations, including PySceneDetect and CLIP
Unfortunately none of them was good enough to detected correctly all the scenes in the clips used for testing.
If an implementation was good for a clip it was not good for another and vice-versa.
At the end the Vapoursynth implementation of scene detection resulted to be the most general purposes and faster implementation tested.
So that I decided to improve it, using the following approach:
Run the scene detection with high sensitivity parameters:
sc_threshold = 0.03
sc_min_freq = 5
In this way all the scenes change are detected for sure. The problem is that in this way are identified as scene change also frames that are very similar.
To handle this problem I introduced a scene detection filter based on SSIM (Structural Similarity Index Metric) that analyse the frames selected in the previous step and discard the frames that are similar. The SSIM implementation is quite complex and is slow (I used the skimage implementation), but by applying it only on the selected frames, the impact on speed encoding is low (only 3% slower).
To manage the SSIM filter I introduced the parameter sc_tht_ssim that represent the threshold to be used to discard similar images. Suggested values are between 0.45-0.65, being 0.60 the most effective. By default this parameter is set to 0, so that this second step filter is disabled.
I attached the new version RC21, where I increaded the values of sc_tht_black and sc_tht_white (2 parameters not exported to GUI).
Don't worry about the high sensitivity of sc_threshold. All the similar frames will be discarded by SSIM.
The pre-filter with misc.SCDetect() is necessary only to reduce the number of frames to be analysed by SSIM.
SCDetect with threshold = 0.05 will generate only one frame.
All the method tested provided wrong selections (see folders).
SCDetect with threshold = 0.03 detected too many frames (13)
SCDetect with threshold = 0.03 and sc_tht_ssim = 0.4 provided only 5 frames.
try also your scene change detection implementations to test what happen.
06.10.2024, 17:40 (This post was last modified: 06.10.2024, 17:46 by Selur.)
They all have issues with these blend scene changes and either see no scene change, of if the threshold is lowered see way too many.
(totally forgot that sc.Detect is the predecessor of misc.SCDetect)
Cu Selur
Ps.: when doing the scene change detection, to speed things up, you could always resize the clip to ...x320.
In this version, the speed GUI "Preset" (fast, medium, slow) will apply also to ColorMNet.
Also the GUI parameters "Ref merge", "Weight", "Threshold" are now applicable to ColorMNet.
In order to allow SCDetect() to perform better on blend scenes I introduced a new boolean parameter "sc_normalize" in HAVC_ddeoldify() and "ScNormalize" in HAVC_main().
If this flag is enabled, the B&W frames used by misc.SCDetect() will be "normalized", in this way the SCDetect() filter will be more sensible and will be able to detect more blend scenes.
Quote: In order to allow SCDetect() to perform better on blend scenes I introduced a new boolean parameter "sc_normalize" in HAVC_ddeoldify() and "ScNormalize" in HAVC_main().
If this flag is enabled, the B&W frames used by misc.SCDetect() will be "normalized", in this way the SCDetect() filter will be more sensible and will be able to detect more blend scenes.