Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th May 2024, 10:55   #1  |  Link
Frank62
Registered User
 
Join Date: Mar 2017
Location: Germany
Posts: 267
ProPainter...

Hi, dear people!

This fantastic demonstration:
https://forum.doom9.org/showthread.p...24#post1992324
really impressed me, so I try it with a private project to remove vertical scratches.
ProPainter works fantastic, although I have some problems in detecting a really good mask, but that's ok.
The real problem:
The script does not work with more than a few thousand frames, because the mask can only be given in pngs, not as a video file, and ProPainter opens all these pictures at one time, which leads to a windows error "too many files opened".
I tried to change the script so that it accepts a video as mask, but it only works to a certain point, and Python is pain in the a** for me...

So the question:
Did anyone port ProPainter meanwhile to Vapoursynth? Or to something else, that is more usable?
Frank62 is offline   Reply With Quote
Old 28th May 2024, 12:23   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,495
Quote:
Did anyone port ProPainter meanwhile to Vapoursynth?
Dan64 is working on it, but stuck atm., see: https://forum.selur.net/thread-3720.html
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 28th May 2024 at 13:27.
Selur is offline   Reply With Quote
Old 28th May 2024, 13:32   #3  |  Link
Frank62
Registered User
 
Join Date: Mar 2017
Location: Germany
Posts: 267
"The specified thread does not exist."
I also registered, but still the same.
Frank62 is offline   Reply With Quote
Old 28th May 2024, 13:54   #4  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,495
fixed the link, accidentally deleted the original (3717 thread).
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 28th May 2024, 14:42   #5  |  Link
Frank62
Registered User
 
Join Date: Mar 2017
Location: Germany
Posts: 267
Thanks, Selur.
Frank62 is offline   Reply With Quote
Old 28th May 2024, 16:25   #6  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,517
Thanks to Dan64 and Selur .

vspropainter-1.0.0_RC1 using cuda seems to work ok for me with device_index=0 . Much faster and GPU-z reports it working

I used Selur's BGR workaround in the script

Code:
clip = core.std.ShufflePlanes(clips=clip,planes=[2,1,0], colorfamily=vs.RGB)
I don't have hybrid ; I have it installed "normally"
poisondeathray is offline   Reply With Quote
Old 28th May 2024, 16:34   #7  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,495
@poisondeathray: adding 'enable_fp16=True' might also speed up things.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 28th May 2024, 16:38   #8  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,517
Quote:
Originally Posted by Selur View Post
@poisondeathray: adding 'enable_fp16=True' might also speed up things.
Yes I had that set - I always use that setting with propainter - there is virtually NIL difference in quality and significant memory usage reduction
poisondeathray is offline   Reply With Quote
Old 28th May 2024, 16:40   #9  |  Link
Frank62
Registered User
 
Join Date: Mar 2017
Location: Germany
Posts: 267
I tried every proposal of the readme that would make it faster, but everything you do in this case reduces quality a lot.
Edit: Wow. We seem to have very different experiences?
My concept for more speed is to spread the frames in 15 slices (HD) put it through ProPainter and then stack all together.

Quote:
Originally Posted by poisondeathray View Post
vspropainter-1.0.0_RC1 using cuda seems to work ok for me with device_index=0
The I have to postpone it, or is there a way to edit the numbers in windows somehow, so that my NVidia becomes device 0 (now 1)?
Frank62 is offline   Reply With Quote
Old 28th May 2024, 16:47   #10  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,517
Quote:
Originally Posted by Frank62 View Post
I tried every proposal of the readme that would make it faster, but everything you do in this case reduces quality a lot.
Edit: Wow. We seem to have very different experiences?
FP16 makes little quality difference in my tests .

Being smart with the selection makes a bigger difference - eg. scene splits . More usable frames of similar content makes bigger difference . Contamination of "wrong" frames lowers the quality of the patch


Quote:
The I have to postpone it, or is there a way to edit the numbers in windows somehow, so that my NVidia becomes device 0 (now 1)?
You can set device_index=0 in the vapoursynth script

There are adjustable parameters in the propainter call in the vpy script . Open __init__.py in text editor to see the options - the options are the same as the propainter project
poisondeathray is offline   Reply With Quote
Old 28th May 2024, 16:58   #11  |  Link
Frank62
Registered User
 
Join Date: Mar 2017
Location: Germany
Posts: 267
Ah, ok. I thought it would work only if the GPU to use had the ID 0, because you pointed it out.
Can someone post a working VS-Script for a Still-VS-Beginner, please?
Frank62 is offline   Reply With Quote
Old 28th May 2024, 17:36   #12  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,517
Quote:
Originally Posted by Frank62 View Post
Can someone post a working VS-Script for a Still-VS-Beginner, please?
There is an example script and test video/mask download in selur's forum . It uses a static mask, but you can replace it with animated mask image sequence or video using the mask_path parameter

A simplified version might look like this (you might have to convert pixel formats / ranges differently depending on your inputs)

Code:
import vapoursynth as vs
import vspropainter
core = vs.core

clip = core.lsmas.LWLibavSource(r'PATH\input.mp4')
clip = core.resize.Bicubic(clip, format=vs.RGB24, matrix_in_s="709", range_s="full")

msk = core.lsmas.LWLibavSource(r'PATH\mask.mp4')

clip = propainter(clip, length=25, mask_path=msk, device_index=0, enable_fp16=True)

clip = core.std.ShufflePlanes(clips=clip,planes=[2,1,0], colorfamily=vs.RGB)

clip.set_output()
poisondeathray is offline   Reply With Quote
Old 28th May 2024, 18:20   #13  |  Link
Frank62
Registered User
 
Join Date: Mar 2017
Location: Germany
Posts: 267
Will try! Thanks a lot!
Frank62 is offline   Reply With Quote
Old 28th May 2024, 18:35   #14  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,495
btw. if one of the Vapoursynth plugin developers has hints for Dan64 how to speed things up. he probably would be happy to get some pointers.
Using larger length values does seem to speed things up.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.