@Dan64: I'm trying to remove the logo mentioned
here of
this clip.
I created a
video mask
Code I used to create the logo:
clip = clip.resize.Bicubic(format=vs.RGBS)
# Extract R, G, B planes
r = clip.std.ShufflePlanes(0, vs.GRAY)
g = clip.std.ShufflePlanes(1, vs.GRAY)
b = clip.std.ShufflePlanes(2, vs.GRAY)
# Build an expression that detects yellow-ish pixels:
# - R and G are both high (>= 0.6)
# - B is relatively low (<= 0.5)
expr = "x 0.6 > y 0.6 > and z 0.5 < and x y - abs 0.1 < and 1 0 ?"
mask = core.std.Expr([r, g, b], expr=[expr])
# Clean up the mask
clip = mask.std.Inflate().std.Minimum().std.Minimum().std.Convolution(matrix=[1]*9).std.Maximum().std.Maximum()
clip = core.std.SetFrameProps(clip, _Matrix=vs.MATRIX_BT709)
# colorformat GRAYS
which seems fine covering the logo for most of the clip.
Problem is when using:
# Inpainting using ProPainter
from vspropainter import propainter as ProPainter
clipMask = core.lsmas.LWLibavSource(source="G:/Output/logo_mask2.mp4", format="RGB24", cache=0)
clip = ProPainter(clip=clip, clip_mask=clipMask, length=500, neighbor_length=20, raft_iter=10, mask_region=(500,256,390,240))
starting with frame 149 the logo reappears (isn't properly removed).
![[Image: grafik.png]](https://i.ibb.co/VWtcFGS3/grafik.png)
the mask clip properly covers the logo:
![[Image: grafik.png]](https://i.ibb.co/sd2D4pjZ/grafik.png)
If I reduce the length to 20, logo is gone until 160,...
I first thought this could this be a bug in the length&co parameter handling, for the edge case where the end of the clip is approached, in the wrapper.
To test my theory, I added clip + core.std.Reverse(clip).std.Trim(1), created a new mask clip and used that to look at frame 149+.
That didn't help, it even seemed to make it worse. Then I thought maybe the scene threshold was the issue, so I set that to 0, but that also didn't help.
Last thing I tried was disabling the mask region, but that also didn't really help either.
Do you think this is a problem of:
a. finding the right parameters
b. a bug in the wrapper
c. ProPainter just strangely failing
?
Cu Selur