This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

ProPainter Vapoursynth filter
#3
Got the GPU working in my current R68 test setup, using:
# Imports
import vapoursynth as vs
# getting Vapoursynth core
import site
import sys
import os
core = vs.core
# Import scripts folder
scriptPath = 'F:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
os.environ["CUDA_MODULE_LOADING"] = "LAZY"
#os.environ["CUDA_LAUNCH_BLOCKING"] = "1"
# loading plugins
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/SourceFilter/LSmashSource/LSMASHSource.dll")
# Import scripts
import validate
clip = core.lsmas.LWLibavSource(source=r"running_car.mp4", format="YUV420P8", stream_index=0, cache=0, fpsnum=25,repeat=True, prefer_hw=0)
frame = clip.get_frame(0)
# Setting detected color matrix (709).
clip = core.std.SetFrameProps(clip=clip, _Matrix=1)
# setting color transfer (709), if it is not set.
if validate.transferIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Transfer=1)
# setting color primaries info (to 709), if it is not set.
if validate.primariesIsInvalid(clip):
  clip = core.std.SetFrameProps(clip=clip, _Primaries=1)
# setting color range to TV (limited) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=1)
# making sure frame rate is set to 25fps
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# making sure the detected scan type is set (detected: progressive)
clip = core.std.SetFrameProps(clip=clip, _FieldBased=0) # progressive
# changing range from limited to full range for propainter
clip = core.resize.Bicubic(clip, range_in_s="limited", range_s="full")
# setting color range to PC (full) range.
clip = core.std.SetFrameProps(clip=clip, _ColorRange=0)
# adjusting color space from YUV420P8 to RGB24 for propainter
clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_s="full")
# adding colors using propainter
from vspropainter import propainter
org = clip
clip = propainter(clip, length=25, mask_path="running_car_mask.png", device_index=0)
clip = core.std.StackHorizontal([org.text.Text("Original"), clip.text.Text("Filtered")])
# changing range from full to limited range for propainter
clip = core.resize.Bicubic(clip, range_in_s="full", range_s="limited")
# adjusting output color from: RGB24 to YUV420P8
clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="709", range_s="limited")
# set output frame rate to 25fps (progressive)
clip = core.std.AssumeFPS(clip=clip, fpsnum=25, fpsden=1)
# output
clip.set_output()
the color shift is present there too:
[Image: grafik.png]
I'll package and upload my current R68 setup to my GoogleDrive. (this will take me ~1hour, 5min compression, 55min upload)

=> Package is uploaded
So once:
a. the color issue is fixed
b. instead of a single image a video/mask clip can be provided as input
the filter could be added to Hybrid in a future version. (R68 torch addon is not really ready for general usage)
@Dan64:could it be a RGB vs. BGR issue?
Yes, adding:
# rgb to bgr
clip = vs.core.std.ShufflePlanes(clips=clip,planes=[2,1,0], colorfamily=vs.RGB)
below:
ppaint = ModelProPainter(device, weights_dir, mask_path, mask_dilation, neighbor_length,
                         ref_stride, raft_iter)
in the __init__.py, fixes the colors:
[Image: grafik.png]
seems like a COLOR_BGR2RGB is missing somewhere.

Cu Selur

Ps.: works for poisondeathray over at Doom9s
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Messages In This Thread
ProPainter Vapoursynth filter - by Selur - 28.05.2024, 14:23
RE: ProPainter Vapoursynth filter - by Selur - 28.05.2024, 15:15
RE: ProPainter Vapoursynth filter - by Selur - 28.05.2024, 15:47
RE: ProPainter Vapoursynth filter - by Dan64 - 28.05.2024, 18:04
RE: ProPainter Vapoursynth filter - by Selur - 28.05.2024, 18:23
RE: ProPainter Vapoursynth filter - by Dan64 - 28.05.2024, 18:30
RE: ProPainter Vapoursynth filter - by Selur - 28.05.2024, 18:43
RE: ProPainter Vapoursynth filter - by Dan64 - 28.05.2024, 19:05
RE: ProPainter Vapoursynth filter - by Selur - 28.05.2024, 19:28
RE: ProPainter Vapoursynth filter - by Dan64 - 28.05.2024, 19:43
RE: ProPainter Vapoursynth filter - by Selur - 28.05.2024, 19:58
RE: ProPainter Vapoursynth filter - by Dan64 - 28.05.2024, 20:10
RE: ProPainter Vapoursynth filter - by Selur - 28.05.2024, 20:17
RE: ProPainter Vapoursynth filter - by Dan64 - 28.05.2024, 20:28
RE: ProPainter Vapoursynth filter - by Selur - 28.05.2024, 20:33
RE: ProPainter Vapoursynth filter - by Dan64 - 28.05.2024, 20:36
RE: ProPainter Vapoursynth filter - by Selur - 28.05.2024, 20:40
RE: ProPainter Vapoursynth filter - by Dan64 - 28.05.2024, 21:21
RE: ProPainter Vapoursynth filter - by Selur - 28.05.2024, 22:06
RE: ProPainter Vapoursynth filter - by Selur - 28.05.2024, 22:52
RE: ProPainter Vapoursynth filter - by Dan64 - 28.05.2024, 22:56
RE: ProPainter Vapoursynth filter - by Selur - 29.05.2024, 07:13
RE: ProPainter Vapoursynth filter - by Selur - 29.05.2024, 09:08
RE: ProPainter Vapoursynth filter - by Selur - 29.05.2024, 15:55
RE: ProPainter Vapoursynth filter - by Dan64 - 29.05.2024, 17:12
RE: ProPainter Vapoursynth filter - by Selur - 29.05.2024, 17:14
RE: ProPainter Vapoursynth filter - by Dan64 - 29.05.2024, 17:38
RE: ProPainter Vapoursynth filter - by Selur - 29.05.2024, 17:45
RE: ProPainter Vapoursynth filter - by Selur - 29.05.2024, 17:56
RE: ProPainter Vapoursynth filter - by Dan64 - 29.05.2024, 18:52
RE: ProPainter Vapoursynth filter - by Selur - 29.05.2024, 20:45
RE: ProPainter Vapoursynth filter - by Selur - 29.05.2024, 20:56
RE: ProPainter Vapoursynth filter - by Dan64 - 29.05.2024, 21:48
RE: ProPainter Vapoursynth filter - by Selur - 29.05.2024, 21:50
RE: ProPainter Vapoursynth filter - by Selur - 29.05.2024, 22:30
RE: ProPainter Vapoursynth filter - by Selur - 30.05.2024, 11:01
RE: ProPainter Vapoursynth filter - by Dan64 - 30.05.2024, 20:21
RE: ProPainter Vapoursynth filter - by Selur - 30.05.2024, 20:27
RE: ProPainter Vapoursynth filter - by Dan64 - 30.05.2024, 20:37
RE: ProPainter Vapoursynth filter - by Selur - 30.05.2024, 21:03
RE: ProPainter Vapoursynth filter - by Dan64 - 30.05.2024, 22:06
RE: ProPainter Vapoursynth filter - by Selur - 31.05.2024, 06:39
RE: ProPainter Vapoursynth filter - by Selur - 31.05.2024, 07:20
RE: ProPainter Vapoursynth filter - by Dan64 - 31.05.2024, 17:54
RE: ProPainter Vapoursynth filter - by Selur - 31.05.2024, 17:59
RE: ProPainter Vapoursynth filter - by Selur - 31.05.2024, 19:17
RE: ProPainter Vapoursynth filter - by Dan64 - 31.05.2024, 22:07
RE: ProPainter Vapoursynth filter - by Selur - 01.06.2024, 07:00
RE: ProPainter Vapoursynth filter - by Dan64 - 01.06.2024, 09:59
RE: ProPainter Vapoursynth filter - by Selur - 01.06.2024, 10:06
RE: ProPainter Vapoursynth filter - by Dan64 - 01.06.2024, 10:27
RE: ProPainter Vapoursynth filter - by Selur - 01.06.2024, 10:37
RE: ProPainter Vapoursynth filter - by Dan64 - 01.06.2024, 13:55
RE: ProPainter Vapoursynth filter - by Dan64 - 01.06.2024, 23:11
RE: ProPainter Vapoursynth filter - by Selur - 02.06.2024, 08:20
RE: ProPainter Vapoursynth filter - by Dan64 - 02.06.2024, 08:48
RE: ProPainter Vapoursynth filter - by Selur - 02.06.2024, 09:01
RE: ProPainter Vapoursynth filter - by Dan64 - 02.06.2024, 09:33
RE: ProPainter Vapoursynth filter - by Selur - 02.06.2024, 09:38
RE: ProPainter Vapoursynth filter - by Dan64 - 04.06.2024, 18:40
RE: ProPainter Vapoursynth filter - by Dan64 - 04.06.2024, 19:07
RE: ProPainter Vapoursynth filter - by Selur - 04.06.2024, 19:09
RE: ProPainter Vapoursynth filter - by Dan64 - 04.06.2024, 19:17
RE: ProPainter Vapoursynth filter - by Selur - 04.06.2024, 19:34
RE: ProPainter Vapoursynth filter - by Dan64 - 04.06.2024, 19:50
RE: ProPainter Vapoursynth filter - by Selur - 04.06.2024, 19:59
RE: ProPainter Vapoursynth filter - by Dan64 - 05.06.2024, 18:37
RE: ProPainter Vapoursynth filter - by Selur - 05.06.2024, 19:14
RE: ProPainter Vapoursynth filter - by Dan64 - 05.06.2024, 20:23
RE: ProPainter Vapoursynth filter - by Selur - 06.06.2024, 15:06
RE: ProPainter Vapoursynth filter - by Selur - 06.06.2024, 16:24
RE: ProPainter Vapoursynth filter - by Dan64 - 06.06.2024, 18:28
RE: ProPainter Vapoursynth filter - by Selur - 06.06.2024, 18:33
RE: ProPainter Vapoursynth filter - by Dan64 - 06.06.2024, 18:45
RE: ProPainter Vapoursynth filter - by Selur - 06.06.2024, 18:50
RE: ProPainter Vapoursynth filter - by safshe - 11.06.2024, 09:04
RE: ProPainter Vapoursynth filter - by Selur - 11.06.2024, 17:00
RE: ProPainter Vapoursynth filter - by Dan64 - 11.06.2024, 17:27
RE: ProPainter Vapoursynth filter - by Selur - 11.06.2024, 17:33
RE: ProPainter Vapoursynth filter - by Selur - 22.06.2024, 13:48
RE: ProPainter Vapoursynth filter - by Dan64 - 22.06.2024, 23:31
RE: ProPainter Vapoursynth filter - by Selur - 23.06.2024, 07:16
RE: ProPainter Vapoursynth filter - by Dan64 - 23.06.2024, 10:00
RE: ProPainter Vapoursynth filter - by Selur - 23.06.2024, 10:11
RE: ProPainter Vapoursynth filter - by Dan64 - 23.06.2024, 10:25
RE: ProPainter Vapoursynth filter - by Selur - 23.06.2024, 10:29
RE: ProPainter Vapoursynth filter - by Dan64 - 23.06.2024, 10:37
RE: ProPainter Vapoursynth filter - by Selur - 27.06.2024, 20:25
RE: ProPainter Vapoursynth filter - by Dan64 - 28.06.2024, 17:58
RE: ProPainter Vapoursynth filter - by Selur - 28.06.2024, 18:04
RE: ProPainter Vapoursynth filter - by Dan64 - 28.06.2024, 18:16
RE: ProPainter Vapoursynth filter - by Selur - 28.06.2024, 18:18
RE: ProPainter Vapoursynth filter - by Dan64 - 28.06.2024, 18:27
RE: ProPainter Vapoursynth filter - by Selur - 28.06.2024, 18:28
RE: ProPainter Vapoursynth filter - by Dan64 - 28.06.2024, 20:39
RE: ProPainter Vapoursynth filter - by Selur - 28.06.2024, 20:53
RE: ProPainter Vapoursynth filter - by Selur - 28.06.2024, 21:12
RE: ProPainter Vapoursynth filter - by Dan64 - 28.06.2024, 22:49
RE: ProPainter Vapoursynth filter - by Selur - 29.06.2024, 08:08
RE: ProPainter Vapoursynth filter - by Dan64 - 29.06.2024, 08:30
RE: ProPainter Vapoursynth filter - by Selur - 29.06.2024, 08:41
RE: ProPainter Vapoursynth filter - by Dan64 - 29.06.2024, 09:19
RE: ProPainter Vapoursynth filter - by Selur - 29.06.2024, 09:23
RE: ProPainter Vapoursynth filter - by Selur - 29.06.2024, 10:47
RE: ProPainter Vapoursynth filter - by Selur - 29.06.2024, 19:40
RE: ProPainter Vapoursynth filter - by Dan64 - 29.06.2024, 20:56
RE: ProPainter Vapoursynth filter - by Selur - 25.10.2024, 11:43
RE: ProPainter Vapoursynth filter - by Selur - 25.10.2024, 12:49
RE: ProPainter Vapoursynth filter - by Dan64 - 28.10.2024, 18:40
RE: ProPainter Vapoursynth filter - by Selur - 28.10.2024, 18:46
RE: ProPainter Vapoursynth filter - by Dan64 - 29.10.2024, 00:21
RE: ProPainter Vapoursynth filter - by Dan64 - 29.10.2024, 11:01
RE: ProPainter Vapoursynth filter - by Selur - 20.07.2025, 07:08
RE: ProPainter Vapoursynth filter - by Dan64 - 20.07.2025, 10:07
RE: ProPainter Vapoursynth filter - by Dan64 - 20.07.2025, 23:11
RE: ProPainter Vapoursynth filter - by Selur - 21.07.2025, 04:29

Forum Jump:


Users browsing this thread: 1 Guest(s)