bmf icon indicating copy to clipboard operation
bmf copied to clipboard

Fix the bug of Missing dependencies and DeOldify path set in demo colorization_python

Open JackLau1222 opened this issue 1 year ago • 0 comments

DeOldify path set

the py_deoldify_module.py will be executed firstly, but the sys.path.insert(0, './DeOldify') writed in deoldify_demo.py, so there will be meeting error like this ModuleNotFoundError: No module named 'deoldify'

root@73559b1846e1:~/bmf/bmf/demo/colorization_python# python3 deoldify_demo.py 
Traceback (most recent call last):
  File "deoldify_demo.py", line 2, in <module>
    import py_deoldify_module
  File "/root/bmf/bmf/demo/colorization_python/py_deoldify_module.py", line 7, in <module>
    from deoldify import device
ModuleNotFoundError: No module named 'deoldify'

so i move the code into py_deoldify_module.py

# Add the DeOldify folder to the python search path
import sys

sys.path.insert(0, './DeOldify')
print(sys.path)

from deoldify import device

Missing dependencies

The DeOldify project missing dependence IPython

root@73559b1846e1:~/bmf/bmf/demo/colorization_python# python3.8 deoldify_demo.py 
['./DeOldify', '/root/bmf/bmf/demo/colorization_python', '/root/bmf/bmf/demo/colorization_python', '/usr/local/lib/python3.8/dist-packages/nvcv_python', '/root/bmf/output', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/usr/local/lib/python3.8/dist-packages', '/usr/lib/python3/dist-packages']
INFO:matplotlib.font_manager:generated new fontManager
generated new fontManager
INFO:numexpr.utils:Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
Note: NumExpr detected 40 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
INFO:numexpr.utils:NumExpr defaulting to 8 threads.
NumExpr defaulting to 8 threads.
Traceback (most recent call last):
  File "deoldify_demo.py", line 2, in <module>
    import py_deoldify_module
  File "/root/bmf/bmf/demo/colorization_python/py_deoldify_module.py", line 14, in <module>
    from deoldify.visualize import *
  File "/root/bmf/bmf/demo/colorization_python/./DeOldify/deoldify/visualize.py", line 13, in <module>
    from IPython import display as ipythondisplay
ModuleNotFoundError: No module named 'IPython'

so i add a requirements.txt in the demo directory contains ipython

pip install BMF packages name is wrong in README.md

i fix it to the right name BabitMF and BabitMF-GPU but bmf

JackLau1222 avatar May 24 '24 13:05 JackLau1222