Initial commit
This commit is contained in:
commit
76cd1d1650
|
@ -0,0 +1,11 @@
|
|||
## Upscale Wrapper
|
||||
|
||||
### Usage
|
||||
|
||||
`upscale <infile> [outfile] [noise reduction level]`
|
||||
|
||||
If outfile is not given, it will try to guess.
|
||||
|
||||
Valid values for the noise reduction argument are `0`, `1` and `2`, with 0 being off and 2 being the most aggressive. The default is off
|
||||
|
||||
It will try to upscale it 2x.
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env python3
|
||||
# waifu2x-converter-cpp -j 2 --scale_ratio 2.0 --noise_level 2 -m noise_scale -o mpv-shot0011.png -i mpv-shot0011.jpg
|
||||
import subprocess, sys, os
|
||||
null = open(os.devnull, "w")
|
||||
infile = sys.argv[1]
|
||||
outfile = ".".join(sys.argv[1].split(".")[:-1]) + "-waifu2x.png"
|
||||
noise_level = False
|
||||
if len(sys.argv) > 2:
|
||||
outfile = sys.argv[2]
|
||||
if len(sys.argv) > 3:
|
||||
noise_level = int(sys.argv[3])
|
||||
if not noise_level or noise_level == 0:
|
||||
noise_level = ["-m", "scale"]
|
||||
else:
|
||||
noise_level = ["-m", "noise_scale", "--noise_level", str(noise_level)]
|
||||
args = ["waifu2x-converter-cpp", "-j", "2", *noise_level, "-o", outfile, "-i", infile]
|
||||
print(" ".join(args))
|
||||
subprocess.call(args, stdout=null)
|
||||
null.close()
|
||||
print("Written to " + outfile)
|
Loading…
Reference in New Issue