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
I was able to get this result with the attached script.

[Image: attachment.php?aid=3537]

Let me know if is working on your side.

Dan


Attached Files Thumbnail(s)
   

.zip   Education_ProPainter_small.zip (Size: 412,76 KB / Downloads: 1)
Reply
Nice!!
Yes, I can reproduce the effect with your script.
But why doesn't it also work when I use:
clip = ProPainter(clip, img_mask_path="C:/Users/Selur/Desktop/mask.png", length=50, mask_dilation=0, neighbor_length=4, mask_region=(1080,256,0,1300))
When I use your mask it works, but why does it not work with mine?
Your mask doesn't have the same resolution as the video, and it also doesn't even have the same display aspect ratio (340x600 vs 1080x1920)

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
DOH, your source video also has a lower resolution, so the problem is probably related to vram consumption. Sad
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
Okay, using the low resolution mask on my full resolution source, even when not lowering dilation, neighbor length, and length:
clip = ProPainter(clip, img_mask_path="C:/Users/Selur/Desktop/Education_ProPainter_small/mask_small.jpg", mask_region=(1080,256,0,1300))
does work.
[Image: grafik.png]
=> this seems to be an issue with the mask handling
Does it make sense to add an option to vs-propainter to divide mask width&height by a factor X ?

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
I debugged the source and it seems that sometimes (depending on the input mask) the call to the function:

scipy.ndimage.binary_dilation(mask_img, iterations=mask_dilates)

 provides a wrong dilated mask. Not clear why and the debugging of "scipy" function is outside my scope.

So in summary if you get wrong results try to set 
mask_dilation=0       # skip the call to scipy.ndimage.binary_dilation()
   
 and check if this solve the problem.

Dan

P.S.
If you provide as input a low resolution mask, the mask is resized to the frame dimension inside the filter. 
In my tests mask_dilation=0 fixed the issue, but I worked on a small size clip.
For sure there is a problem on mask handling, probably due to memory constrains and using a mask region is the optimal way to manage it because the inference is performed only on the clip having the size of mask region.
Reply
using:
clip = ProPainter(clip, img_mask_path="C:/Users/Selur/Desktop/mask.png", length=12, mask_dilation=0, mask_region=(1080,256,0,1300))
It's still broken:
[Image: grafik.png]
same with:
clip = ProPainter(clip, img_mask_path="C:/Users/Selur/Desktop/mask.png", length=12, mask_dilation=0, neighbor_length=4, mask_region=(1080,256,0,1300))
[Image: grafik.png]
so it's not just fault of the dilation.
using:
clip = ProPainter(clip, img_mask_path="C:/Users/Selur/Desktop/mask.png", length=12, mask_dilation=0, neighbor_length=4)
[Image: grafik.png]
Converting the PNG to jpg (4:2:0):
clip = ProPainter(clip, img_mask_path="C:/Users/Selur/Desktop/mask.jpg", length=12, mask_dilation=0, neighbor_length=4, mask_region=(1080,256,0,1300))
[Image: grafik.png]
Converting the PNG to jpg (4:4:4 max quality):
clip = ProPainter(clip, img_mask_path="C:/Users/Selur/Desktop/mask.jpg", length=12, mask_dilation=0, neighbor_length=4, mask_region=(1080,256,0,1300))
[Image: grafik.png]
so doesn't seem to be a jpg vs png problem.

Cu Selur

Ps.: going to bed now, but I can do more testing, tomorrow
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply
In the script "propainter_render.py", there is this code

def model_init(self, torch_device, model_dir: str = None, mpath: str = None):
        self.device = torch_device

        self.img_mask_is_cropped = False

        # load image mask if available
        if mpath is None:
            self.img_mask = None
        else:
            img_m = Image.open(mpath).convert('RGB')
            out_size = img_m.size
            if out_size == self.clip_size:
                self.img_mask = img_m
            else:
                self.img_mask = img_m.resize(self.clip_size)
        self.img_mask_orig = self.img_mask

So if you provide in input mask_small.jpg is resized as the image attached.

So looking to the code there is not difference in providing in input "mask_small.jpg" or "mask_big.png".

But using  "mask_small.jpg" it works while using "mask_big.png" it doesn't work, is very crazy, for the moment I don't have an explanation for this kind of odd behavior.

Dan


Attached Files Thumbnail(s)
   
Reply


Forum Jump:


Users browsing this thread: Dan64, 3 Guest(s)