VideoHelp Forum




+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 57 of 57
  1. Originally Posted by VoodooFX View Post
    Originally Posted by meeshu View Post
    Another question.

    What is this "mask.bmp" ? Is this something that you have to create first before running the script? If so, how to create this mask this please?
    You can create masks with any image editor.

    Or you can try Automask arg: InpaintDelogo(mask="D:\mask.bmp", Automask=1, Loc="88,860,-870,-56")
    Back to the InPaintDeLogo script.

    Tried running this script with Automask:

    Code:
    WLibAvVideoSource("G:\Test_Video_2.mp4")
    InpaintDelogo(mask="G:\mask.bmp", Automask=1, Loc="88,860,-870,-56")
    but got an error message when the script was run:

    Image
    [Attachment 74157 - Click to enlarge]


    So, try manually creating mask instead? When creating masks for InPaintDeLogo manually, how exactly is this done? So for this test video clip here, how to you create the appropriate mask to remove both the BBC logo and the text "Antiques Roadshow (1999)"?

    Thank you.
    Quote Quote  
  2. Originally Posted by VoodooFX View Post
    I used PhotoShop.
    I also use PhotoShop, Paint Shop and some other image editors. But would you please expand your answer to describe how exactly (step by step) the mask is created, please?
    Quote Quote  
  3. No one prepared to describe the process of manually creating masks for use with InPaintDeLogo?

    I have some experience in using various image editors (PhotoShop, PaintShop Pro, Windows Paint, as well as a few others), but no experience in creating masks (for use in AviSynth). So I really would like some guidance on the mask making procedure. Thank you.

    VoodooFX. Would you be prepared to at least upload a copy of the mask.bmp that you used on the test_video_2.mp4 clip, please? I could examine that mask.bmp image so I might get an idea of how to create masks.
    Quote Quote  
  4. It's the same way that you do masks in photoshop/gimp/paint, etc... Use a binary mask - 100% white on 100% black . Areas in white mark the area of interest

    So in any image editor, draw a 100% white box around the area of interest, on a black background
    Quote Quote  
  5. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by meeshu View Post
    VoodooFX. Would you be prepared to at least upload a copy of the mask.bmp that you used on the test_video_2.mp4 clip, please? I could examine that mask.bmp image so I might get an idea of how to create masks.
    Code:
    InpaintDelogo( mask="D:\Testmmm.png", Loc="0,0,-0,-0", Turbo=-1, Inflate=2, Optimize1=0 )


    Image
    [Attachment 74175 - Click to enlarge]
    Quote Quote  
  6. Thank you very much for the comments, revised script, and the mask!

    I'm beginning to understand how this all works now.

    However, on running the revised script I'm getting an error message regarding "neo_fft3d".

    Image
    [Attachment 74181 - Click to enlarge]


    I have downloaded the file neo_FFT3D_r11.7z which contains both the 64 bit and 32 bit versions of the file neo-fft3d.dll.

    The 64 bit version of neo-fft3d.dll was copied to the AviSynth plugin directory - C:\Program Files (x86)\AviSynth+\plugins64+, and also copied to the system directory - C:\Windows\System32.

    The 32 bit version of neo-fft3d.dll was copied to the system directory - C:\Windows\SysWOW64.

    The error message mentions loading the dll file using LoadDLL(), but I get error message that this isn't a valid AviSynth command? This command doesn't seem to work anyway.

    This is the full script for running InPaintDeLogo -

    Code:
    LWLibavVideoSource("G:Test_Video_2.mp4")
    InpaintDelogo( mask="G:\Testmmm.png", Loc="0,0,-0,-0", Turbo=-1, Inflate=2, Optimize1=0 )
    What is wrong here? Why can't AviSynth find the dll file?

    EDIT: Never mind. I got the script to run in the end by downloading both 32 bit and 64 bit versions of the file libfftw3f-3.dll. The 32 bit version was installed within - C:\Windows\SysWOW64 directory. And the 64 bit version was installed within - C:\Windows\System32 directory.

    The modified script now includes displaying the input and output videos side by side for easy comparison -

    Code:
    LWLibavVideoSource("G:Test_Video_2.mp4")
    A=last
    
    InpaintDelogo( mask="G:\Testmmm.png", Loc="0,0,-0,-0", Turbo=-1, Inflate=2, Optimize1=0 )
    B=last
    
    StackHorizontal(A, B)
    Last edited by meeshu; 5th Oct 2023 at 04:42. Reason: Correct dll files installed, and script runs as intended
    Quote Quote  
  7. I'm still studying and experimenting with the sample scripts and with other test videos.

    But I'm having difficulty in understanding the numbers contained within the LOC() parameter for the original script for InPaintDeLogo.

    Image
    [Attachment 74239 - Click to enlarge]


    What do these numbers mean? Dimensions of the mask? Location of the mask? Or what?

    I don't have a copy of the original "mask.bmp" for study.

    Would someone please clarify the meaning of these numbers, and how it relates to the mask and to the location/position of the logo and text to be removed form the original test_video_2.mp4 clip?

    Thank you.
    Quote Quote  
  8. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by meeshu View Post
    What do these numbers mean? Dimensions of the mask? Location of the mask? Or what?
    Location of a logo. Doesn't relate to a mask.

    Loc is similar to Crop().
    Quote Quote  
  9. Thanks for the reply! This has cleared up some issues.

    However, assuming the Loc numbers are for left, top, right, bottom, then plotting lines at these offset number locations on a screenshot of the test_video_2, results in an area near the bottom of the screenshot, well away from the logo and text near the top of the screen!?

    This is obviously not correct as the logo and text are not contained within the area defined by the offset numbers.

    So, how do you interpret the numbers 88, 860, -870, -56 then?

    Thank you.

    Image
    [Attachment 74242 - Click to enlarge]
    Quote Quote  
  10. Video Damager VoodooFX's Avatar
    Join Date
    Oct 2021
    Location
    At Doom9
    Search PM
    Originally Posted by meeshu View Post
    So, how do you interpret the numbers 88, 860, -870, -56 then?
    Those numbers are just random example you asked, not related to any video.

    Loc="0,0,-0,-0" is from real script.
    Quote Quote  
  11. Originally Posted by VoodooFX View Post
    Originally Posted by meeshu View Post
    So, how do you interpret the numbers 88, 860, -870, -56 then?
    Those numbers are just random example you asked, not related to any video.

    Loc="0,0,-0,-0" is from real script.
    Ok. That clears that up.

    Thank you.
    Quote Quote  
  12. I'm not getting good results with removing logos/texts from other test videos using InFill and InPaintDeLogo.

    So, now looking at this "ProTrainer" option as mention in post #17.

    What AviSynth/ProTrainer script(s) and/or other program(s) and/or other setting(s) was/were used to generate the processed output clip ( Test_Video_2_ProPainter.mp4 ) please?

    Thank you.
    Quote Quote  
  13. Originally Posted by meeshu View Post

    What AviSynth/ProTrainer script(s) and/or other program(s) and/or other setting(s) was/were used to generate the processed output clip ( Test_Video_2_ProPainter.mp4 ) please?
    The instructions , prerequisite, python scripts and demos are on the ProPainter page . It's much slower than InpaintDelogo and limited by GPU memory . It's difficult to use unless you're used to python and these types of projects. They typically only support image sequences, but ProPainter one has AVI/MP4/MOV support.

    There are several options, listed in the inference_propainter.py . You have to adjust them depending on your sources and hardware.

    In general, for temporal inpainting, you need fairly clean sources, otherwise the noise/grain/compression artifacts contaminate the patch. For example - don't think you can use a thin logo mask only covering the letters - because in between the letters and outside of the letters are compression artifacts (zoom in and you can see them). If you had a very high quality source - then you might be able to use a thin mask. An alternative strategy would be to apply to prefilter (denoise)

    You don't need avisynth - you can use any tool(s) to crop to region of interest and generate masks, and to combine/composite the inpainted regions back into the full video.
    Quote Quote  
  14. Comments noted. Thank you!
    Quote Quote  
  15. I've had a look at the GitHub site for ProTrainer.

    About the only thing I've found and understood so far is that it appears that ProPainter uses masks for logo/text removal, similar to InPaintDeLogo.

    I note that at that GitHub site there is a note 2023.09.24: We remove the watermark removal demos officially to prevent the misuse of our work for unethical purposes..

    I understand the reason(s) for this note. But for legitimate purposes and for beginners like myself, I would have been very helpful to have viewed the demo codes to make it easier to understand and utilize.

    Frankly, at this time, I am at a loss at what to do next. Maybe I'll have to spend countless hours studying how python works!? But hopefully not, as I don't have much spare time to study anything.

    Seems I'll have to shelve this ProTrainer logo/text removal option for now.
    Quote Quote  
  16. Originally Posted by meeshu View Post

    I note that at that GitHub site there is a note 2023.09.24: We remove the watermark removal demos officially to prevent the misuse of our work for unethical purposes..

    I understand the reason(s) for this note. But for legitimate purposes and for beginners like myself, I would have been very helpful to have viewed the demo codes to make it easier to understand and utilize.
    It doesn't matter, it's the same code.

    You can run the other examples of object removal, they are the same as the watermark removal . Animated masks instead of static masks, but it's essentially the same

    If you can run the demo successfully, then you just change the images and paths to your videos
    Quote Quote  
  17. Member
    Join Date
    Nov 2006
    Location
    Washington, USA
    Search Comp PM
    ProPainter is very impressive but on my rig (I7-13700F and RTX 4070) it was going to take about a month to process a 90 minute 1920x1080 video. InpaintDelogo works okay and it processes about at 1X speed on my system. For those who like simple instructions to get InpaintDelogo working, use the following for a 64 bit Windows installation:

    Install AVIsynth (AviSynth_260.exe).
    Install AVIsynth+ (AviSynthPlus_3.7.5_20250420_vcredist.exe).
    Put the needed 64 bit filters in the "C:\Program Files (x86)\AviSynth+\plugins64+" subdirectory.
    The filters I used are in "plugins64+.zip".
    Install AVSPmod (AvsPmod_v2.7.9.4_.Windows_x86-64.zip).
    32-bit libfftw3f-3.dll from fftw-3.3.5-dll32.zip needs to be put in the "C:\Windows\SysWOW64" subdirectory.
    64-bit libfftw3f-3.dll from fftw-3.3.5-dll64.zip needs to be put in the "C:\Windows\System32" subdirectory.

    AVSPmod can be used to see if AVS script is working correctly.
    Once the AVS script is working correctly then you can use ffmpeg to execute the script.

    An example AVS script is as follows:

    # The below example assumes that the test.bmp logo mask has the same width and height as the test.mp4 video.
    LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins64+\ffms2.dll")
    FFmpegSource2("C:\Users\paulr\Documents\Video Software\Logo Removal\InpaintDelogo\TEST\test.mp4")
    InpaintDelogo(mask="C:\Users\paulr\Documents\Video Software\Logo Removal\InpaintDelogo\TEST\test.bmp", Loc="0,0,-0,-0")

    An example ffmpeg command line is as follows:

    ffmpeg.exe -i test.avs -acodec copy -vcodec libx264 -preset slow -crf 18 "test-logo-removed.mp4"

    Is there another logo removing filter that works better than InpaintDelogo but isn't super slow like ProPainter?
    Image Attached Files
    Quote Quote  
  18. ProPainter is very impressive but on my rig (I7-13700F and RTX 4070) it was going to take about a month to process a 90 minute 1920x1080 video.
    you might want to only filter the region around the logo,..... (with ProPainter the temporal component/range is usually more important than the spatial one)
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  19. Can anyone please describe the procedure for installing and running ProPainter?

    I'm keen to try ProPainter out, but have no idea at all on how to use it.
    Quote Quote  
  20. I use https://github.com/dan64/vs-propainter through Hybrid (installing latest dev version and torch-add-on) and use something like, by configuring Filtering->Vapoursynth->Other->ProPainter.
    But be warned:
    a. this works only if you have an NVIDIA card (preferably fast)
    b. Hybrid does not aim to be easy to use and assumes the user knows what he is doing.
    c. using just one ProPainter call with a large area is really slow, using multiple ProPainter calls on smaller areas is faster, but bugged atm., so one would have to do multiple encodes for it to be usable fast. (There we are back at 'the user knows what he is doing'. )

    => easy to setup, but might be tricky to use
    Cu Selur

    Ps.: as an example, I used:
    Code:
    clip = ProPainter(clip, img_mask_path="C:/Users/Selur/Desktop/mask.png", mask_region=(256,256,0,0))
    to remove the left logo, then use the output (remove_left) with:
    Code:
    clip = ProPainter(clip, img_mask_path="C:/Users/Selur/Desktop/mask.png", mask_region=(520,256,1400,0))
    to remove the right logo (remove_right).
    Image Attached Thumbnails Click image for larger version

Name:	mask.png
Views:	6
Size:	1.2 KB
ID:	90535  

    Image Attached Files
    Last edited by Selur; 30th Dec 2025 at 07:30.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  21. Thanks for the detailed reply!

    Yes, it appears that ProPainter does an excellent job of removing watermarks/logos here.

    But, is there an easier/quicker way of "ïnstalling" and running ProPainter?

    My understanding was that you only required Python to be installed with ProPainter, and then run ProPainter via commands entered into Python command window(?)
    Quote Quote  
  22. Hybrid comes with a portable python and the torch add-on adds ProPainter,... I already warned about Hybrid.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  23. Thanks, but my question has not really been answered.

    Is there an easier/quicker way of using/running ProPainter apart from using Hybrid?

    And, what is "torch" addon for Hybrid anyway?
    Quote Quote  
  24. Member
    Join Date
    Nov 2006
    Location
    Washington, USA
    Search Comp PM
    Instead of using Hybrid I ended up using vs-propainter. I took Selur's advice (thanks) and only filtered the region around the logo. I didn't see how to do this using the original propainter so I used the VapourSynth ProPainter version, vs-propainter, which has the mask_region argument. Only filtering a 355x230 region of my 1280x720 video resulted in a processing speed of about 0.16 real time. This is still slow but is still practical to use. The below are the notes I wrote for myself while installing and using vs-propainter.

    Install the latest Python version. I installed Python only for my user.

    Download the latest vs-propainter code from GitHub (https://github.com/dan64/vs-propainter/releases)
    The latest code as of 1/1/2026 is vspropainter-1.2.2-py3-none-any.whl

    Install the latest vs-propainter code using pip:
    pip install vspropainter-1.2.2-py3-none-any.whl

    Copy the needed models to the Python vspropainter weights directory (i.e. C:\Users\paulr\AppData\Local\Programs\Python\Pytho n312).
    The needed models are the following:
    https://github.com/sczhou/ProPainter/releases/download/v0.1.0/ProPainter.pth
    https://github.com/sczhou/ProPainter/releases/download/v0.1.0/raft-things.pth
    https://github.com/sczhou/ProPainter/releases/download/v0.1.0/recurrent_flow_completion.pth

    Install the latest VapourSynth from https://github.com/vapoursynth/vapoursynth/releases.
    I installed it only for my user since Python was installed only for my user.

    Download the latest VapourSynth miscellaneous filters (miscfilters-r2.7z) from https://github.com/vapoursynth/vs-miscfilters-obsolete/releases.
    Copy the win64/MiscFilters.dll from miscfilters-r2.7z to the appropriate VapourSynth directory (i.e. C:\Users\paulr\AppData\Local\Programs\VapourSynth\ plugins).

    Download the latest VapourSynth bestsource plugin from https://github.com/vapoursynth/bestsource/releases.
    Put bestsource.dll from BestSource-R15-VS-only-ci.7z in the plugin directory C:\Users\paulr\AppData\Local\Programs\VapourSynth\ plugins.

    The following Python modules also needed to be installed using the following commands:
    pip install opencv-python
    pip install scipy
    pip install einops

    I needed to install the NVIDIA CUDA Compiler (nvcc) on Windows (use Google for instructions).
    I got the installer from https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64.
    See full instructions at https://github.com/imxzone/Step-by-Step-Setup-CUDA-cuDNN-and-PyTorch-Installation-on-W...-Compatibility.
    I have a RTX 4070 so I installed the version 12.4.1 toolkit.
    I googled "what CUDA version compatible with a rtx 4070" to find out what toolkit to install.
    I installed cuda_12.4.1_551.78_windows.exe.
    I did not install CUDNN.

    I was able to get some examples to run.
    In order to get output via vspipe, I put ffmpeg.exe in the same directory as the batch file I used for running VaporSynth.
    The command line used was:
    vspipe -c y4m script.vpy - | ffmpeg -y -i - -c:v libx264 -preset slow -crf 22 -c:a copy encoded.mkv

    An example of a VapourSynth script that ran correctly is as below:

    # Imports
    import vapoursynth as vs
    # getting Vapoursynth core
    import sys
    import os
    core = vs.core

    # Load the plugin that is needed for using the scene detection option.
    # Not needed. I put the plug in the C:\Users\paulr\AppData\Local\Programs\VapourSynth\ plugins directory.
    #core.std.LoadPlugin(path="C:/Users/paulr/AppData/Local/Programs/VapourSynth/plugins/MiscFilters.dll")

    # Load the video file.
    # This assumes that the bestsource plugin has been auto loaded
    clip = core.bs.VideoSource("D:/vs-propainter/Example4/video.mp4")

    # Inpainting using ProPainter
    from vspropainter import propainter as ProPainter
    # If the video is not RGB24 then it needs to be converted to RGB24.
    clip = core.resize.Bicubic(clip=clip, format=vs.RGB24, matrix_in_s="709", range_in_s="limited", range_s="full")
    # The mask_region parameters are (width,height,left,top).
    # For this example, that logo was with the box defined by (1053,618)-(1260,703) for a 1280x720 video.
    # I decided to use 128 pixels to the left of the mask. 1053-128 = 925
    # I decided to use 128 pixels from the top of the mask. 618-128 = 490
    # The width is therefore 1280-925=355
    # The height is therefore 720-490=230
    clip = ProPainter(clip, img_mask_path="D:/vs-propainter/Example4/mask.png", length=500, mask_region=(355,230,925,490))

    # convert back to YUV for the final output using "vspipe -c y4m script.vpy - | ffmpeg -i - encoded.mkv"
    #clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P10, matrix_s="709")
    clip = core.resize.Bicubic(clip=clip, format=vs.YUV420P8, matrix_s="709", range_in_s="full", range_s="limited")

    # output
    clip.set_output()
    Last edited by johnnyquid; 1st Jan 2026 at 19:27. Reason: correct typo in example script
    Quote Quote  
  25. Is there an easier/quicker way of using/running ProPainter apart from using Hybrid?
    Not that I know of.
    According to https://github.com/sczhou/ProPainter there is a OpenXLab and Hugging Face demo if that helps.

    And, what is "torch" addon for Hybrid anyway?
    The torch add-on download is a compressed archive (read the attached SETUP.md on how it's created) which is meant to replace the Vapoursynth folder in Hybrid.
    The torch add-on uses pytorch and currently allows access to different machine learning based filters:
    Note: Only if an NVIDIA GPU is detected by Hybrid, will it look for this add-on on start-up.

    Cu Selur
    Image Attached Files
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  26. Thanks for the detailed replies.

    Unfortunately it seems the available options are somewhat complicated to setup and to run. So I might have to give this a miss for now if there are no easier options to install/setup and run ProPainter (and vs-ProPainter).
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!