Auto text removal using CRAFT to detect the text and LaMa to remove the text. Highly motivated by auto-lama which do object detection + LaMa.
Applying LaMa multiple times with bigger mask creates a better result.
- Clone this repository
- Setup and download CRAFT model. Please see the official repo for the detail. Please put the downloaded model under
CRAFT-pytorchfolder. - Setup and download LaMa model. Please see the official repo for the detail. Please put the downloaded model under
LaMafolder. - Put your input images to
imagesfolder - Run the program
bash script/predict_and_inpaint.sh
or
bash script/predict_and_inpaint.sh 5
indicating repeat LaMa 5 times (default 3 times)
Output will be located at
resultsfolder and result from every repetition will located ateach_step_resultsfolder
Before (Photo source)
After

I do a little modification to CRAFT-pytorch original code to fit my usage requirement.
Anyone who want to help is welcomed :D. Just open an issue or a PR.
CRAFT-pytorchfor text detectionLaMafor object(text) removal
I am not really clear about the license I should use for this repo. https://github.com/advimman/lama use Apache-2.0 license while https://github.com/clovaai/CRAFT-pytorch use MIT license. Feel free to open an issue if you think the license that I use (MIT license) to label this repo is incorrect.