![]() |
|
Deoldify Vapoursynth filter - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Talk, Talk, Talk (https://forum.selur.net/forum-5.html) +--- Forum: Small Talk (https://forum.selur.net/forum-7.html) +--- Thread: Deoldify Vapoursynth filter (/thread-3595.html) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
RE: Deoldify Vapoursynth filter - Dan64 - 03.10.2025 (03.10.2025, 19:48)Selur Wrote:Quote:In the new RC4, the following plugins: Retinex.dll, MiscFilters.dll, ReduceFlicker.dllOkay,.. sounds like a bad idea to me, but no problem. I tested it and it works. Here an example of loading the SCDetect filter vsutils_dir: str = os.path.dirname(os.path.realpath(__file__))
MiscFilter_dir: str = os.path.join(vsutils_dir, "..", "..", "..", "..", "..", "vsfilters", "MiscFilter", "MiscFilters")
def load_SCDetect_plugin() -> bool:
"""
Ensures SCDetect VapourSynth plugin is loaded.
"""
plugin_path = os.path.join(MiscFilter_dir, "MiscFilters.dll")
try:
if hasattr(vs.core, 'misc') and hasattr(vs.core.misc, 'SCDetect'):
HAVC_LogMessage(MessageType.INFORMATION,"[INFO] Plugin 'SCDetect' already loaded.")
return True
else:
vs.core.std.LoadPlugin(path=plugin_path)
HAVC_LogMessage(MessageType.INFORMATION, f"[INFO] Plugin 'SCDetect' loaded from: {plugin_path}")
return True
except Exception as error:
HAVC_LogMessage(MessageType.WARNING, "[WARNING] Plugin 'SCDetect': check/load failed ->", str(error))
return FalseThe code is path-independent and does not explicitly use directory separators. Dan RE: Deoldify Vapoursynth filter - Selur - 03.10.2025 Quote: The code is path-independent and does not explicitly use directory separators. MiscFilter_dir: str = os.path.join(vsutils_dir, "..", "..", "..", "..", "..", "vsfilters", "MiscFilter", "MiscFilters")Just saying, I think this is unwise, since it only works with the current structure and will break in case I ever rename or move a folder, or a non-Window setup is used. So just from a design point of view, I would advise against this. From my point of view, it would be better to throw an error if those filters are not available, but needed. It's your thing, I just wanted to give my input. Cu Selur RE: Deoldify Vapoursynth filter - Dan64 - 03.10.2025 (03.10.2025, 20:39)Selur Wrote:Quote: The code is path-independent and does not explicitly use directory separators. I'm not aware that HAVC is working also on not Windows OS, which are the supported OS ? In such case could you privide the names of DLLs for the non Windows OS ? Yes it is specific to Hybrid structure, so you should advise me in the case you decide to change it. I provide an error in the case of loading error, so that the DLLs can be added manually in the script if needed. I added this loading to be more free on which plugin load and use inside HAVC. But the 2 approaches are not exclusive and can be used both. Dan RE: Deoldify Vapoursynth filter - Selur - 03.10.2025 Quote:I'm not aware that HAVC is working also on not Windows OS, which are the supported OS ?Hybrid atm. does not offer torch add-on and similar on other OSs than Windows. (but this can be done )Quote:In such case could you privide the names of DLLs for the non Windows OS ?Names depend on how you compile them to be named. ![]() Quote:I added this loading to be more free on which plugin load and use inside HAVC.fine, by me, just wanted to note that it seems like a bad design. ![]() Cu Selur RE: Deoldify Vapoursynth filter - Dan64 - 05.10.2025 Hello Selur, I added some changes to B&W methods (method 5 and new method 6) as shown below :param BlackWhiteMode: Method used by BlackWhiteTune to perform colors adjustments.
Allowed values are:
0 : Apply Contrast Limited Adaptive Histogram Equalization on Luma (default)
1 : Apply Simple Histogram Equalization on all RGB channels
2 : Apply CLAHE on all RGB channels
3 : method=0 and method=1 are merged
4 : Automatic brightness and contrast optimization with ScaleAbs
5 : Multi-Scale Retinex (HAVC) <-- "on Luma" replaced by "(HAVC)"
6 : Multi-Scale Retinex (B&W) <-- new method #6I hope that you can release an updated test version. Thanks, Dan RE: Deoldify Vapoursynth filter - Selur - 05.10.2025 Uploaded a new test version. Cu Selur RE: Deoldify Vapoursynth filter - Dan64 - 05.10.2025 I was finally able to find a way to get colorful and stable video clips. Here a sample using Retinex (HAVC version) + "Video+Artistic" (Constrained-Chroma merge, veryvivid) + tweaks https://archive.org/details/young-frankenstein.-bw.-720p.-test/YoungFrankenstein.BW.720p.Test_ddcolor_CC_veryvivid_retinex.mp4 The combine method Constrained-Chroma is already able to filter-out most of flashing colors, but to get the best result is possible to add to the above settings the temporal stabilizer https://archive.org/details/young-frankenstein.-bw.-720p.-test/YoungFrankenstein.BW.720p.Test_ddcolor_CC_veryvivid_retinex_stabilizer.mp4 Dan RE: Deoldify Vapoursynth filter - zspeciman - 05.10.2025 Dan, these results are amazing!!! A huge step forward. I always thought there was something special about retinex, but it had many issues that now appear to be resolved. Looking forward for this to be released and reading the new user guide. RE: Deoldify Vapoursynth filter - didris - 06.10.2025 this retinex really gives good results but why can't i load it in the hybrid preview # Imports
import vapoursynth as vs
# getting Vapoursynth core
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'E:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# loading plugins
core.std.LoadPlugin(path="E:/Hybrid/64bit/vsfilters/ColorFilter/Retinex/Retinex.dll")
core.std.LoadPlugin(path="E:/Hybrid/64bit/vsfilters/MiscFilter/MiscFilters/MiscFilters.dll")
core.std.LoadPlugin(path="E:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
# Import scripts
import vsdeoldify as havc
import validate
# Source: 'E:\download\Houdini Archival Footage.mp4'
# Current color space: YUV420P8, bit depth: 8, resolution: 640x480, frame rate: 29.97fps, scanorder: progressive, yuv luminance scale: limited, matrix: 470bg, transfer: bt.709, primaries: bt.601 ntsc, format: AVC
# Loading E:\download\Houdini Archival Footage.mp4 using LWLibavSource
clip = core.lsmas.LWLibavSource(source="E:/download/Houdini Archival Footage.mp4", format="YUV420P8", stream_index=1, cache=0, prefer_hw=0)
frame = clip.get_frame(0)
# setting color matrix to 470bg.
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT470_BG)
# setting color transfer (vs.TRANSFER_BT709), if it is not set.
if validate.transferIsInvalid(clip):
clip = core.std.SetFrameProps(clip=clip, _Transfer=vs.TRANSFER_BT709)
# setting color primaries info (to vs.PRIMARIES_BT470_BG), if it is not set.
if validate.primariesIsInvalid(clip):
clip = core.std.SetFrameProps(clip=clip, _Primaries=vs.PRIMARIES_BT470_BG)
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_LIMITED)
# making sure frame rate is set to 29.97fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# making sure the detected scan type is set (detected: progressive)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=vs.FIELD_PROGRESSIVE) # progressive
# changing range from limited to full range for
clip = core.resize.Bicubic(clip, format=vs.YUV420P8, range_in_s="limited", range_s="full")
# setting color range to PC (full) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=vs.RANGE_FULL)
# changing color matrix from '470bg' to '709' for vsHAVC
clip = core.resize.Bicubic(clip, matrix_in_s="470bg", matrix_s="709")
# adjusting color space from YUV420P8 to RGB24 for vsHAVC
clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_in_s="full", range_s="full")
# adding colors using HAVC
clip = havc.HAVC_main(clip=clip, Preset="medium", VideoTune="balanced", ColorFix="none", ColorTune="none", BlackWhiteTune="none")
# internally changing color matrix for YUV<>RGB to '470bg' undoing color matrix change for vsHAVC
clip = core.std.Crop(clip=clip, left=2, right=2, top=0, bottom=0)# cropping to 636x480
# color adjustment using Retinex
clip = core.retinex.MSRCP(input=clip, sigma=[25,80,250], fulls=True, fulld=True)
# adjusting output color from: RGB24 to YUV420P10 for x265Model
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="470bg", range_in_s="full", range_s="full") # additional resize to allow target color sampling
# set output frame rate to 29.97fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=30000, fpsden=1001)
# output
clip.set_output()2025-10-06 12:07:53.662
Failed to evaluate the script:
Python exception: Failed to load E:/Hybrid/64bit/vsfilters/ColorFilter/Retinex/Retinex.dll. GetLastError() returned 126. The file you tried to load or one of its dependencies is probably missing.
Traceback (most recent call last):
File "src/cython/vapoursynth.pyx", line 3378, in vapoursynth._vpy_evaluate
File "src/cython/vapoursynth.pyx", line 3379, in vapoursynth._vpy_evaluate
File "C:\Users\nfoga\AppData\Local\Temp\tempPreviewVapoursynthFile12_07_53_393.vpy", line 11, in
core.std.LoadPlugin(path="E:/Hybrid/64bit/vsfilters/ColorFilter/Retinex/Retinex.dll")
File "src/cython/vapoursynth.pyx", line 3114, in vapoursynth.Function.__call__
vapoursynth.Error: Failed to load E:/Hybrid/64bit/vsfilters/ColorFilter/Retinex/Retinex.dll. GetLastError() returned 126. The file you tried to load or one of its dependencies is probably missing.Whatever I do, I always get this error and it doesn't code accordingly Maybe I didn't install something? i use: Hybrid_dev_2025.10.04-173743.exe VapoursynthR72_torch_2025.09.25.7z windows 11 pro RE: Deoldify Vapoursynth filter - Selur - 06.10.2025 about Retinex: try installing Microsoft Visual C++ Redistributable 2013 Package about using HAVC with Retinex like Dan64 showcased: that would require the non-public test version, only Dan64 has access to, and an updated torch environment. (the public releases of HAVC do not support this atm.) Cu Selur |