Skip to content
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

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

Merged
merged 5 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bmf/demo/colorization_python/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ git clone https://github.com/eefengwei/DeOldify.git DeOldify

### 1.2 install the dependent python packages
```Bash
pip3 install -r ./DeOldify/requirements-colab.txt
pip3 install -r ./requirements.txt
```

### 1.3 download the pretrained-weights
Expand All @@ -46,7 +46,7 @@ wget -c https://data.deepai.org/deoldify/ColorizeVideo_gen.pth -O ./DeOldify/mod

### 1.4 pip install BMF packages
```Bash
pip3 install bmf
pip3 install BabitMF BabitMF-GPU
sfeiwong marked this conversation as resolved.
Show resolved Hide resolved
```
### 1.5 verify the FFmpeg libraries is installed and version is correct

Expand All @@ -73,7 +73,7 @@ ffmpeg -version

```Python
import sys
sys.path.insert(0, '/content/DeOldify')
sys.path.insert(0, './DeOldify')
print(sys.path)
```

Expand Down
6 changes: 0 additions & 6 deletions bmf/demo/colorization_python/deoldify_demo.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import bmf
import py_deoldify_module

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

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

input_video_path = './DeOldify/test_videos/test_video.mp4'
output_video_path = 'colored_video.mp4'
model_weight_path = './DeOldify/'
Expand Down
6 changes: 6 additions & 0 deletions bmf/demo/colorization_python/py_deoldify_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
import PIL
import bmf.hml.hmp as mp

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

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

from deoldify import device
from deoldify.device_id import DeviceId
import torch
Expand Down
9 changes: 9 additions & 0 deletions bmf/demo/colorization_python/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
fastai==1.0.60
tensorboardX>=1.6
ffmpeg-python
yt-dlp
opencv-python>=4.2.0.32
Pillow
tornado
imgaug==0.2.6
ipython