nagadomi / nunif

Misc; latest version of waifu2x; 2D video to stereo 3D video conversion
MIT License
1.58k stars 142 forks source link

Improve the installation for windows #44

Closed My12123 closed 1 year ago

My12123 commented 1 year ago

Instead of anaconda, it is better to use venv

Even better if this code will be executed by itself. I have a problem with running commands in venv is it possible to fix it? Installation code for windows

# Install python 3.10
python -m venv venv
cd .\nunif\venv\Scripts
activate.bat
cd .. # move one directory back
cd ..
pip3 install torch torchvision torchaudio torchtext --index-url https://download.pytorch.org/whl/cu116
pip install -r requirements.txt
python -m waifu2x.download_models
python -m waifu2x.web.webgen

Startup code for windows

cd .\venv\Scripts
activate.bat
cd .. # move one directory back
cd ..
python -m waifu2x.web --no-size-limit --tile-size 400

I usually run using the commands

F:
cd F:\nunif
cd .\venv\Scripts
activate.bat
cd ..
cd ..
python -m waifu2x.web --no-size-limit --cache-ttl 120 --cache-dir F:\nunif\waifu2x\cache --tile-size 400
nagadomi commented 1 year ago

Yes, it is better not to use the conda package manager if you can avoid using it. However, there are some modules that are only available on conda repository (It is not currently in nunif's dependency modules).


I have a problem with running commands in venv is it possible to fix it?

What is the problem?

cd .\nunif\venv\Scripts
activate.bat
cd .. # move one directory back
cd ..

This part can be done on one line. nunif\venv\Scripts\activate

Here is an example of run-web.bat

cd /d F:\nunif
.\venv\Scripts\activate
python -m waifu2x.web --no-size-limit --cache-ttl 120 --cache-dir F:\nunif\waifu2x\cache --tile-size 400
My12123 commented 1 year ago

2023-06-25_18-16-52 The command is not executed python -m waifu2x.web --no-size-limit --cache-ttl 120 --cache-dir F:\nunif\waifu2x\cache --tile-size 400 How do I make run-web.bat not close?

nagadomi commented 1 year ago

It seems that "call" is needed to run activate.bat.

cd /d F:\nunif
call .\venv\Scripts\activate
python -m waifu2x.web --no-size-limit --cache-ttl 120 --cache-dir F:\nunif\waifu2x\cache --tile-size 400
pause
My12123 commented 1 year ago

https://github.com/nagadomi/nunif/pull/46

My12123 commented 1 year ago

https://github.com/nagadomi/nunif/pull/48