n00mkrad / cupscale Goto Github PK
View Code? Open in Web Editor NEWImage Upscaling GUI based on ESRGAN
License: MIT License
Image Upscaling GUI based on ESRGAN
License: MIT License
Upscaling .tga files through Cupscale I noticed that there's a wierd issue with output images. All textures upscaled through Cupscale appear inverted ingame, however actual textures when opened with image editor appears fine. All that with "TGA: Apply rotation fix ( Flip )" enabled in Cupscale settings. But when I disable that fix output image appear flipped but actually work properly ingame. So when fix is applied texture is flipped ingame but actual texture is fine, while without fix it's the reverse. Don't know what's causing it but I don't it's a game quirk as .tga files upscaled with IEU and other upscale tools work fine so the issues is probably with Cupsale. Also another interesing thing, resaving textures with fix applied in Photoshop corrects them in other words they appear correctly ingame while the actual texture is not flipped.
When loading a DDS file dumped by the new PCSX2 texture dumping plugin released by Topaz Reality, the color channels are mixed up. The textures are dumped as dds files in the BGRA (blue,green,red,alpha) format. It seems like it is being interpreted as RGBA format. Adding an option to either automatically detect the correct format or a manual box to check to swap the color channels would be awesome. Upscaling PCSX2 textures currently involves converting the images to PNG through xnconvert before colors display correctly in cupscale.
When the path of a resulting image path becomes too long (> 248 characters), e.g. by concatenating 2 models, the original image that has been loaded gets overwritten by cupscale!
I have looked a bit on it, but is there any transparent background support? I do upscale images that has transparent backgrounds and its a little problematic cause its a few hundreds of images I need to cut out background to make it transparent again.
If not, I would want that feature. :)
Hi @n00mkrad ,
In the latest Cupscale version I can't seem to enter a new model path.
After that I moved all of my ESRGAN models to one folder (folder name without spaces, just to make the path extra valid).
Now Cupscale crashes after entering the new path and trying to open the models dialog.
Looking at the crash error details, Cupscale still tries to locate the old, deleted folder.
In the end I've manually updated the path in the config.ini file, and now it works.
it's hard to work in the dark theme
Every time I try to use NCNN I get the error "The ordinal could not be located in the dynamic link library [Path to CupscaleData]\ShippedEsrgan\tools\lib\site-packages\torch\lib\torch_cpu.dll"
This bug is reproducable with every version since the initial implementation of NCNN (portable and normal mode).
I use mainly the embedded Python but system Python doesn't seem to make a difference.
I use AMD hardware (2nd gen Ryzen CPU and Polaris GPU).
When I try to use NCNN on Windows, it stops with _wfopen G:\tmp\Cupscale\Models\.ncnn\1x_BC1-smooth2/x4.param failed
.
The last / should be a \ on Windows.
Hi everyone. I'm sorry for bothering you all.
When trying to upscale a video with "Chain Two Models", I get an 'Illegal characters in path' error, and the video file is not created.
I've tried running Cupscale from several locations, and storing the video file in several locations (including "C:\Video"). I've tried renaming the video file to just "a.mkv", and I have tried converting the video into plain h.264 (no audio, no subtitles, no other streams). I've tried short videos (0.5 seconds) and longer ones (about a minute long). All these instances cause the error.
If I select "Use Single Model", the video converts without problem. If I select "Chain Two Models" on a PNG image, the image converts without problem. I suspect the filename generated for the new video file (i.e. "Model1+Model2+oldFilename.extension") may contain some impossible character(s).
The error message is as follows:
Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.
Illegal characters in path.
The debug data reads as follows:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
at System.IO.Path.Combine(String path1, String path2)
at Cupscale.UI.VideoUpscaleUI.CopyBack(String path)
at Cupscale.UI.VideoUpscaleUI.<Run>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Cupscale.Main.MainForm.<upscaleBtn_Click>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4250.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Cupscale
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Becky/Apps/Cupscale/Cupscale.exe
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4200.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Magick.NET.Core
Assembly Version: 5.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Becky/Apps/Cupscale/Cupscale.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4270.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Magick.NET-Q16-AnyCPU
Assembly Version: 7.22.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Becky/Apps/Cupscale/Cupscale.exe
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4270.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
Cyotek.Windows.Forms.ImageBox
Assembly Version: 1.2.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Becky/Apps/Cupscale/Cupscale.exe
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
HTAlt WinForms
Assembly Version: 0.1.6.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Becky/Apps/Cupscale/Cupscale.exe
----------------------------------------
HTAlt.Standart
Assembly Version: 0.1.6.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Becky/Apps/Cupscale/Cupscale.exe
----------------------------------------
netstandard
Assembly Version: 2.0.0.0
Win32 Version: 4.8.3752.0
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/netstandard/v4.0_2.0.0.0__cc7b13ffcd2ddd51/netstandard.dll
----------------------------------------
NvAPIWrapper
Assembly Version: 0.8.0.98
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Becky/Apps/Cupscale/Cupscale.exe
----------------------------------------
System.Drawing.Common
Assembly Version: 4.0.0.1
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Becky/Apps/Cupscale/Cupscale.exe
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.8.3752.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Cyotek.Windows.Forms.TabList
Assembly Version: 2.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Becky/Apps/Cupscale/Cupscale.exe
----------------------------------------
PaintDotNet.Base
Assembly Version: 3.36.7079.22820
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Becky/Apps/Cupscale/Cupscale.exe
----------------------------------------
DdsFileTypePlus
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Becky/Apps/Cupscale/Cupscale.exe
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Thank you so much for your time, and for making such a helpful frontend app.
When in Chain Two Models mode, a small Flip/Swap button would save time.
Depending on the image being processed, I find myself experimenting with noise reduction before or after scaling images to get the results I'm looking for.
Having to swap the models around manually is a bit annoying after a while!.
Some forks of W2X have multithreading added for images which makes GPU usage 100% all the time. One of the GPUs i had stopped working because i made large batch upscales and it made GPU usage go from 0 to 100 in seconds, which ruined its VRMs in a long term. (it seems the program is running 2 or more threads of the same executable, and also, im using a AMD GPU now)
Also, when using some models, they upscales to 4x or more, some models do include in their names what they`ll do, but at this point, is it possible to add custom resolutions? Sometimes i do not need a 7000x4000 image as 3700x2700 is enough for some needs. (or i may be missing something, though the resize options apparently do not do anything)
Computer:
CPU - AMD 5800X
GPU - RTX 3080 (latest drivers)
OS - Windows 10 (also up to date)
The image/video frames correctly show up in the img-in folder while it's stuck in the Upscaling stage.
The Session Log in the Settings seems to be show nothing of note. However, every time I open it, it adds another copy of:
[IOUtils] Copying directory "C:\Work\Videos\Upscaled\Cupscale1.37.0\CupscaleData\ShippedEsrgan\utils" to "C:\Work\Videos\Upscaled\Cupscale1.37.0\CupscaleData\ShippedEsrgan\py\utils" (Move: False - RemoveFromName: )
Checking if compatibleExtensions contains .py: False
Checking if compatibleExtensions contains .py: False
Checking if compatibleExtensions contains .py: False
Checking if compatibleExtensions contains .py: False
So that if I open up and close out the Session Log five times while it's stuck in the Upscaling stage, there will be five back-to-back copies of that. Checking the ShippedEsrgan\utils and ShippedEsrgan\py\utils folder show the four .py files are in both.
Is there some step in the install process I might have missed? Was there a prepackaged .pth model included? Is the program trying to use the GPU but not being able to, thus never actually getting to the upscaling? Am I mistaken on the timescale to expect to upscale even a single 720p image being on the order of seconds with a powerful GPU and minutes for a capable CPU?
Hello!
I'm very interested in this project and it looks amazing. Sadly when I load a model in build 22 and attempt to upscale any image, it seems to always give me this error
`An error occured during upscaling:
Index was outside the bounds of the array.
Stack Trace:
at Cupscale.UI.MainUIHelper.d__14.MoveNext()`
I'm fairly new at this, so apologies if I've missed something obvious. I just downloaded a model and ran Build22
I've tried CPU only, and GPU, none seem to work. I've also tried this on build 21 and I get the same error.
Thanks in advance!
It would be sweet to convert images to power of two on the fly. For some reasons, like memory optimization in some games.
The images not following power of two resolution would be size-corrected, if flag is set. This feauture would check for and correct textures which are not power of two size.
We have 3 scenarios that should have a look:
These options could be enabled/selected in "Resize before upscaling" or in "Resize after upscaling". I did some tests and sometimes the upscalling is better before and some after the power of two resize. I did it manually though.
The correction in most cases, for the final output of the image should be one power of two level below (imageA.png with 1008x780 should be corrected to 512x512; imageB.png with 544x240 should be corrected to 512x256 so the output won't have loss in quality).
Another thing that could be added is set the maximum width and height size that the texture should have, some games have the limit of 2048 pixels (longest side). So the power of two should respect that.
I downloaded a few models to test it out, and whenever I select a model and then click on Refresh Preview, it gives me this error
Batch Upscale doesn't appear to work with individual files, but works properly with a full folder
I was using this model to upscale a short video (https://u.pcloud.link/publink/show?code=kZojwLXZfeqA3Eoyv6SKXXt01AlSeuHH0WKX) and got the same "model.0.weight" error as another user did. Was this because I was upscaling an mp4 instead of an image sequence? I'm brand new to this, anything would help
When attempting to load BSRGAN with NCNN, I get the following error message:
Failed to convert Pytorch model to NCNN format! It might be incompatible.
Error: Attempted to load a new-format model
A few of the models I have tried have failed to load with this error message.
Recently encountered this issue on a drive that's 32.2GB free, and a drive that's 514GB free.
This only happens with the Batch Upscale feature, with 2 or more files.
When installing Python from the Dependency Checker, it is stuck at the "Compressing files..." part. (for an HOUR)
Upon cancelling and restarting, everything seemed to be in order, the Dependency Checker said I had everything installed and available.
I tried upscaling a simple small image (with CUDA), and it said: "RuntimeError: CUDA error: no kernel image is available for execution on device"
I was like, sure, maybe my GPU is not supported it seems. So then I tried Vulkan and CPU, and neither of them worked. Vulkan threw up an error, and CPU just hanged for too long. (Tried CPU with both embedded and stock python)
PS. I tried Esrgan before, and it worked on CPU flawlessly (although slowly), but this application would be way more convenient if it could work.
So I downloaded Cupscale recently, and for a few days it worked perfectly fine. But later on, it kept on having errors, not upscaling images when I wanted to, and NCNN stopped working after a while. And two days in a row, my pc completely locked up.
Then I trying to upscale a lot of images from the folder - it does nothing
I transfer several files by drag and drop to the program window-I start upscale - it starts, runs successfully in 2 seconds and that's it - the pro-scaled images themselves are nowhere to be found.
Steps to reproduce:
Actual result:
It does nothing, only message "Done - Upscaling took 4s".
Expected result:
Upscale works with multiple images
Does this application support linux?
When previewing game textures from midnight club 3 dub edition remix with PCSX2-EX the textures are displayed wrongly a character texture is more blue than also red textures are also blue oddly not sure why this happens hopefully could be fixed willing to share the .DDS Files if want to investigate
I'm getting the error in the title when running foolhardy's Remacri model.
The model: https://discord.com/channels/547949405949657098/579685650824036387/830149073259986965
The log:
[Python] Model: 4x_general foolhardy_Remacri
[Python] Upscaling...
[Python] 1 preview.png.png
[Python] Image loaded
[Python] Reloading model - model_path: C:\TOOLS\ImageEnhancingUtility\esrgan\models\4x_general foolhardy_Remacri.pth - last_model: None
[Python] Traceback (most recent call last):
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\tarfile.py", line 187, in nti
[Python] n = int(s.strip() or "0", 8)
[Python] ValueError: invalid literal for int() with base 8: '_v2\nq\x03(('
[Python]
[Python] During handling of the above exception, another exception occurred:
[Python]
[Python] Traceback (most recent call last):
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\tarfile.py", line 2289, in next
[Python] tarinfo = self.tarinfo.fromtarfile(self)
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\tarfile.py", line 1095, in fromtarfile
[Python] obj = cls.frombuf(buf, tarfile.encoding, tarfile.errors)
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\tarfile.py", line 1037, in frombuf
[Python] chksum = nti(buf[148:156])
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\tarfile.py", line 189, in nti
[Python] raise InvalidHeaderError("invalid header")
[Python] tarfile.InvalidHeaderError: invalid header
[Python]
[Python] During handling of the above exception, another exception occurred:
[Python]
[Python] Traceback (most recent call last):
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\serialization.py", line 556, in _load
[Python] return legacy_load(f)
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\serialization.py", line 467, in legacy_load
[Python] with closing(tarfile.open(fileobj=f, mode='r:', format=tarfile.PAX_FORMAT)) as tar, \
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\tarfile.py", line 1591, in open
[Python] return func(name, filemode, fileobj, **kwargs)
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\tarfile.py", line 1621, in taropen
[Python] return cls(name, mode, fileobj, **kwargs)
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\tarfile.py", line 1484, in __init__
[Python] self.firstmember = self.next()
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\tarfile.py", line 2301, in next
[Python] raise ReadError(str(e))
[Python] tarfile.ReadError: invalid header
[Python]
[Python] During handling of the above exception, another exception occurred:
[Python]
[Python] Traceback (most recent call last):
[Python] File "upscale.py", line 368, in <module>
[Python] load_model(model_path)
[Python] File "upscale.py", line 148, in load_model
[Python] state_dict = torch.load(model_path)
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\serialization.py", line 387, in load
[Python] return _load(f, map_location, pickle_module, **pickle_load_args)
[Python] File "C:\Users\w42\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\serialization.py", line 560, in _load
[Python] raise RuntimeError("{} is a zip archive (did you mean to use torch.jit.load()?)".format(f.name))
[Python] RuntimeError: C:\TOOLS\ImageEnhancingUtility\esrgan\models\4x_general foolhardy_Remacri.pth is a zip archive (did you mean to use torch.jit.load()?)
I've been trying to run cupscale for the first time, but every time I try, it starts installing like it's supposed to, freezes, and then gives me the following message before closing:
Web Installer failed to run!
An exception occurred during a WebClient request.
Stack Trace:
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Cupscale.IO.Installer.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Cupscale.IO.Installer.d__5.MoveNext()
Is there any way to fix this?
Cupscale crashes interpolation after preprocessing a mkv video?
In the img-in folder the images start out as 0001.png but when the preprocessing finishes each image name becomes like 0001.png.png.png
I'm not sure if this is what causes the error.
I also selected overwrite mode - yes
and mp4
in the saving options
Thanks for your help.
Video upscaling logs
Detected frame rate of video as 47.95
Extracting frames...
Done - Extracted 4979 frames.
Preprocessing frames...
Done preprocessing.
Upscaling frames...
Cancelled - next to progress bar in bottom left
Session Log
Status changed: Converting 4977.png
[ImgUtils] Reading MagickImage from E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-in\4977.png [OK]
[ImgProc] Preprocessing E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-in\4977.png - Fill Alpha: False
[ImgProc] Color depth of 4977.png is 24.
[ImgProc] Deleting source file: E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-in\4977.png
Status changed: Converting 4978.png
[ImgUtils] Reading MagickImage from E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-in\4978.png [OK]
[ImgProc] Preprocessing E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-in\4978.png - Fill Alpha: False
[ImgProc] Color depth of 4978.png is 24.
[ImgProc] Deleting source file: E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-in\4978.png
Status changed: Converting 4979.png
[ImgUtils] Reading MagickImage from E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-in\4979.png [OK]
[ImgProc] Preprocessing E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-in\4979.png - Fill Alpha: False
[ImgProc] Color depth of 4979.png is 24.
[ImgProc] Deleting source file: E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-in\4979.png
[ImgProc] Done pre-processing images
Disk space check for E: with multiplier 2 - 3398 MB needed, 103490 MB available
Status changed: Loading images...
[IOUtils] Clearing E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-out
currentInDir: E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-in, imgInPath: E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-in
Status changed: Pre-Processing...
[Queue] Start()
[IOUtils] Clearing E:\Cupscale1.37.0\Cupscale1.37.0\CupscaleData\img-out-ncnn
Status changed: Starting ESRGAN...
Status changed: Cancelled.
[ESRGAN] Upscaling Error: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at Cupscale.Config.GetInt(String key)
at Cupscale.OS.ESRGAN.<Run>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Cupscale.OS.ESRGAN.<DoUpscale>d__2.MoveNext()
Is there a possibility for a colab notebook port, with all the main features of cupscale built-in? (Including Video / Image upscale. CUDA processing, compatibility with many models, Interpolation of models etcetera.)
Would be a useful and faster alternative to AMD/Intel computers limited to CPU or NCNN.
Would love for it to be a way to add a bulk of videos or a folder of videos to a processing queue. Have a bunch of small clips and sometimes larger videos and instead of babysitting Cupscale i should be able to just set a bunch of videos in a queue and let it do its thing into the set folder.
Hey! I tried using the xinnta BasicSR based learning model. But unfortunately I get an error.
Is it possible to work in cupscale using BasicSR ESRGAN models?
[CMD] /C cd /D "E:\Portable\prog\Cupscale\CupscaleData\ShippedEsrgan" & python upscale.py --input "E:\Portable\prog\Cupscale\CupscaleData\img-in" --output "E:\Portable\prog\Cupscale\CupscaleData\img-out" --device_id 0 --seamless --alpha_mode 0 "E:\Portable\prog\ImageEnhancingUtility\ImageEnhancingUtility\models\my_models\4xManga_set2_d_60000.pth"
[Python] Model: 4xManga_set2_d_60000
[Python] Traceback (most recent call last):
[Python] Upscaling...
[Python] File "upscale.py", line 368, in
[Python] 1 009.jpg.png
[Python] load_model(model_path)
[Python] Image loaded
[Python] File "upscale.py", line 204, in load_model
[Python] Reloading model - model_path: E:\Portable\prog\ImageEnhancingUtility\ImageEnhancingUtility\models\my_models\4xManga_set2_d_60000.pth - last_model: None
[Python] in_nc = state_dict['model.0.weight'].shape[1]
[Python] KeyError: 'model.0.weight'
Chaining two models works when running just one image, however only the last model of the chain is applied in batch mode.
Here's an example: an image ran through 2 models (remove BC1 compression artefacts, apply antialiasing), with and without batch mode. As you can see when zooming in the first image only had antialiasing applied, the second also had BC1 artefacts removed.
Think there should be an option to set the whole machine to shutdown/hibernate or sleep once processing is done.
This will also work great with larger bulk tasks, allowing users to set it to process, leave it and let it shut down in the middle of night.
Ofc all of this is user choice and larger bulks/videos can take quite some time, allowing it to shut down on its own when its done could be helpful.
Works great with #12
As you can see in the following screenshot, the "Repeat: mirror" option seems to generate something peculiar for this particular image. When using the final image mirrored, it will appear that it has 2 spikes. The 2nd image was generated by creating a larger image from flipped copies of the original image, upscaling that with the seamless mode option set to "Off", and finally cropping to get to the original image size x4
I get this in the CMD log. Using embedded python.
Model: 1x_BCGone_Detailed_115000_G
Upscaling...
1 preview.png.png
C:\Users\adria\AppData\Roaming\Cupscale\ShippedEsrgan\py\Lib\site-packages\torch\cuda\__init__.py:125: UserWarning:
GeForce RTX 3080 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.
If you want to use the GeForce RTX 3080 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
Hi. Tried to move it to C:/Program Files. Tried to manually make Cupscale folder in %APPDATA%. Tried -portable, gives me Error saying that another instance of Cupscale is running wich is not true. Starts well from the same folder accessed by another PC in a local network. The sessionlog.txt only says
5-6-2021 10:11:34: Arg: C:\Program Files\Cupscale1.37.0\Cupscale.exe
Is there any way to turn on verbose mode or see detailed logs?
Joey’s ESRGAN supports three different settings for the alpha support.
However in Cupscale, it’s only a tick box to use the alpha mode 1 or none at all, instead of a dropdown menu.
Choosing manually the alpha strategy is useful in multiple scenarios, and it would be nice to have access to that setting.
When I try to batch upscale .tga files with 2xESRGAN and Pre.Processing disabled it throws the Error:
'NoneType' object has no attribute 'shape'
I've encountered this issue when trying to batch upscale a couple of images, where some of which had Polish diacritic characters, such as ż, ą, or ó. The error that has popped up was AttributeError: 'NoneType' object has no attribute 'shape'
. After renaming the files to use basic Latin only, the images were processed properly.
Hello, this is my first time using this program.
I just installed all the dependencies using the compatibility checker,
yet when I load a video, the following error happens:
Failed to open image:
FailedToExecuteCommand `"ffmpeg.exe" -nostdin -v -1 -i "C:/Users/Nefty/AppData/Local/Temp/magick-YVblTv84OTD1qa-w7268u-SqoW99IIzf" -vframes 1 -vcodec pam -an -f rawvideo -y "C:/Users/Nefty/AppData/Local/Temp/magick-qfjAzj7plzwz2-zJjbWFvDLoC_mGRVbw.pam"' (-1) @ error/delegate.c/ExternalDelegateCommand/478
Stack Trace:
at ImageMagick.NativeInstance.CheckException(IntPtr exception, IntPtr result)
at ImageMagick.MagickImage.NativeMagickImage.ReadFile(IMagickSettings1 settings) at ImageMagick.MagickImage.Read(String fileName, IMagickReadSettings
1 readSettings, Boolean ping)
at ImageMagick.MagickImage..ctor(String fileName)
at Cupscale.ImageUtils.ImgUtils.GetMagickImage(String path, Boolean allowTgaFlip)
at Cupscale.UI.PreviewUI.DroppedImageIsValid(String path)
I'm not sure where I went wrong. Any advice is appreciated.
Tested with 1.36.0. After compression is completed and the embedded python text box reads "Done!" program does not allow you to close out of the window. Terminating CupScale in task manager and reopening presents an unhandled exception showing the following file is missing: "\Cupscale1.36.0\Cupscale1.36.0\CupscaleData\ShippedEsrgan\esrlupscale.py". CupScale remains useable, but error continues to present itself anytime settings is entered and then closed.
See below for full exception text:
************** Exception Text **************
System.IO.FileNotFoundException: Could not find file 'C:\Users\USER\Downloads\Cupscale1.36.0\Cupscale1.36.0\CupscaleData\ShippedEsrgan\esrlupscale.py'.
File name: 'C:\Users\USER\Downloads\Cupscale1.36.0\Cupscale1.36.0\CupscaleData\ShippedEsrgan\esrlupscale.py'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
at Cupscale.OS.EmbeddedPython.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Cupscale.Forms.SettingsForm.<SettingsForm_FormClosing>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
This feature is available in ImageEnhancingUtility.
To choose the most suitable models for the image
Trying upscale DDS texture with trensparency. On preview all ok. When saving to PNG - all ok. But when save to DDS alpha is absent (got black).
I upscaled like 100 alpha layers. And they actually look all very similar. But there must be something different between some of them, because ~50% of these textures lost their black color during upscale process. In windows explorer they were full white, in gimp they had transparent background instead.
First one texture which upscaled as intended:
And now a texture which had this failure:
I attach the files and the log from this session:
files and log.zip
For even some of the simplest errors such as the file not being found (due to moving it), the button is disabled after clicking it, after the error occurred.
Could it be made to re-enable the button after loading in a new image?
Not so much an issue as a feature request.
Especially when saving as DDS, if you can save using the same format (DXT1, DXT3, DXT5, etc) as the source image, it would help when trying to mass convert files that have different formats.
Whenever I try and upscale it prompts me that Python 3 hasn't been found. Now hear me out, I've installed the embbed python, everything is installed. Now I have tried installing EVERY SINGLE Python 3 version, after 3.0.0 this means 3.0.0 all the way to 3.9.2, all of it didn't work.
Could we get an update to the embedded installer so ampere (RTX 3000 series) could more easily get support?
Both Python and pyTorch is out of date at this point and, im guessing that is why Cuda and Tensorcore support is not working in the embedded option.
Upscaling a short WEBM (vp9/opus) video with 4xFSDedither_Riven.pth. Original file attributes:
Metadata:
ENCODER : Lavf58.76.100
Duration: 00:01:26.08, start: -0.003000, bitrate: 332 kb/s
Stream #0:0: Video: vp9 (Profile 0), yuv420p(tv, progressive), 640x427, SAR 1:1 DAR 640:427, 15 fps, 15 tbr, 1k tbn, 1k tbc (default)
Metadata:
ENCODER : Lavc58.134.100 libvpx-vp9
DURATION : 00:01:26.070000000
Stream #0:1: Audio: opus, 48000 Hz, stereo, fltp (default)
Metadata:
ENCODER : Lavc58.134.100 opus
DURATION : 00:01:26.084000000
At the conclusion of upscaling the frames into img-out, Cupscale reports (via a popup window) this exception:
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentException: Requested value 'WEBM' was not found.
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at Cupscale.UI.VideoUpscaleUI.<CreateVideo>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Cupscale.UI.VideoUpscaleUI.<Run>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at Cupscale.Main.MainForm.<upscaleBtn_Click>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Cupscale
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Pkgs/cupscale/Cupscale1.37.0/Cupscale.exe
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4300.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Magick.NET.Core
Assembly Version: 6.1.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/Pkgs/cupscale/Cupscale1.37.0/Cupscale.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
I tried this tool with system python, and it worked great. Next thing, I wanted to test it with the "-portable" argument and embedded python. In this configuration tool gets stuck every time at "Upscaling..." status. There are no errors in GUI, but after I enabled "Show CMD Windows" in the debug settings, I got this:
D:\Programs\Cupscale\CupscaleData\ShippedEsrgan\py\Lib\site-packages\torch\cuda\__init__.py:125: UserWarning:
GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37.
If you want to use the GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
I believe there is a problem with an old version of PyTorch in embedded python, but I am not sure.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.