djdefrag / qualityscaler Goto Github PK
View Code? Open in Web Editor NEWQualityScaler - image/video AI upscaler app
License: MIT License
QualityScaler - image/video AI upscaler app
License: MIT License
The upscale process is failing on a particular image with the error "not enough values to unpack (expected 3, got 2)". The image in question is a black & white PNG with a bit depth of 1.
Hi,
I've been investigating the problems you were facing with BSRGANx2 and I believe the flaw is actually with your code, not the model or torchml version. I managed to get it working again with the old BSRGANx2.pth file.
Step 1: Removing upconv2
The BSRGANx2 model does not contain the upconv2
dimension, but your code currently always looks for it. Commenting these lines out while using the BSRGANx2 model allowed it to work properly.
if sf == 4:
self.upconv2 = nn.Conv2d(nf, nf, 3, 1, 1, bias=True)
...
if self.sf == 4:
fea = self.lrelu(self.upconv2(F.interpolate(fea, scale_factor=2, mode='nearest')))
Solution: Alter these if statements to also check if the model is != BSRGANx2.
Step 2: Reducing scaling multipliers
The latest version hardcodes the multipliers for * 4
for example inside fix_tile_shape
and get_final_image_shape
. We must instead change this to * 2
when using BSRGANx2.
That's all, it's working fine for me now. Please let me know if you need assistance, and I am very much looking forward to BSRGANx2 being added again! 🎉
Build version 6.0 Free
After generating images and resizing images. fails to start upscaling.
Error in QualityScaler.log is :
Error while upscaling
CHECK failed: ((((HRESULT)((backend_->dml_device->CreateOperator(&op_desc_, __uuidof(**(&op)), IID_PPV_ARGS_Helper(&op))))) >= 0)) == (true):
PS D:\Projects\QualityScaler> pip install -r .\requirements.txt
ERROR: Could not find a version that satisfies the requirement torch-directml (from versions: none)
ERROR: No matching distribution found for torch-directml
PS D:\Projects\QualityScaler> pip install torch-directml
ERROR: Could not find a version that satisfies the requirement torch-directml (from versions: none)
ERROR: No matching distribution found for torch-directml
Please help
In my tests, I don't see a need to resize if the scaling is at 100%. It adds unnecessary processing.
The readme file should really include additional instructions for compiling the project from the source code, not just instructions on downloading the .exe and the photo examples. May users will be able to do so from their own knowledge, but others may be new or may be unfamiliar and those additional instructions can be a big help.
2.2 had no option for the 2x BSRGAN model, and if memory serves, it’s been available up until now. Haven’t checked 2.3 yet but I didn’t see the model in the Folder zip when I downloaded it from the purchase page.
Not a huge issue, but I’ve found that most videos come out much better when upscaling double as opposed to quadruple res. Thanks, and keep up the amazing work 🙏🏻
I am processing a 1024x1024 video which is 20mins long, it pre-processed the upscale and then for the last hour+ has been stuck on the message of Preparing for upscaling. When i check Task Manager, the CPU or the GPU is not being used at all, CPU i9 12900f at 15% and GPU RTX 3080 10gb at 1%
am i missing something or do i just have to wait due to the length of the video i am processing?
everything has been left on default settings, BSRGANx4, and 75% with GPU backend
Output format other than jpeg would be nice. Something loseless like PNG.
The packages form the source cannot be install neither on W11 nor on U22.04, at least with Python 3.11.x
The overall error is:
ERROR: Could not find a version that satisfies the requirement torch-directml
$ pip install torch-directml
ERROR: Could not find a version that satisfies the requirement torch-directml (from versions: none)
ERROR: No matching distribution found for torch-directml
python --version
Python 3.11.4
PS C:\...\QualityScaler> pip install -r requirements.txt
DEPRECATION: Loading egg at c:\python311\lib\site-packages\mask_rcnn-2.1-py3.11.egg is deprecated. pip 23.3 will enforce this behaviour change. A possible replacement is to use pip for package installation..
ERROR: Could not find a version that satisfies the requirement torch-directml==0.1.13.1.dev230301 (from versions: none)
ERROR: No matching distribution found for torch-directml==0.1.13.1.dev230301
python --version
Python 3.11.3
It would help if this could be installed via pip.
I'm still trying to install the dependencies and I eventually get
Traceback (most recent call last):
File "QualityScaler.py", line 617, in <module>
) -> list[numpy_ndarray]:
TypeError: 'type' object is not subscriptable
I have an old AMD X4 646 and 16GB. Running with CPU did not hog the CPU, so something went wrong.
My father has a new Windows 11 PC with 8GB. Running with CPU did not hog the CPU, so something went wrong.
Finally I decided to rent a Azure NC6_Promo with K80 cuda. That does the job after a reboot for installing the K80.
Describe the bug
Unable to load state_dict for RealSRx4_Anime for upscaling a video in QualityScaler 2.9.
To Reproduce
Expected behavior
The Upscaler will load the trained model and start upscaling the video. The other models do work, the issue is only for this specific model.
Starting upscale:
Files to upscale: 1
Selected AI model: RealSRx4_Anime
AI half precision: True
Interpolation: True
Selected GPU: NVIDIA GeForce RTX 3060
Selected image output extension: .png
Selected video output extension: .mp4 (x264)
Tiles resolution for selected GPU VRAM: 1440x1440px
Resize factor: 50%
Cpu number: 10
==================================================
Loading AI model
Error during upscale process Error(s) in loading state_dict for SRVGGNetCompact:
Missing key(s) in state_dict: "body.35.weight", "body.36.weight", "body.36.bias", "body.37.weight", "body.38.weight", "body.38.bias", "body.39.weight", "body.40.weight", "body.40.bias", "body.41.weight", "body.42.weight", "body.42.bias", "body.43.weight", "body.44.weight", "body.44.bias", "body.45.weight", "body.46.weight", "body.46.bias", "body.47.weight", "body.48.weight", "body.48.bias", "body.49.weight", "body.50.weight", "body.50.bias", "body.51.weight", "body.52.weight", "body.52.bias", "body.53.weight", "body.54.weight", "body.54.bias", "body.55.weight", "body.56.weight", "body.56.bias", "body.57.weight", "body.58.weight", "body.58.bias", "body.59.weight", "body.60.weight", "body.60.bias", "body.61.weight", "body.62.weight", "body.62.bias", "body.63.weight", "body.64.weight", "body.64.bias", "body.65.weight", "body.66.weight", "body.66.bias".
size mismatch for body.34.weight: copying a param with shape torch.Size([48, 64, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]).
size mismatch for body.34.bias: copying a param with shape torch.Size([48]) from checkpoint, the shape in current model is torch.Size([64]).
`
Desktop (please complete the following information):
So um yeah, I love this app but this is concerning. Hopefully its a false positive... Windows 10, downloaded this- https://github.com/Djdefrag/QualityScaler/releases/download/4.1/QualityScaler_4.1_free.zip version and immediately got that warning when i unzipped it.
Hey, i would love to test this upscaler but i was only able to find the paid version with the models. I read in some instances that there is a trial version but could not find it.
Are there any plans to implement the ability to adjust video encoding parameters? The quality settings for mp4 output are quite low and don't really work well if a user plans to edit footage upscaled. Or...is there a way to edit any of the core files to make these adjustments?
I don't know if this is a false positive by Wİndows Defender or not. VirusTotal also doesn't like the distributed executable in the releases page
The file hash is
CRC32: CF09368D
MD5: 2486FB18B943A60793F704968DD262AE
SHA-1: 3775464FDA4D52AB6DF60C83198EF4B16E470F6C
SHA-256: 312379592aeff70993bd2a38f3d0407793fc6abaeba1fad22a3d3dfbd4eca5fb
I tried building it myself (cpython 3.10) but my build failed due to Could not find a version that satisfies the requirement pytorch-directml
, not really a python guy so I left it there.
Can you share a reproducible build instructions with us so that we can compare executable hashes?
Thank you for this great app. Could you please implement Swinir large and medium models?
Thank you very much in advance!
Hi, i was upscaling some assets of a game im converting for a unity project.
Now when i decompiled the assets the names where: {name}.bmp.png <- this is where the problem is
When you drag the files into qualityscaler it just gives a gray screen but when changing file names to {name}.png they load normaly?
Dont know how you extension checking, but assuming from source you use python, could split name on . and do a -1 index to get extension instead. havent checked out the source do, will do when i have a bit more time.
When using QualityScaler 2.9 I've get artifacts. I tried to switch Interpolation and AI model options, but in most cases result is bad. I've used in most times image upscailing.
Exported image look like this:
My specs:
CPU: i5-7400
RAM: 16 GB
GPU: GTX 750 Ti 4 GB VRAM
OS: Windows 10
GPU Driver: Nvidia 546.17
import torch #(torch directory replaced by your bundled version)
print(f'available devices: {torch.cuda.device_count()}')
print(f'current device: { torch.cuda.current_device()}')
Result:
print(f'current device: { torch.cuda.current_device()}')
File "C:\Users\rmast\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\cuda_init_.py", line 388, in current_device
lazy_init()
File "C:\Users\rmast\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\cuda_init.py", line 164, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
I'm using Windows 11
and Python 3.10.7
with QualityScaler 1.14
. I'm encountering an issue while trying to upscale an FLV video file. The error message I'm receiving is: [Errno 2] No such file or directory: C:\\Users\\rosha\\Downloads\\Compressed\\QualityScaler-1.14\\AI\\BSRGANx4.pth
how run in linux, no gui,thanks
first, I tried a video, stopped in middle, and next I put an image, yet it resumes old video job.
Hi,
in windows 11,
Error otuput when click in upscale button.
Error while upscaling
'utf-8' codec can't decode byte 0xf3 in position 1670: invalid continuation byte
file path: C:\Users\Usuario\OneDrive\Documentos\github\RealScaler\Bleach.avi
My windows system uses spanish language but the path doesn't contain special chars. i can't trace this because otuput error is not showing the complete error.
Hi, I just wanted to leave an issue with the upscaling method. I'm not sure if this is RealSR or BSRGAN's issue, but I don't think it is as it happens on both of these. I've basically noticed some cuts on the final image that it creates in the end as it combines the tiles together back into one image.
I suspect this is because for each tile both of these don't give out the upscaled image in the same way as every other tile it upscales. I also don't notice it easily if I view it from about the original scale, but it starts becoming noticeable when I zoom into the image.
Upscaled using RealSR_JPEG in 4x:
I also tested this with 2x, and it does the same.
Still, many thanks for making this program!
Hey, this project looks interesting and works good on windows, though it would be great, if this could be used on linux aswell. A great usecase for this would be inside a docker container which one can access through vnc or similar. This could aswell be run on a small Linux server ( with a nvidia gpu for cuda), rather than the main machine, without consuming storage and cpu/gpu resources, leaving the main system free for different work (as the process can take quite long for larger files)
Unfortunately the app just sits there consuming a little CPU but otherwise not touching the GPU or the input image for all variations of options on a 300x300 jpg.
Please add logging, and more detailled in-app status/progress signage so I can submit something more useful.
Running on Win10, all CUDA libraries installed, it's my deep learning research box.
I am trying to upscale a video and it keeps saying "Error while upscaling"
No logs are being generated but a folder was made.
Specs:
CPU: Core i7-9750H
Mem: 32gb
GPU: 3080 via Thunderbolt
First, this is a really nice tool that I appreciate greatly. Thanks for putting this out, and I'll be buying on itch.
This is such a useful tool, that I would like to automate it, much like you would use imagemagick, to interoperate with other tools.
Something like:
QualityScalerCLI.exe --model BRSRGANx2 --backend cpu --ram ultra --resize 100 input.jpg
Ability to specify final output file name and discard all intermediaries (including scaled jpg->png conversion) would also be nice.
Hi this is a very nice work. Really appreciate your work. But can you add a feature that allow using image batch insteaf of single image for inferencing? Thanks!
After latest update to version 1.5.0 can not drag-and-drop images to QualityScaler. For version 1.4.0 everything worked correctly.
Tried to drop .jpg and .png files - not working.
For videos (tested .mkv) everything works correctly.
I am using Windows 11 64 bit Pro, 22000.652, with clean installation of QualityScaler (from archive from Google Drive)
frame_rate = int(cap.get(cv2.CAP_PROP_FPS))
Example, input video FPS 23.976, original frame count 1212: (23 / (24000/1001)) * 1212 = 1162.6615 (i.e., 1163).
The same applies to every other video that uses frame rates that are non-even.
Everything works correctly when the cast to int is removed: frame_rate = cap.get(cv2.CAP_PROP_FPS)
So if you want to perfect the result you should keep a small margin around all tiles and cut it off when merging.
I had to download https://aka.ms/vs/16/release/vc_redist.x64.exe on a fresh install of Win10 on a K80 VM to resolve this issue.
Ran it a few times, job didnt complete cause i ran outnof disk soace.
Apparently it doesnt clean up old image files extracted from videos?
would be tood if i could change the cache paths
Hey,
I was trying out the scaler with our Trial data and no matter what input aspect ratio i input, the output is always 3/4.
Can i change that and is there an option to set a resolution manually instead of percentage?
QualityScaler 4.1.f
NVIDIA GeForce GTX 1660 Ti 6 GB Win 10
Tried all models, CPU&GPU, limited RAM, several files including logo.png from your install package.
Makes a pile of PNGs and then comes back error while upscaling.
Is there an informative log somewhere?
The time it takes to process images with Qualityscaler is way to long it should not take 10 to 15 min to process any image. I have tested Quality vs Upscayl with Upscayl most images I can process it 3 or 4 times in the amount of time it takes Quality to process a image once this is the main negative thing about this program please take a look into this thx.
My video card is a RX 6600 I have 24gb DDR3 settings I use GPU and 6gb to 8gb Vram. My setup is pretty good for upscaling images.
For long videos, it would be great if the video could be processed in chunks and ideally resumable. I've had errors come up that wasted lots of work done.
Present in downloadable archive but not in git
https://github.com/idealo/image-super-resolution
You might be tempted to put that in your nice looking GUI as wel?
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.