Back to the InPaintDeLogo script.
Tried running this script with Automask:
but got an error message when the script was run:Code:WLibAvVideoSource("G:\Test_Video_2.mp4") InpaintDelogo(mask="G:\mask.bmp", Automask=1, Loc="88,860,-870,-56")
[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.
+ Reply to Thread
Results 31 to 57 of 57
-
-
I used PhotoShop.
-
-
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. -
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 -
Code:
InpaintDelogo( mask="D:\Testmmm.png", Loc="0,0,-0,-0", Turbo=-1, Inflate=2, Optimize1=0 )
[Attachment 74175 - Click to enlarge] -
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".
[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 -
What is wrong here? Why can't AviSynth find the dll file?Code:LWLibavVideoSource("G:Test_Video_2.mp4") InpaintDelogo( mask="G:\Testmmm.png", Loc="0,0,-0,-0", Turbo=-1, Inflate=2, Optimize1=0 )
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
-
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.
[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. -
Location of a logo. Doesn't relate to a mask.
Loc is similar to Crop(). -
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.
[Attachment 74242 - Click to enlarge] -
-
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. -
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. -
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. -
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 -
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? -
you might want to only filter the region around the logo,.....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.
(with ProPainter the temporal component/range is usually more important than the spatial one)
users currently on my ignore list: deadrats, Stears555, marcorocchini -
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. -
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:
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=(256,256,0,0))
to remove the right logo (remove_right).Code:clip = ProPainter(clip, img_mask_path="C:/Users/Selur/Desktop/mask.png", mask_region=(520,256,1400,0))
Last edited by Selur; 30th Dec 2025 at 07:30.
users currently on my ignore list: deadrats, Stears555, marcorocchini -
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(?) -
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
-
Not that I know of.Is there an easier/quicker way of using/running ProPainter apart from using Hybrid?
According to https://github.com/sczhou/ProPainter there is a OpenXLab and Hugging Face demo if that helps.
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.And, what is "torch" addon for Hybrid anyway?
The torch add-on uses pytorch and currently allows access to different machine learning based filters:- VSGAN: https://github.com/rlaphoenix/VSGAN
- vsDPIR: https://github.com/HolyWu/vs-dpir (deblock and denoise)
- vsRIFE (torch): https://github.com/HolyWu/vs-rife
- vsBasicVSR++: https://github.com/HolyWu/vs-basicvsrpp
- vsRealESRGAN: https://github.com/HolyWu/vs-realesrgan
- vsSwinIR: https://github.com/HolyWu/vs-swinir
- vsHINet: https://github.com/HolyWu/vs-hinet
- vsAnimeSR: https://github.com/HolyWu/vs-animesr
- vsFeMaSR: https://github.com/AmusementClub/vs-mlrt/releases
- vsSCUNet: https://github.com/HolyWu/vs-scunet
- vsCodeFormer: https://github.com/HolyWu/vs-codeformer
- vsGRLIR: https://github.com/HolyWu/vs-grlir
- vsDDColor: https://github.com/HolyWu/vs-ddcolor
- vsHAVC: https://github.com/dan64/vs-deoldify
- vsProPainter: https://github.com/dan64/vs-propainter
- vsDeepDeinterlace: https://github.com/pifroggi/vs_deepdeinterlace
- vsMFDin: https://github.com/HolyWu/vs-mfdin
Note: Only if an NVIDIA GPU is detected by Hybrid, will it look for this add-on on start-up.
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini -
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).
Similar Threads
-
I need your help in creating this type of text in videos
By shando in forum Newbie / General discussionsReplies: 0Last Post: 19th Apr 2023, 14:16 -
Removing text from a video
By magnu in forum EditingReplies: 2Last Post: 8th Feb 2023, 09:00 -
Removing announcer voice from sports videos?
By rowjekto in forum Newbie / General discussionsReplies: 1Last Post: 1st Mar 2020, 02:54 -
removing border from logo with transparent
By vanhoa in forum EditingReplies: 0Last Post: 12th Oct 2019, 10:26 -
I have a problem removing transparent logo in avisynth using "delogo"
By TeNSoR in forum Newbie / General discussionsReplies: 11Last Post: 8th Jan 2019, 17:30



Quote