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.

DeepEnhancer
#56
Here's a Vapoursynth port or RemoveDirtSMC, but normal RemoveDirtMC seems superior.
The S seems to stand for 'simple'.
def RemoveTempGrain(clip: vs.VideoNode, mode: int=17) -> vs.VideoNode:
  if hasattr(core, 'zsmooth'):
    rg = core.zsmooth.RemoveGrain(clip, mode=mode)
  else:
    rg = core.rgvs.RemoveGrain(clip, mode=mode)
  return TemporalRepair(rg, clip)

def RemoveDirtS(clip: vs.VideoNode, limit: int= 6, grey: bool=False) -> vs.VideoNode:
  clensed = core.rgvs.Clense(clip)
  if hasattr(core, 'zsmooth'):
    alt = core.zsmooth.RemoveGrain(clip, mode=10)
  else:
    alt = core.rgvs.RemoveGrain(clip, mode=10)
  return core.removedirt.RestoreMotionBlocks(clensed, clip, alternative=alt, pthreshold=4, cthreshold=6, gmthreshold=40, dist=1, dmode=2, debug=False, noise=limit, noisy=16, grey=False)

def RemoveDirtSMC(clip: vs.VideoNode, limit: int=6, repmode: int=16, remgrainmode: int=17, block_size: int=8, block_over: int=4, gpu: bool=False) -> vs.VideoNode:
  
  if gpu:
    import ChangeFPS
    block_over = 0 if block_over == 0 else 1 if block_over == 2 else 2 if block_over == 4 else 3
    Super = core.svp1.Super(clip, "{gpu:1,pel:4}")
    bvec = core.svp1.Analyse(Super['clip'], Super['data'], clip, "{ gpu:1, block:{w:"+str(block_size)+", h:"+str(block_size)+",overlap:"+str(block_over)+"} }")
    fvec = core.svp1.Analyse(Super['clip'], Super['data'], clip, "{ gpu:1, block:{w:"+str(block_size)+", h:"+str(block_size)+",overlap:"+str(block_over)+",special:{delta: 1}} }")
    backw = core.svp2.SmoothFps(clip,Super['clip'], Super['data'],bvec['clip'],bvec['data'],"{}") # here the frame rate is doubled
    forw = core.svp2.SmoothFps(clip,Super['clip'], Super['data'],fvec['clip'],fvec['data'],"{}")  # here the frame rate is doubled
    # since backw and forw now have twice the frame count I drop half the frames
    backw = ChangeFPS.ChangeFPS(backw,clip.fps_num,clip.fps_den)
    forw = ChangeFPS.ChangeFPS(forw,clip.fps_num,clip.fps_den)
  else:
    #block size of MAnalyze, blksize 8 is much better for 720x576 noisy source than blksize=16
    #block overlapping of MAnalyze 0! 2 or 4 is not good for my noisy b&w 8mm film source
    i = core.mv.Super(clip, pel=2, sharp=2)    #  avs: i=MSuper(clip,pel=2, isse=false)
    bvec = core.mv.Analyse(super=i,isb=True, blksize=block_size,overlap=block_over, delta=1, truemotion=True, chroma=True)  
    fvec = core.mv.Analyse(super=i,isb=False, blksize=block_size,overlap=block_over, delta=1, truemotion=True, chroma=True)
    backw = core.mv.Flow(clip=clip,super=i,vectors=[bvec])
    forw  = core.mv.Flow(clip=clip,super=i,vectors=[fvec])

  clip    = core.std.Interleave([backw, clip, forw])
  clip    = RemoveDirtS(clip, limit)
  if hasattr(core, 'zsmooth'):
    clip = core.zsmooth.RemoveGrain(clip, mode=10)
  else:
    clip = core.rgvs.RemoveGrain(clip, mode=10)
    
  clip = core.std.SelectEvery(clip, 3, 1)

  return clip
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Messages In This Thread
DeepEnhancer - by djilayeden - 04.04.2025, 00:52
RE: Deoldify Vapoursynth filter - by Selur - 04.04.2025, 04:13
RE: Deoldify Vapoursynth filter - by Selur - 04.04.2025, 13:57
RE: Deoldify Vapoursynth filter - by safshe - 04.04.2025, 16:17
RE: Deoldify Vapoursynth filter - by Dan64 - 04.04.2025, 18:41
RE: DeepEnhancer - by Selur - 04.04.2025, 19:30
RE: DeepEnhancer - by djilayeden - 04.04.2025, 21:08
RE: DeepEnhancer - by zspeciman - 04.04.2025, 21:32
RE: DeepEnhancer - by Selur - 04.04.2025, 22:15
RE: DeepEnhancer - by Selur - 05.04.2025, 10:11
RE: DeepEnhancer - by Dan64 - 05.04.2025, 10:41
RE: DeepEnhancer - by Selur - 05.04.2025, 11:07
RE: DeepEnhancer - by djilayeden - 05.04.2025, 14:09
RE: DeepEnhancer - by zspeciman - 05.04.2025, 14:35
RE: DeepEnhancer - by Selur - 05.04.2025, 14:52
RE: DeepEnhancer - by djilayeden - 05.04.2025, 15:28
RE: DeepEnhancer - by Selur - 05.04.2025, 17:08
RE: DeepEnhancer - by zspeciman - 05.04.2025, 17:26
RE: DeepEnhancer - by Selur - 05.04.2025, 17:34
RE: DeepEnhancer - by djilayeden - 05.04.2025, 18:39
RE: DeepEnhancer - by Dan64 - 06.04.2025, 11:39
RE: DeepEnhancer - by Selur - 06.04.2025, 13:02
RE: DeepEnhancer - by Dan64 - 06.04.2025, 13:28
RE: DeepEnhancer - by Selur - 06.04.2025, 13:45
RE: DeepEnhancer - by Selur - 06.04.2025, 15:58
RE: DeepEnhancer - by Dan64 - 06.04.2025, 20:09
RE: DeepEnhancer - by Selur - 06.04.2025, 20:12
RE: DeepEnhancer - by Dan64 - 06.04.2025, 20:20
RE: DeepEnhancer - by Selur - 06.04.2025, 20:43
RE: DeepEnhancer - by Selur - 06.04.2025, 21:29
RE: DeepEnhancer - by Dan64 - 06.04.2025, 21:29
RE: DeepEnhancer - by Selur - 06.04.2025, 21:41
RE: DeepEnhancer - by djilayeden - 06.04.2025, 21:44
RE: DeepEnhancer - by Dan64 - 06.04.2025, 21:56
RE: DeepEnhancer - by Selur - 07.04.2025, 05:10
RE: DeepEnhancer - by Selur - 07.04.2025, 16:13
RE: DeepEnhancer - by Dan64 - 10.04.2025, 00:49
RE: DeepEnhancer - by zspeciman - 10.04.2025, 14:42
RE: DeepEnhancer - by Selur - 10.04.2025, 15:18
RE: DeepEnhancer - by djilayeden - 11.04.2025, 15:47
RE: DeepEnhancer - by Selur - 11.04.2025, 20:26
RE: DeepEnhancer - by Dan64 - 12.04.2025, 00:09
RE: DeepEnhancer - by Dan64 - 12.04.2025, 12:36
RE: DeepEnhancer - by Selur - 12.04.2025, 12:43
RE: DeepEnhancer - by djilayeden - 12.04.2025, 13:26
RE: DeepEnhancer - by Dan64 - 12.04.2025, 13:44
RE: DeepEnhancer - by Dan64 - 12.04.2025, 15:24
RE: DeepEnhancer - by Selur - 12.04.2025, 15:47
RE: DeepEnhancer - by djilayeden - 12.04.2025, 15:52
RE: DeepEnhancer - by Selur - 12.04.2025, 15:56
RE: DeepEnhancer - by djilayeden - 12.04.2025, 15:59
RE: DeepEnhancer - by Selur - 12.04.2025, 16:51
RE: DeepEnhancer - by Dan64 - 12.04.2025, 17:16
RE: DeepEnhancer - by Selur - 12.04.2025, 18:03
RE: DeepEnhancer - by Dan64 - 13.04.2025, 18:18

Forum Jump:


Users browsing this thread: 2 Guest(s)