Log in

View Full Version : InpaintDelogo - advanced logo removal & hardcoded subtitles extraction


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 [18] 19 20 21 22

VoodooFX
14th August 2023, 01:37
Is there any existing way to "wrap" InpaintDelogo so that it can be used with VapourSynth? (Not asking for a port)

No idea. Maybe @Selur knows.
Search VapourSynth's sub-forum, there are threads like this: https://forum.doom9.org/showthread.php?t=175141

Tried to make InpaintDelogo run with AvsProxy (https://github.com/sekrit-twc/avsproxy) but that eventually failed due to 64bit dependencies... *headscratch*

Probably failed do to missing 32bit plugins/AvS+: "Embed 32-bit Avisynth 2.6 or Avisynth+ environment within 64-bit VapourSynth."

katzenjoghurt
14th August 2023, 08:11
Thanks, VoodooFX!


Probably failed do to missing 32bit plugins/AvS+: "Embed 32-bit Avisynth 2.6 or Avisynth+ environment within 64-bit VapourSynth."

Yea - the error I encountered eventually in some AvsProxy log:
AvisynthError_: Cannot load a 64 bit DLL in 32 bit Avisynth: 'C:/Program Files (x86)/AviSynth+/plugins64/AddGrainC.dll'.




By the way, didn’t mention it: Your Turbo2 results look great and super-promising! *thumbsup*
The UHD reconstruction looks (obviously) much better with Turbo2 and really hope it’s more stable.

Was unfortunately distracted with my VapourSynth/CUDA journey and I really want to take time exploring your new Turbo2 feature.
Again: Didn’t expect you to be *that* fast. :)

drunksunk
14th August 2023, 21:08
Could be.
No one knows as you never post full avs scripts nor delogo files/masks.

InpaintDelogo(Loc="2220,0,0,-1370", mask="D:\Z_DELOGO\Projects\1\masky.bmp", Mode="Deblend", Analyze=1, dPP=-5)

Masks are here (https://imgur.com/a/MRfEkBF). I tryed both Photoshop and autogeneration using Delogo.

VoodooFX
14th August 2023, 22:29
InpaintDelogo(Loc="2220,0,0,-1370", mask="D:\Z_DELOGO\Projects\1\masky.bmp", Mode="Deblend", Analyze=1, dPP=-5)

Masks are here (https://imgur.com/a/MRfEkBF). I tryed both Photoshop and autogeneration using Delogo.

You shared only the basemask files, there are .txt and .ebmp files too...

Anyway, below is Original vs Your vs My.

https://i.imgur.com/rR7ywZP.png

https://i.imgur.com/hz23gjV.png

https://i.imgur.com/SquZ8QZ.png

My script:
# InpaintDelogo(Loc="2220,0,0,-1370", mask="D:\chef.bmp", Analyze=-4, Automask=1, aMix=4) # This to get the basemask

InpaintDelogo(Loc="2220,0,0,-1370", mask="D:\chef.bmp", Mode="Deblend", Analyze=-4, dPP=-5) # This to delogo

drunksunk
15th August 2023, 01:46
Yours is actually still quite visible for me, more than in your screenshot.

VoodooFX
15th August 2023, 02:12
yours is actually still quite visible for me, more than in your screenshot.
Okay.

drunksunk
16th August 2023, 03:39
Okay.

Not okay, it's just that I don't understand why. lol I copied your commands to generate the mask and then deblend it, but the end result is a still quite visible logo.

VoodooFX
16th August 2023, 11:09
Not okay, it's just that I don't understand why. lol I copied your commands to generate the mask and then deblend it, but the end result is a still quite visible logo.
I'll repeat it for the last time:
FULL avs script! ALL files created by InpaintDelogo! Screenshots with the frame numbers!

katzenjoghurt
20th August 2023, 21:19
With Turbo2 you can get similar effect like with Uglarm but much faster.

Here some comparison with the benchmark results:
[...]

Hi again, VoodooFX.

with the weekend I finally had enough time to investigate the Turbo2 feature... and for me it's definitely a keeper!!

Did several checks yesterday and a few full reencodings over night and today, and I really like the results.
In the past I couldn't achieve what is possible now: Inpainting in UHD without too much distraction.


How we name it? Maybe "Turbo2"?

Coming back to that question:
My 2 cents: I'd find "Downsample" more descriptive. Or "oDS"? Or does that sound too much like a part of the post-processing params?

For me it's more a quality feature than a pure speed-up feature.

But it's your tool - and from my side I mainly hope you keep the parameter at all. :thanks:

katzenjoghurt
21st August 2023, 09:09
By the way… your Uglarm comparison awoke a longing for smoothed edges. 😇 :rolleyes:

https://i.imgur.com/UyyQBgy.png

kedautinh12
21st August 2023, 09:19
Hi, i meet problem with this tittle, i try both 3 mode with parameter relate and all analyze but can't delogo
https://i.imgur.com/Q44i1no.png
Mask
https://i.imgur.com/mr1muYc.png
Script:
InpaintDelogo(mask="C:\Logos\mask1.bmp", Analyze=2, Automask=0, aMix=-6, Loc="88,860,-870,-56", Mode="Both", otune=10, oTinflate=2)
Video:
https://drive.google.com/file/d/1uRrj8I8tlLs0hWhxz5xtdzoP-neYI73C/view?usp=sharing

VoodooFX
21st August 2023, 13:00
Your mask is hollow and I don't see reason for "Both".

kedautinh12
21st August 2023, 13:35
Your mask is hollow and I don't see reason for "Both".

I mean try 3 mode but don't work

VoodooFX
21st August 2023, 14:09
I mean try 3 mode but don't work
I understood what you meant.

kedautinh12
21st August 2023, 14:21
I understood what you meant.

I try both 3 mode "both", "inpaint", "deblend" but don't work

VoodooFX
21st August 2023, 14:42
I try both 3 mode "both", "inpaint", "deblend" but don't work
Yeah, that's is exactly what I understood from your first post.

Do you understand what I answered? Your basemask is hallow, it doesn't cover the logo you want to remove.

kedautinh12
21st August 2023, 15:02
Yeah, that's is exactly what I understood from your first post.

Do you understand what I answered? Your basemask is hallow, it doesn't cover the logo you want to remove.

I know, but how to make a mask cover all, i try with amix but can't

katzenjoghurt
21st August 2023, 15:18
I know, but how to make a mask cover all, i try with amix but can't

Didn’t have a look at your video myself, but…
Did you take care to trim() to only the section where the logo is actually visible?

I see that it’s not there during the first seconds.


If everything fails you could also fill the holes manually in Paint or so. But I’m sure there’s another way.


Btw. “both” looks about right as the inner part is transparent. Not sure though if it’s transparent enough.
https://i.imgur.com/HZo13iL.jpg

kedautinh12
21st August 2023, 16:16
I trimed but still don't make mask cover all

kedautinh12
21st August 2023, 16:22
Ok, I use Photoshop to paint all white colors but it still doesn't work perfectly with 3 modes
https://i.imgur.com/JmAfU2K.png
Mask:
https://i.imgur.com/Rmoi5sy.png
Scripts:
LoadPlugin("C:\Megui\MeGUI-2944-64\tools\lsmash\LSMASHSource.dll")
LWLibavVideoSource("C:\Users\ADMIN\Downloads\Orphans no Namida -live ver.- - MISIA PV.video-muxed.mkv", format="YUV420P8")
AnimeIVTC(mode=1)
propSet("_FieldBased",0)
trim(333,7304).InpaintDelogo(mask="C:\Logos\mask1.bmp", Analyze=2, Automask=0, aMix=-6, Loc="88,860,-870,-56", Mode="Inpaint")

VoodooFX
21st August 2023, 19:39
I know, but how to make a mask cover all, i try with amix but can't

You can get some PhotoShop course. Btw, your mask doesn't look full white.

Below is example how to get mask with Avisynth:

LWLibAvVideoSource("D:\Orphans no Namida -live ver.- - MISIA PV.ts").TFM
v=Trim(500, 9116)

m=v.Trim(9116,-1).ExtractY.Crop(88,860,-870,-56).mt_binarize(30).mt_expand.mt_expand

v.InpaintDelogo(mask=m, Loc="88,860,-870,-56", mode="Inpaint")

StackVertical(v.Crop(88,860,-870,-56), m.ConvertToYV12, last.Crop(88,860,-870,-56))


Frame 2433:

https://i.imgur.com/pRmIKAP.png

kedautinh12
22nd August 2023, 01:28
Got it, thanks

katzenjoghurt
31st August 2023, 21:08
Hey VoodooFX,

Regarding Turbo2:

Out of your mind: Do you have an idea why I would have to rise Inflate together with Turbo2 for thinner elements in logos?

I rise Turbo2 and suddenly I see artifacts. I can counter them though with Inflate... until I reach the prameter limit of course. :)

If you have no idea right away, I will try to create a sample.

VoodooFX
1st September 2023, 11:53
Do you have an idea why I would have to rise Inflate together with Turbo2 for thinner elements in logos?

If you have no idea right away, I will try to create a sample.

If mask has thin elements then probably they can disappear with high Turbo2, because mask is downscaled.
Yes, share a video sample with mask.

Lirk
16th September 2023, 18:59
Is there FFmpeg Delogo filter port for AviSynth? It looks like "dekafka", but with soft edges blur.

katzenjoghurt
17th September 2023, 12:17
If mask has thin elements then probably they can disappear with high Turbo2, because mask is downscaled.
Yes, share a video sample with mask.

Hi again, VoodooFX.
Finally the promised sample (contains source, logo file, mask):
https://wetransfer.com/downloads/d9e3b5c0c5c3e49d5e7507a43e6b40da20230917111048/007a2dafc0f5f6e2aed4ac3a838dde6520230917111058/aaabad?trk=TRN_TDL_01&utm_campaign=TRN_TDL_01&utm_medium=email&utm_source=sendgrid

Logo:
https://i.imgur.com/uNjCAk6.png

Mode="Inpaint", Optimize1=0, Turbo2=1:
https://i.imgur.com/eVUP4PN.png

Mode="Inpaint", Optimize1=0, Turbo2=3
https://i.imgur.com/rCcrRUf.png

Mode="Inpaint", Optimize1=0, Turbo2=3, Inflate=3
https://i.imgur.com/lXFqc7z.png

tuanden0
4th November 2023, 17:42
@VoodooFX,

Could you give me any example for extracting hardsubbed video?

VoodooFX
4th November 2023, 21:52
@katzenjoghurt I'll fix it in a normal release. Not soon, maybe after I'll implement all features requested for Standalone Faster-Whisper...

@VoodooFX,

Could you give me any example for extracting hardsubbed video?

I don't have any at hand, there should be plenty in this thread.
If something will be unclear then share your avs script with a video sample [where subs are in the brightest backgrounds].

katzenjoghurt
5th November 2023, 18:13
@katzenjoghurt I'll fix it in a normal release. Not soon, maybe after I'll implement all features requested for Standalone Faster-Whisper...

:thanks:👍

doctorkhv
10th December 2023, 06:23
Hello,
Can't configure DeLogo parameters.
Logo in the upper right corner.

https://images2.imgbox.com/7b/cb/6pboEQ58_o.jpg
https://images2.imgbox.com/05/4f/F7vpObm3_o.jpg

Video source https://workupload.com/file/C5KUsGd5W7y
Image source https://workupload.com/file/3PBTYE8naKp

InpaintDelogo( mask="X:\01\120.png", Loc="0,0,0,0", Analyze=-4, Optimize2=2, Inflate=0, Turbo=-1)

kedautinh12
10th December 2023, 10:47
First, choose the location of the logo with InpaintLoc
InpaintLoc(Loc="3560,170,-170,-1790")
https://imgur.com/ZHGVx7f

Second, create a mask with Automask=1. Cause your example video is short so I use Analyze=3
InpaintDelogo(mask="C:\Logos\mask1.bmp", Loc="3560,170,-170,-1790", Automask=1, aMix=-9, Analyze=3)
https://imgur.com/sWLBdXX

Finally, use Automask=0 to use mask for Delogo step and add some parameters. With mode=deblend will get a better result almost but when the logo moves to the boy's hat, the logo will appear so I replaced it with inpaint
InpaintDelogo(mask="C:\Logos\mask1.bmp", Loc="3560,170,-170,-1790", Automask=0, aMix=-9, Analyze=3, Mode="Inpaint", Optimize1=1, Optimize2=3, Interp=3, IntSpd=4, dPP=-5)
https://imgsli.com/MjI1MTQ5/0/1

VoodooFX
10th December 2023, 18:07
Hello,
Can't configure DeLogo parameters.
Logo in the upper right corner.

Video source https://workupload.com/file/C5KUsGd5W7y
Image source https://workupload.com/file/3PBTYE8naKp

InpaintDelogo( mask="X:\01\120.png", Loc="0,0,0,0", Analyze=-4, Optimize2=2, Inflate=0, Turbo=-1)

1) The mask is bad, it's not full white.
2) Every parameter doesn't make sense.
3) As nothing makes sense, what exactly you are trying to do with that logo?

doctorkhv
21st December 2023, 01:32
1) The mask is bad, it's not full white.
2) Every parameter doesn't make sense.
3) As nothing makes sense, what exactly you are trying to do with that logo?
Thank you!
Tell me, so as not to be distracted by trifles, what can be added to the script like
InpaintDelogo( mask="D:\01.png", Loc="0,0,0,0", Inflate=0)
I can add and change values
Analyze=-4, Optimize2=2, Turbo=-2,
what else can you add?

Your tutorial at https://github.com/Purfview/InpaintDelogo/ is difficult for me to understand.
Sincerely,
Eugene

kedautinh12
21st December 2023, 01:55
Thank you!
Tell me, so as not to be distracted by trifles, what can be added to the script like
InpaintDelogo( mask="D:\01.png", Loc="0,0,0,0", Inflate=0)
I can add and change values
Analyze=-4, Optimize2=2, Turbo=-2,
what else can you add?

Your tutorial at https://github.com/Purfview/InpaintDelogo/ is difficult for me to understand.
Sincerely,
Eugene

Did you try my suggestion?

doctorkhv
21st December 2023, 02:07
Which suggestion? Of course I will accept all suggestions!

kedautinh12
21st December 2023, 02:22
Which suggestion? Of course I will accept all suggestions!

Did you read all post?
https://forum.doom9.org/showthread.php?p=1994964#post1994964

doctorkhv
21st December 2023, 03:24
Did you read all post?
https://forum.doom9.org/showthread.php?p=1994964#post1994964

Only now I realized that it was you who wrote your post to me.
Thanks a lot!!!
But now I was asking about something else, about the GENERAL parameters of the script.

VoodooFX
21st December 2023, 22:17
Your tutorial at https://github.com/Purfview/InpaintDelogo/ is difficult for me to understand.

Then post what you don't understand.
I can't comment on your script because it's some random copy/paste with no sense, don't paste there things you don't understand.

Start from the base mask, I guess.

doctorkhv
22nd December 2023, 07:13
VoodooFX Thanks for your reply!

In my understanding your script has:
1. Mask.
I can change the parameters: dimensions, smoothing the inner and outer contours, blurring, adding grain...
2. Interpolation within the frame. The parameters are not clear to me.
3. Interpolation of neighboring frames. The parameters are not clear to me.

Thank you for your creativity!

VoodooFX
22nd December 2023, 09:41
In my understanding your script has:
1. Mask.


Yes there is such parameter as "mask" and other ~120 ones.

VoodooFXI can change the parameters: dimensions, smoothing the inner and outer contours, blurring, adding grain...


There are no such named parameters.

VoodooFX
2. Interpolation within the frame. The parameters are not clear to me.


Which ones?

VoodooFX
3. Interpolation of neighboring frames. The parameters are not clear to me.


There is no such thing in InpaintDelogo.
So, I don't know how non-existing parameters are "not clear".

EDIT:
Conclusion: Something is fundamentally wrong...

EDIT2:
What "tutorial" did you read exactly?

doctorkhv
22nd December 2023, 09:54
I'll keep quiet so as not to irritate you.

kedautinh12
22nd December 2023, 09:59
You need read more about info in InpaintDelogo.avsi

VoodooFX
22nd December 2023, 10:36
I'll keep quiet so as not to irritate you.

Good choice, there is no point in posting the abstract fantasies instead of articulating your issue.

The parameters are not clear to me.


Your issue is not clear to me. State you issue or you are just wasting your time here.

kalehrl
24th December 2023, 18:55
WOW! This is great!
Before:
https://ibb.co/Xt6N7jp
After:
https://ibb.co/jkF0KGj

VoodooFX
26th December 2023, 12:46
WOW! This is great!
Before:
https://ibb.co/Xt6N7jp
After:
https://ibb.co/jkF0KGj

Solid back around logo is easy case. :)

kedautinh12
26th December 2023, 12:53
Yeah, black background very esy to use delogo, i'm scared about ground with dynamic color. @VX, any option for this case?

VoodooFX
26th December 2023, 13:00
Yeah, black background very esy to use delogo, i'm scared about ground with dynamic color. @VX, any option for this case?
Option for what?

kedautinh12
26th December 2023, 13:03
Option for what?

Option to delogo with deblend mode for dynamic color background. Some time logo still show if the background change to other colos

VoodooFX
26th December 2023, 13:16
Option to delogo with deblend mode for dynamic color background. You don't need any option as deblend works by default on that. When on solid background it can safely switch to inpainting.

Some time logo still show if the background change to other colos
That's an issue of the damaged transparency by compression. In such cases don't use "1/3" optimization in "Optimize2".

doctorkhv
29th December 2023, 07:43
Hello,
Can't configure DeLogo parameters.

Video source https://workupload.com/file/6kk55AKyq7H
Image source https://workupload.com/file/tULBdZPZpKk

InpaintDelogo( mask="X:\01a.png", Loc="0,0,0,0", Automask=0, Optimize2=2, Inflate=0, Turbo=-1)