Skip to content

FileNotFoundError: [Errno 2] No such file or directory: 'prediction/inpainting/...' #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lerfer78 opened this issue Feb 26, 2025 · 1 comment

Comments

@lerfer78
Copy link

I'm getting the same error when run locally or through colab.

FileNotFoundError: [Errno 2] No such file or directory: 'prediction/inpainting/Test1/Test1.png'
Traceback:
File "/usr/local/lib/python3.11/dist-packages/streamlit/runtime/scriptrunner/script_runner.py", line 535, in _run_script
    exec(code, module.__dict__)
File "/content/gdrive/MyDrive/MangaQuick-main/MangaQuick-main/MangaQuick.py", line 469, in <module>
    text_injection(
File "/content/gdrive/MyDrive/MangaQuick-main/MangaQuick-main/components/text_injection.py", line 24, in text_injection
    image = Image.open(f'prediction/inpainting/{name}/{mask_name}')
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/PIL/Image.py", line 3247, in open
    fp = builtins.open(filename, "rb")
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The mask is found inside \segmentation\Test1... beside the original image. How do I configure it so that it creates/checks for the correct directory?

@DCY1117
Copy link
Owner

DCY1117 commented Feb 27, 2025

Make sure Big Lama is downloaded and placed in the correct directory as specified in the GitHub README.

  • The inpainting mask (inpainting/) contains the cleaned image used for text injection.
  • The segmentation mask (segmentation/) contains the text mask—you can check it to verify its contents.

Your issue is that the inpainting image is not being generated. To troubleshoot:

Ensure Big Lama is correctly installed following the README instructions.
Verify the directory structure:

  • components/image_inpainting/models/big-lama/
    Inside big-lama/, you should have:
  • models/
  • The configuration file

For colab is the same, I added a line of code to do move the folder automatically, so it should work now, you don't need to manually put the big-lama folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants