AI Upscaled Textures

Show off your mod creations or just a work in progress.
Post Reply
satsuki_yatoshi
Posts: 28
Joined: Mon Apr 29, 2019 8:29 pm

Re: AI Upscaled Textures

Post by satsuki_yatoshi »

King of Worms, i sent you an mp with de debug build and the way of using it.

satsuki_yatoshi
Posts: 28
Joined: Mon Apr 29, 2019 8:29 pm

Re: AI Upscaled Textures

Post by satsuki_yatoshi »

Here's the 1.05 version : http://wowsatsuki.free.fr/ESRganResizer.1.05.7z

Image

Image

here's the "how to" (also included in the archive)
#############################Installation:

First you need to install python, cuda, and dependencies:

1)Install python-3.6.2-amd64.exe (from "runtime" folder - default options).

2)Open an admin command prompt and do the following commands (may take some time to process all):
pip install scipy
pip install pillow
pip install numpy opencv-python
If you use a GTX card : pip3 install http://download.pytorch.org/whl/cu90/to ... _amd64.whl
If you use a RXT card : pip3 install pytorch torchvision cuda100 -c pytorch
pip3 install torchvision

then you can close the command prompt.

3)Install the others runtimes (default options)
ImageMagick-6.9.10-14-Q8-x86-static.exe
vcredist_x64.exe
vcredist_x86.exe
vbrun60sp6.exe

You can add your own models (just put them in the \esrgan\models folder).
#############################


#############################Use:

#########Debug options:
-Use CPU : Use your cpu for processing, very very slow, only if your gpu doesn't support cuda 9+.
-Don't delete temp files : Don't clean the folders "\provo", "\esrgan\LR" and "\esrgan\results" after the processing.

#########Waifu prefilter auto setup:
In this menu you can set up the waifu prefilter as you witch, DON'T forget to "set waifu prefilter command" to apply your waifu settings.
-Double step : use waifu for noise reduction + upscale 4x + downscale 4x instead of only do a noise reduction, it's more powerfull for cleaning but you'll loose some details.
-Waifu type : set up the IA model used for waifu processing.
-Noise reduction level : set up the power of noise reduction, big value clean a lot but eat a lot of details.
-Downscale type : when using "Double step" you need to choose a downscale type, some are more blury but clean more.

#########EsrGanResize:
Here you can choose the IA models for ESRgan processing, une only one model or interpolate 2 of them.

#########EsrGan model type
Most of the models you can found are 4x type (for a 4x upscale) but you can found some 1x models (cleaning only) or from 2x to 8x upscale.
Be sure to choose the right type or the esrgan processing will crash!

#########Postfilter chroma noise reduction
Some of esrgan model produice a chroma noise with some source picture, with this option you can filter the chroma noise after esrgan processing.

#########Prefilter command
Here you can see and edit the command used for prefilter(s).
If you only use waifu, you don't have to edit anything.
If you want to use your own filters here's the syntax to use:
##input## is your source file.
##output## is you final file ready for esrgan processing.
##1## to ##1000## are some temporary files if you need to use multi step processing.
the 'cmd.exe /c start /B /wait /low " " ' part you cans ee in front of all waifu prefilter command tell to the systeme to laucnh a command with low priority and to wait it's ending before do the next command.

exemple of a multi step prefilter:
cmd.exe /c start /B /wait /low " " "somenoisecleaner.exe" -someparams -input ##input## -output ##1##
cmd.exe /c start /B /wait /low " " "somedebandingfilter.exe" -someparams -input ##1## -output ##2##
cmd.exe /c start /B /wait /low " " "somebumpmappingfx.exe" -someparams -input ##2## -output ##output##

#########Save / load prefilter command:
Here you can save, load or delete a command(s) setup.
You can also disable prefilter to use only raw EsrGan.

#########Drag an drop ...:
Don't need to explain that part ^^

When you launch the upscale, you'll have a monitoring of the processing, please wait it's finishing, can be long.
You'll also have a reducted command line windows, don't close it or it'll cancel the processing, i let this command visible so if you want to cancel or if a bug appens, you can close it manualy.
If you got some processing error you can found them in the cmd log file.

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: AI Upscaled Textures

Post by King of Worms »

Thanks to Satsuki for his determination to find a source of the problem I was getting!
I will be able to use a next version (and I guess other users who would face similar problems as well)
Big up ;)

satsuki_yatoshi
Posts: 28
Joined: Mon Apr 29, 2019 8:29 pm

Re: AI Upscaled Textures

Post by satsuki_yatoshi »

you can use the current 1.05 ^^

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: AI Upscaled Textures

Post by King of Worms »

Downloaded. It runs. But the waifu crashes (the new version).. when I open this version of waifu directly, and click "Check cuDNN" it says the CUDA driver is not installed. But it was installed thru python in the setup of pre-requisities... so?

When I select "old waifu" method, drop a file in the upscale window and than click "set waifu prefilter command" this command appears:

cmd.exe /c start /B /wait /low " " "C:\Users\Xerxes\Desktop\ESRganResizer\waifu\waifu2x-converter_x64.exe" -i "##input##" -m noise --noise_level 0 -o "##1##" --model_dir "C:\Users\Xerxes\Desktop\ESRganResizer\waifu\models"
copy "##1##" "##output##"

Than I click - Go for upscale!

and I get this log

#############################################################
:#0#: Prefilter of 3-0.PNG
#############################################################

C:\Users\Xerxes\Desktop\ESRganResizer>cmd.exe /c start /B /wait /low " " "C:\Users\Xerxes\Desktop\ESRganResizer\waifu\waifu2x-converter_x64.exe" -i "C:\Users\Xerxes\Desktop\TEXTURE Library\PNG\TEXTURE.062 (Temple Snow Exteriors)\3-0.PNG" -m noise --noise_level 0 -o "C:\Users\Xerxes\Desktop\ESRganResizer\provo\0.1.provo.png" --model_dir "C:\Users\Xerxes\Desktop\ESRganResizer\waifu\models"

C:\Users\Xerxes\Desktop\ESRganResizer>copy "C:\Users\Xerxes\Desktop\ESRganResizer\provo\0.1.provo.png" "C:\Users\Xerxes\Desktop\ESRganResizer\esrgan\LR\0.box25p.png"
The system cannot find the file specified.

#############################################################
:##: Starting ESRgan upscale
#############################################################

C:\Users\Xerxes\Desktop\ESRganResizer>C:

C:\Users\Xerxes\Desktop\ESRganResizer>cd "C:\Users\Xerxes\Desktop\ESRganResizer\esrgan\"

C:\Users\Xerxes\Desktop\ESRganResizer\esrgan>cmd.exe /c start /B /wait /low " " python test.py models/cartoonpainted.pth

I guess Im doing something wrong :lol:

Sorry for being such pain in the a...

satsuki_yatoshi
Posts: 28
Joined: Mon Apr 29, 2019 8:29 pm

Re: AI Upscaled Textures

Post by satsuki_yatoshi »

could you enable advanced log so we can have the errors loggued too ?

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: AI Upscaled Textures

Post by King of Worms »

Sure will try tomorrow, its midnight here :)

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: AI Upscaled Textures

Post by King of Worms »

Well, with advanced log I found out, that there was a wrong prefilter parameter (which was automatically generated by clicking "set waifu prefilter command") Problem was this:

noise_level 0
Ive changed it to "1" and it works..

Its actually a bug. When you set the number of noise reduction level from a drop down menu next to the waifu settings menu, and than click to create a prefilter command, that number doesnt translate corectly. 1 becomes 0, 2 becomes 1 and 3 becomes 2 in the command. Noise level 0 is not a valid parameter here.. so thus the error msg I received in the log.
this.jpg
this.jpg (263.92 KiB) Viewed 2049 times

But when this was solved, the esrgan and postfilter process starts and finishes succesfully! Nice!!!

Only remaining problem is, that I can ONLY use OLD WAIFU method, because everything else just crashes.
Im quite sure its because of this "CUDA driver version is insufficient for CUDA runtime version"

But Ive installed the CUDA according to the HowTo file. Cu90 I guess? Should I try something more recent? I have gtx970 and win7 x64

Thank you, hope this helps ;)

satsuki_yatoshi
Posts: 28
Joined: Mon Apr 29, 2019 8:29 pm

Re: AI Upscaled Textures

Post by satsuki_yatoshi »

thanks for the bug report, seems i messed up the noise level stuff when i have cleaned the ui.
i'll check for the waifu cuda error, but i might by driver related rather cuda related.

satsuki_yatoshi
Posts: 28
Joined: Mon Apr 29, 2019 8:29 pm

Re: AI Upscaled Textures

Post by satsuki_yatoshi »

I think i have spotted the waifu bug you have.
modern waifu as 3 processing option:
-cpu (for non cuda gpu)
-gpu (for cuda gpu)
-cudnn (for cuda gpu + specifics dll / driver / api versions)

so in next release i'll add the choise and i think with "gpu" instead of "cudnn" it'll works for you too ^^

Post Reply