video2x icon indicating copy to clipboard operation
video2x copied to clipboard

New container builds are missing AI models

Open LukeShortCloud opened this issue 1 year ago • 1 comments

Optional dependencies are not installed (which are all of the AI models).

$ python3.9 -m video2x --input foo.mp4 --output bar.mp4 upscale -h 4096 -w 2160 -a realsr
03:46:07.658623 | INFO     | Video2X 5.0.0-beta7
03:46:07.658762 | INFO     | Copyright (C) 2018-2023 K4YT3X and contributors.
03:46:07.658817 | INFO     | Reading input video information
03:46:07.704294 | ERROR    | No module named 'realsr_ncnn_vulkan_python'
Traceback (most recent call last):

  File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
           │         │     └ {'__name__': '__main__', '__doc__': '\nCopyright (C) 2018-2023 K4YT3X and contributors.\n\nThis program is free software: you...
           │         └ <code object <module> at 0x7f0806e005b0, file "/home/user/git/video2x/video2x/__main__.py", line 3>
           └ <function _run_code at 0x7f0815795160>
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
         │     └ {'__name__': '__main__', '__doc__': '\nCopyright (C) 2018-2023 K4YT3X and contributors.\n\nThis program is free software: you...
         └ <code object <module> at 0x7f0806e005b0, file "/home/user/git/video2x/video2x/__main__.py", line 3>

  File "/home/user/git/video2x/video2x/__main__.py", line 232, in <module>
    sys.exit(main())
    │   │    └ <function main at 0x7f0806e04ca0>
    │   └ <built-in function exit>
    └ <module 'sys' (built-in)>

> File "/home/user/git/video2x/video2x/__main__.py", line 197, in main
    video2x.upscale(
    │       └ <function Video2X.upscale at 0x7f0806e04700>
    └ <video2x.video2x.Video2X object at 0x7f0806dbcac0>

  File "/home/user/git/video2x/video2x/video2x.py", line 415, in upscale
    self._run(
    │    └ <function Video2X._run at 0x7f0806e04670>
    └ <video2x.video2x.Video2X object at 0x7f0806dbcac0>

  File "/home/user/git/video2x/video2x/video2x.py", line 164, in _run
    processor_module = import_module(module_name)
                       │             └ 'realsr_ncnn_vulkan_python'
                       └ <function import_module at 0x7f08157a3dc0>

  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           │          │           │    │        │        └ 0
           │          │           │    │        └ None
           │          │           │    └ 0
           │          │           └ 'realsr_ncnn_vulkan_python'
           │          └ <function _gcd_import at 0x7f08158ce310>
           └ <module 'importlib._bootstrap' (frozen)>
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked

ModuleNotFoundError: No module named 'realsr_ncnn_vulkan_python'
$ less pyproject.toml
[project.optional-dependencies]
all = [
  "waifu2x-ncnn-vulkan-python>=1.0.4",
  "srmd-ncnn-vulkan-python>=1.0.2",
  "realsr-ncnn-vulkan-python>=1.0.6",
  "rife-ncnn-vulkan-python>=1.2.1",
  "realcugan-ncnn-vulkan-python>=1.0.2",
  "anime4k-python>=1.0.0",
]
waifu2x = ["waifu2x-ncnn-vulkan-python>=1.0.4"]
srmd = ["srmd-ncnn-vulkan-python>=1.0.2"]
realsr = ["realsr-ncnn-vulkan-python>=1.0.6"]
rife = ["rife-ncnn-vulkan-python>=1.2.1"]
realcugan = ["realcugan-ncnn-vulkan-python>=1.0.2"]
anime4k = ["anime4k-python>=1.0.0"]

Running python3.9 -m pip install .[all] addresses that. However, running that in the stage 2 container which does not have any compilers results in this error:

      CMake Error at CMakeLists.txt:5 (project):
        No CMAKE_CXX_COMPILER could be found.

LukeShortCloud avatar Nov 08 '23 03:11 LukeShortCloud

Stage 1 compiles the binaries needed and then stage 2 copies those binaries over. That is expected behavior so you can ignore my last sentence from the previous comment. However, optional dependencies are still missing on new container image builds. My open PR is open to address that.

LukeShortCloud avatar Nov 09 '23 03:11 LukeShortCloud