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.

scratch removal
#5
Quick test with inpainting through VSGAN, proPainter should be better, but for that resolution is too high:
# Imports
import vapoursynth as vs
import os
import sys
# getting Vapoursynth core
core = vs.core
# Import scripts folder
scriptPath = 'F:/Hybrid/64bit/vsscripts'
sys.path.insert(0, os.path.abspath(scriptPath))
# Loading Plugins
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/fmtconv.dll")
core.std.LoadPlugin(path="F:/Hybrid/64bit/vsfilters/Support/libimwri.dll")
# Import scripts
import mvsfunc

# Loading C:\Users\Selur\Desktop\photo_1.png using vsImageReader
clip = core.imwri.Read(["C:/Users/Selur/Desktop/nR0xQ2PL3Utd.png"])
clip = core.std.Loop(clip=clip, times=100)
# Input color space is assumed to be RGB24

# resizing using VSGAN
from vsgan import ESRGAN
mask = core.imwri.Read(["C:/Users/Selur/Desktop/mask.png"])
mask = core.std.BinarizeMask(mask,threshold=16)
mask = core.std.Maximum(mask)
mask = core.std.Maximum(mask)
green = core.std.BlankClip(clip, color=[0,255,0])
clip = core.std.MaskedMerge(clip, green , mask) # masked clip

org = clip
vsgan = ESRGAN(clip=clip,device="cuda")
model = "F:/Hybrid/64bit/vsgan_models/1x_NMKD-YandereInpaint_375000_G.pth"
vsgan.load(model)
vsgan.apply()
clip = vsgan.clip

clip = core.std.StackHorizontal([org, clip])

# Output
clip.set_output()

[Image: grafik.png]
Not that good, but tunning multiple Inpainting calls with multiple masks probably would work even when using this inpainting model.

Another 1pass cv based inpainting examples using https://github.com/dnjulek/VapourSynth-cv_inpaint:
InpaintFSR:
[Image: Inpaint-FSR.png]
InpaintNS:
[Image: Inpaint-NS.png]
InpaintShiftMap:
[Image: Inpaint-Shiftmap.png]
InpaintTelea:
[Image: Inpaint-Telea.png]
like I wrote multiple inpainting passes with different masks will probably help more.

Cu Selur
Ps.: https://forum.doom9.org/showthread.php?t=184485 might also be interessting.
Reply


Messages In This Thread
scratch removal - by mohanohi - 16.10.2024, 16:54
RE: scratch removal - by Selur - 16.10.2024, 18:20
RE: scratch removal - by mohanohi - 16.10.2024, 19:05
RE: scratch removal - by Selur - 16.10.2024, 19:19
RE: scratch removal - by Selur - 16.10.2024, 19:34
RE: scratch removal - by mohanohi - 05.11.2024, 18:35
RE: scratch removal - by Selur - 05.11.2024, 18:43
RE: scratch removal - by mohanohi - 05.11.2024, 18:57

Forum Jump:


Users browsing this thread: 2 Guest(s)