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

How to setup on Ubuntu 20.xx Linux? #540

Closed
omikron88 opened this issue Aug 30, 2021 · 13 comments
Closed

How to setup on Ubuntu 20.xx Linux? #540

omikron88 opened this issue Aug 30, 2021 · 13 comments
Assignees
Labels
platform:Linux Linux platform

Comments

@omikron88
Copy link

When I clone the git repo, go to src dir and run

sudo ./video2x_setup_ubuntu.sh

it installs some dependencies but then

Installing collected packages: pyyaml, python-magic, pyqt5, pillow, patool, colorama, avalon-framework
Attempting uninstall: pyyaml
Found existing installation: PyYAML 5.3.1
ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

There were some changes in Python between Ubuntu 18 LTS and Ubuntu 20 LTS, ie. switching Python2 to Python3 as the default.

Does anybody run Video2x on Ubuntu 20 LTS and may give me an receipt for installation, please?

@k4yt3x
Copy link
Owner

k4yt3x commented Aug 31, 2021

The easier way would be to use the Docker image. If you would like to run it on bare metal, then you'll have to recompile all of the components. In version 4.x.x, there isn't an elegant way to do this. The upcoming 5.0.0 version, on the other hand, will be delivered as a Python package which can be installed pretty easily. Before that happens, I'd suggest you to stick with the Docker container.

If you don't mind playing around a bit though, I have a bundle of drivers compiled for 5.0.0 + Ubuntu. You can try setting that up as well. If you're inclined, I can walk you through it.

@tonym1995
Copy link

tonym1995 commented Sep 5, 2021

@omikron88 I had the same problem and solved it by using apt to uninstall pyqt5-dev and python3-pyqt5. I then reinstalled pyqt5 using pip then uninstalled using pip.

Although that is not the end of the problems. There are a number of breaking changes that prevent compilation in files /tmp/video2x/waifu2x-caffe-ubuntu/common/waifu2x.cpp, /tmp/video2x/waifu2x-caffe-ubuntu/caffe/src/caffe/layers/window_data_layer.cpp, /tmp/video2x/waifu2x-caffe-ubuntu/caffe/src/caffe/util/io.cpp and /tmp/video2x/waifu2x-caffe-ubuntu/common/stImage.cpp

I managed to fix them all by copying the files fixing them and them copying then back when the compilation started.

That worked but then I got a linking error:

[ 81%] Linking CXX executable convert_imageset
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `PyUnicode_InternFromString'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `_Py_Dealloc'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `PyModule_Create2'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `PyType_GetFlags'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `_Py_fopen'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `PyUnicode_FromString'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `PyBytes_AsString'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `PyBytes_Size'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `PyUnicode_AsWideChar'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `PyUnicode_FromEncodedObject'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `PyUnicode_AsUTF8'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `PyUnicode_AsUTF8String'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `PyUnicode_FromFormat'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `_Py_tracemalloc_config'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `PyUnicode_FromStringAndSize'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libboost_python38.so.1.71.0: undefined reference to `_PyTraceMalloc_NewReference'
collect2: error: ld returned 1 exit status

That has finally beaten me unless I find a solution. I've been at this for over 12 hours so I'm quitting for now.

@k4yt3x

What is the docker app? I might try that.
If you can send information on your ubuntu bundle for 5.0.0 I would be interested to give it a go.

I've got a bunch of VCR captured home videos from the 90's of varying quality I would like to improve if possible. It would be great to get it working.

As a matter of interest I found these guys https://audo.ai/ for fixing up sound. I uploaded a 2 minute sound file extracted from a vhs capture with a lot of mains power hum an poor volume on the voices. It removed the background noise completely. It wasn't 100% perfect but close. Just thought I'd mention it in case anyone is doing the same thing.

Many Thanks

@k4yt3x
Copy link
Owner

k4yt3x commented Sep 6, 2021

Please refer to this and this for a quick-start on the usage of the Docker image.

Pre-compiled drivers are required for the beta version. You can download them here. You will need to roughly follow the following steps:

# clone this project's git repo
git clone https://github.com/k4yt3x/video2x
cd video2x/video2x
git checkout -t origin/5.0.0-beta

# download the pre-compiled wrappers
wget https://files.k4yt3x.com/Projects/Video2X/wrappers.tar.gz
tar xzf wrappers.tar.gz

You'll need to install some Python packages, but some of the repos in the requirements.txt are still WIP. You can manually install these packages with a pip command.

image

After these commands, you should have a directory structure similar to this.

image

Then, you can up one level in the directory structure back to the root of this repo. You will end up in video2x/video2x from the last step, and you'll need to go back to just video2x. Finally, you can run video2x as a python module. The command below upscales input.mp4 with waifu2x-ncnn-vulkan with noise=3 into output.mp4. The ratio is determined dynamically and automatically. You will only need to specify the height or width and it will calculate the rest.

python -m video2x -i input.mp4 -o output.mp4 -p5 upscale -h 1440 -d waifu2x -n3

A more granular breakdown:

python -m video2x \
       -i input.mp4 \     # input file path
       -o output.mp4 \    # output file path
       -p5 \              # launch 5 processes
       upscale \          # operation (the other option is `interpolate`)
       -h 1440 \          # output video height
       -d waifu2x \       # use waifu2x
       -n3                # noise=3

P.S. enclose your console text in a pair of ```s so they're easier to read.

@tonym1995
Copy link

tonym1995 commented Sep 7, 2021 via email

@k4yt3x
Copy link
Owner

k4yt3x commented Sep 7, 2021

@tonym1995

You'll need to install some Python packages, but some of the repos in the requirements.txt are still WIP. You can manually install these packages with a pip command.

@tonym1995
Copy link

tonym1995 commented Sep 8, 2021 via email

@k4yt3x
Copy link
Owner

k4yt3x commented Sep 8, 2021

Python 2 is deprecated. This project is written with Python 3. I am using python in my commands because on Arch python is now Python 3. You might need to use python3 and pip3.

@tonym1995
Copy link

tonym1995 commented Sep 9, 2021 via email

@k4yt3x
Copy link
Owner

k4yt3x commented Sep 10, 2021

I think I know what's wrong. The latest commit is not at a working stage. I'll have to change a few things for it to work properly.

image

@k4yt3x
Copy link
Owner

k4yt3x commented Sep 20, 2021

Hey sorry it took me this long. My semester has started and I'm getting quite busy.

It should work if you revert back to this commit: f283a12 (f283a12a0b430e5226d09bb75851f3d3982dec24)

If it still doesn't work, I'll write up a new version that does work properly and send you a ZIP.

@dyanakiev
Copy link

dyanakiev commented Dec 29, 2021

Can i just run the commands from the Video2X_on_Colab.ipynb https://github.com/k4yt3x/video2x#google-colab on Ubuntu/Debian i will try that in the following days i suspect it should be working without docker?

@k4yt3x
Copy link
Owner

k4yt3x commented Feb 6, 2022

The thing is setting it up without docker requires you configure everything properly on your host. It is 1) a complex process to ensure everything is configured properly, 2) creates a lot of files on your system that are difficult to cleanup later. A docker container can be installed and removed like...well, a container, so none of these issues exist.

@k4yt3x k4yt3x added the platform:Linux Linux platform label Feb 6, 2022
@k4yt3x
Copy link
Owner

k4yt3x commented Feb 6, 2022

Since this thread has been idle for a while, I'll close the issue for now for housekeeping purposes. Feel free to keep posting.

@k4yt3x k4yt3x closed this as completed Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:Linux Linux platform
Projects
None yet
Development

No branches or pull requests

4 participants