pnzr00t / remove-text-from-image

Remove text from image with python
12 stars 1 forks source link

The InPaint Model Generator Doesn't behave as it should have #2

Open KareemAfifi opened 11 months ago

KareemAfifi commented 11 months ago

Hi , I really liked the work you did , and want to take things even further and finish what you have started, I have used the Code you provided, I run , The Masks are Created Correctly , however i believe that the InPanint Model Generator is quite misbehaving. So What might be the problem :Here is the photo of what i mean :

CCCC Thanks in advance Here is also the link to the original image for you to try: https://onlinejpgtools.com/images/preview-image-onlinejpgtools.png Regards

pnzr00t commented 11 months ago

Hello @KareemAfifi Thank you for you words. But what you offering, if you want make some corrections, i'm do not mind.

When i make this service, this was good solution for my task, for you task, i think you need make some thing like object recognition model, witch will be make decision, will you use InPaint model, or just fill mask by average color token, in you case it's will be white

KareemAfifi commented 11 months ago

But, from what I understand your model does the painting automatically and with no issue, I think that there is something i am doing wrong related to imports or something. That's why I am raising an issue, that you are not required to assist much , but would appreciate so much your help

I want to start from where you stopped , that's why I want to run your model and achieve the results you have achieved.

pnzr00t commented 11 months ago

Yes, it's auto painted, and as you see, if you after delete text you get blanked image, they try draw some thing (some model are drawing crepe faces).

As i say early, how i may help you? I may show code where "recovery painted" started, or if you need, i may translate comment to English language?

If you wont results as results in my screens, just use another images, line photo with texts (i use memes from internet). If you get problems with recovery, in 99% chance that model's not uploaded.

For test you may use my "base" image witch you can find in this url image https:// raw.githubusercontent.com/pnzr00t/remove-text-from-image/main/ImagesExamples/joker/origin.png

KareemAfifi commented 11 months ago

Okay , Thank you so much for your reply, To cut to the Point, Where is the trained model that have mentioned that I can use right away ?. Even when I use the meme Photo of the Joker, the results are no the best thing, that's why I am referring this to the model used same as you did

pnzr00t commented 11 months ago

May you send me result with joker?

pnzr00t commented 11 months ago

In file https://github.com/pnzr00t/remove-text-from-image/blob/main/install_project.sh First wit clone 2 git repos

git clone https://github.com/clovaai/CRAFT-pytorch.git
git clone https://github.com/sujaykhandekar/Automated-objects-removal-inpainter.git

After several steps you may see downloading models

# create dir for models
mkdir weights
# craft main
wget -O weights/craft_mlt_25k.pth https://drive.google.com/uc?id=1Jk4eGD7crsqCCg9C9VjCLkMN3ze8kutZ&export=download
# craft refiner
# !!!!!!!!!!Есть вероятность что она не нужна!!!!!!!!!!!!!!!
wget -O weights/craft_refiner_CTW1500.pth https://drive.google.com/uc?id=1XSaFwBkOaFOdtk4Ane3DFyJGPRw6v5bO&export=download

##### >>>>HERE WE DOWLOADING MODELS AND COPY IN OUT PATHS<<<<< ###########
# Automated-objects-removal-inpainter
bash ./Automated-objects-removal-inpainter/scripts/download_model.sh
#Copy edge model
cp ./checkpoints/celeba/* ./checkpoints/
#%cp ./checkpoints/psv/* ./checkpoints/
#%cp ./checkpoints/places2/* ./checkpoints/

Some peoples write that thay have a problems with that, but in my PC, i can't repeat them (probably i'll install some tools, and forget write downloading and installing in my scripts)