2018-02-24 18:34:00 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
Name: FFMPEG Class
|
|
|
|
Author: K4YT3X
|
|
|
|
Date Created: Feb 24, 2018
|
|
|
|
Last Modified: Feb 24, 2018
|
|
|
|
|
|
|
|
Description: This class controls waifu2x
|
|
|
|
engine
|
|
|
|
|
|
|
|
Version 1.0
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
class WAIFU2X:
|
|
|
|
|
2018-02-24 21:55:26 +00:00
|
|
|
def __init__(self, waifu2x_path, method):
|
2018-02-24 21:13:27 +00:00
|
|
|
self.waifu2x_path = waifu2x_path
|
2018-02-24 21:55:26 +00:00
|
|
|
self.method = method
|
2018-02-24 18:34:00 +00:00
|
|
|
|
2018-02-24 21:13:27 +00:00
|
|
|
def upscale(self, folderin, folderout, width, height):
|
2018-02-24 22:45:47 +00:00
|
|
|
os.system("{} -p {} -I png -i {} -e png -o {} -w {} -h {} -n 3 -m noise_scale -y photo".format(self.waifu2x_path, self.method, folderin, folderout, width, height))
|