Author Topic: ESRganResizer 1.1.5 (a simple GUI for ERSgan + prefilter) (11/09/2019)  (Read 9741 times)

satsuki

  • Insane poster
  • *
  • Posts: 336
  • Karma: 54
    • View Profile
    • My softs (french only)
Hello, as i have cleaned the tool i use for esrgan + waifu prefilter (to share it with someone who needed it), I share it here too... may be helpfull for some of you ^^





You need to extract the archive then follow the howto before using it (need to install cuda, python...)
You need a cuda9/10 capable gpu (nvidia gt9xx at least)
64bit windows.
The processing can take a lot of time (about 3/5s for a 640*480 picture on my gtx1060)
As ESRgan is realy gpu/ram dependant, you're going to be limited in source picture size (if too big the esrgan won't process depending en your gpu/ram)
I included a 'cpu' processing so you can use it without cuda but it will be realy slow (about 7min for a 640*480 on my core i7 8700k but on small picture it remain resonably fast)

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

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

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

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/torch-0.4.1-cp36-cp36m-win_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
Git-2.21.0-64-bit.exe

You can add your own models (just put them in the \esrgan\models folder).
Some great model are here too : https://github.com/alsa64/AI-wiki/wiki/Model-Database
#############################

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

#########Debug options:
-Use CPU instead of GPU (slow !): Use your cpu for processing, very very slow, only if your gpu doesn't support cuda 9+.
-Advanced log : log the errors in addition of standard output in the real time log and the log.txt file.

#########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.

#########Split source
If the source file is too big for processing with your gpu ram, you can auto split the source (it will be re-assembled after esrgan)

#########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 ^^

#########Add filters information to final file's name
Add informations in the esrgan file name (prefilter, witch model used...), it's usefull to test several settings

#########Output to video...
To process a video with esrgan, it's converted to png files.
If you wan't to convert it back to video, you can use this option to convert the esrgan png to a mkv x264 file (il will also get the source audio's track).
The crf if the quality of the video, smaller value means better quality but bigger file, value from 16 to 24 are good choises.

When you launch the upscale, you'll have a monitoring of the processing, please wait it's finishing, can be long.
If you got some processing error you can found them in the cmd log file.

The processed files output will be in a "ESRgan" subfolder in the original file folder.

download link : http://wowsatsuki.free.fr/ESRganResizer.1.1.5.7z
« Last Edit: 2019-09-11 19:34:42 by satsuki »

Manakaiser

  • Cool newbie
  • *
  • Posts: 80
  • Karma: 3
    • View Profile
While I personally cant make much use of this; it is objectively speaking a great tool! Good work.

CreeperLava

  • Newbie
  • *
  • Posts: 2
  • Karma: 1
    • View Profile
Just wanted to say thank you for the tool. It makes using ESRGAN more practical. I was hoping you implemented some kind of image splitting for when the picture doesn't fit into the available VRAM. Is that something you plan on implementing at some point ?

Kaldarasha

  • No life
  • *
  • Posts: 2426
  • Karma: 153
  • Prince of Model Editing
    • View Profile
Hmm, looks like Mass Effect gets a new texture improvements.

HybOj

  • Fast newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
Hello, I downloaded this tool, installed the pre-requisities, installed the python and processed all the scripts succesfully.
I have gtx970, windows 7 x64, 8gb ram

Yet, when I finally click on the ESRganResizer I get:

Unexpected error

Is there any way to find out what is going on? Some logs? Anything?

Thanks in advance!!


satsuki

  • Insane poster
  • *
  • Posts: 336
  • Karma: 54
    • View Profile
    • My softs (french only)
Can you post a screenshot ?
Have you tried to run it as adminstrator
I haven't tested it in windows 7 but it needs a 64bits os (are you on windows 64 bits or 32 bits ?)

CreeperLava

  • Newbie
  • *
  • Posts: 2
  • Karma: 1
    • View Profile
Hmm, looks like Mass Effect gets a new texture improvements.

My, my, am I that famous ? :D

I'm looking into ESRGAN and Gigapixel for some more texture improvements, but for now Gigapixel has proved so much easier to use than ESRGAN that I almost only use it. Hence my question about image splitting, which would convince me to give ESRGAN a more serious try. That and the pregenerated models alsa64 shared on Discord, which make my life a lot easier.
« Last Edit: 2019-04-25 19:42:56 by CreeperLava »

satsuki

  • Insane poster
  • *
  • Posts: 336
  • Karma: 54
    • View Profile
    • My softs (french only)
Version 1.01 on the first message:
-Corrected a bug when you uncheck the waifu prefilter without inchecking the double step.
-Added a security so you can't launch with an empty list.
-Added a 'cpu' mod so you can test waifu + esrgan without a cuda gpu.

BlackShadow

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
For some reason i can't get the output file when i render with Cuda.

I have RTX 2080ti with i9-9900k.

satsuki

  • Insane poster
  • *
  • Posts: 336
  • Karma: 54
    • View Profile
    • My softs (french only)
maybe you can try with cuda 10, don't know if cuda 9 is supported for such a new card

Manakaiser

  • Cool newbie
  • *
  • Posts: 80
  • Karma: 3
    • View Profile
That is in fact the reason, rtx needs cuda 10 torch.

install pytorch torchvision cuda100 -c pytorch
« Last Edit: 2019-04-28 08:57:31 by Manakaiser »

satsuki

  • Insane poster
  • *
  • Posts: 336
  • Karma: 54
    • View Profile
    • My softs (french only)
thanks, command added to the howto in first message

HybOj

  • Fast newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
I dont have the prog anymore because I was not able to run it.
But the screenshot would not made any benefit, it was a white tab 5x4cm with a text which stated: "Unexpected error" and that was it.

Yes, I tryed running as admin.
And yes, I have 64bit OS (Win7 x64)

Absolutely no idea on what was going on, because there were no logs to hint on the source of a problem :X

Im very sad about it, I work on Daggerfall Remaster, 2nd year, wanted to try to use this prog on some images/sprites :X

Anyway, there is this msg for you from the daggerfall forums form the user MrFlibble, who is active in this field on many forums:

Instead of copy paste, I link you there... 2nd post on that page:
https://forums.dfworkshop.net/viewtopic.php?f=14&p=23696#p23696

Be well! And Im damned :/ Suxx I cant use this tool, why o why

BlackShadow

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Hi there,

I also tried with CUDA 10.0 before. But no luck. But i can share my ESRGan GUI settings and CMD output if it's gonna help you.

CMD Output


ESRGAN GUI Settings:



Cheers
« Last Edit: 2019-04-29 17:35:52 by BlackShadow »

satsuki

  • Insane poster
  • *
  • Posts: 336
  • Karma: 54
    • View Profile
    • My softs (french only)
Seems waifu don't do its job.
Have you tried without waifu prefilter ?

satsuki

  • Insane poster
  • *
  • Posts: 336
  • Karma: 54
    • View Profile
    • My softs (french only)
Next version on its way :


With this version you can use it as the current version with provided prefilters, but you'll can also set up your own prefilter commands.
It'll take me some time to do a proper setup but i'll share it asap

BlackShadow

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Yes i've tried literally every possible way but no luck.

themadpatter

  • Fast newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Looking forward to the next version. There are a few models for de-dithering and JPEG artifact removal that are x1 models. Do you know if you can code this support in? So far just been manually editing the .py file to have upscale=1, or making a copy of that file with equaling one and then swapping file. I think model 1 and model 2 at the moment use the same python file and there is not a way to mix an x1 and x4 file (for obvious reasons). Default should naturally be x4 as that is what the majority of models are setup to be, but there is a growing amount of x1 models I think. There are a few x2 models too that I know of.

Mcindus

  • Freak
  • *
  • Posts: 856
  • Karma: 150
  • Artist, Modder, Musician.
    • View Profile
    • Lunatic Pandora
I'm really looking forward to your next release.  Probably going to be using it on all of my mods. :D

HybOj

  • Fast newbie
  • *
  • Posts: 6
  • Karma: 1
    • View Profile
Looking forward new release and praying it will actually work for me.
Thanks for contacting our community at Daggerfall forums :)

satsuki

  • Insane poster
  • *
  • Posts: 336
  • Karma: 54
    • View Profile
    • My softs (french only)
@themadpatter
I'll try to implement it in a easy way

@Mcindus
Maybe in a day or two, i'm realy busy ATM

satsuki

  • Insane poster
  • *
  • Posts: 336
  • Karma: 54
    • View Profile
    • My softs (french only)
Version 1.05 ready:
-Lots of UI change
-Added a way to use 1x,2x,4x,6x and 8x models
-Added a prefiter section so you can use your own prefilter's commands
-Added as save/load command to save and restore your own commands
-Added progress bar for easy check the processing
-Added a log file you can view in case of bugs
....

themadpatter

  • Fast newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Great work on that update! Things work well for my different models. I seem to be able to run the GUI version of waifu2x-caffe.exe fine, but somehow not able to properly run the commands through waifu2x-caffe-cui.exe. I gotta figure out what might be blocking that for me, but then my setup should work quite well. Thank you!

satsuki

  • Insane poster
  • *
  • Posts: 336
  • Karma: 54
    • View Profile
    • My softs (french only)
Version 1.06 ready:
-Updated waifu2x-caffe to lastest version
-Added an option to choose cuda or cudnn engine for waifu2x-caffe
-Corrected a bug with noise level reduction with waifu command generator (thanks King of Worms)

themadpatter

  • Fast newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Swapping to CUDA fixed my issue. Amazing! :D