Sanster / IOPaint

Image inpainting tool powered by SOTA AI Model. Remove any unwanted object, defect, people from your pictures or erase and replace(powered by stable diffusion) any thing on your pictures.
https://www.iopaint.com/
Apache License 2.0
19.7k stars 2.01k forks source link

How to use python to run lama cleaner to remove text with text box coordinates? #435

Open nissansz opened 10 months ago

nissansz commented 10 months ago

How to use python to run lama cleaner to remove text with text box coordinates?

Sanster commented 10 months ago

You can use the text box to generate a black background and white text mask, then use iopaint run to batch process images.

nissansz commented 10 months ago

Cannot run lama-cleaner-iopaint-1.0.0b2>python main.py start Traceback (most recent call last): File "main.py", line 4, in entry_point() File "F:\pycharm2020.2\lama-cleaner-iopaint-1.0.0b2\iopaint__init.py", line 13, in entry_point from iopaint.cli import typer_app File "F:\pycharm2020.2\lama-cleaner-iopaint-1.0.0b2\iopaint\cli.py", line 5, in from fastapi import FastAPI File "D:\Python3.8.8\lib\site-packages\fastapi\init__.py", line 7, in from .applications import FastAPI as FastAPI File "D:\Python3.8.8\lib\site-packages\fastapi\applications.py", line 15, in from fastapi import routing File "D:\Python3.8.8\lib\site-packages\fastapi\routing.py", line 22, in from fastapi import params File "D:\Python3.8.8\lib\site-packages\fastapi\params.py", line 4, in from pydantic.fields import FieldInfo, Undefined ImportError: cannot import name 'Undefined' from 'pydantic.fields' (D:\Python3.8.8\lib\site-packages\pydantic\fields.py)

Sanster commented 10 months ago

What is your pydantic and fastapi version?

nissansz commented 10 months ago

Tried both 2.5.3, 2.5.2. Failed

nissansz commented 10 months ago

Any solution?

nissansz commented 10 months ago

Is it possible to run the lama inpaint function without fastapi, pydantic etc.? How to do so?