4 Commits
V1.0.0 ... V1

Author SHA1 Message Date
simplePCBuilding
5d4202e1a9 Update README.md 2022-10-23 10:11:56 +00:00
simplePCBuilding
67ab7254a3 Update README.md 2022-10-23 09:53:02 +00:00
janis
cfea0e2593 compiling info 2022-10-23 11:51:20 +02:00
janis
04509e4d9a bugfixes 2022-10-22 14:59:00 +02:00
10 changed files with 375 additions and 10 deletions

7
.desktop Normal file
View File

@@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Name=FSR Image & Video Upscaler
Comment=Upscale your videos and images with FSR
Path=/opt/fsrimageupscaler
Exec=/opt/fsrimageupscaler/fsrimagevideoupscaler
Icon=fsrimageupscaler

View File

@@ -1,6 +1,5 @@
# FSRImageVideoUpscalerFrontend # FSRImageVideoUpscalerFrontend
A GTK frontend to upscale images / videos using AMD's FidelityFX Super Resolution. A GTK frontend to upscale images / videos using AMD's FidelityFX Super Resolution.
*NOTE: THIS PROJECT IS STILL IN DEVELOPMENT AND MAY STILL CONTAIN SOME FUNDEMENTAL BUGS!*
# Functionality # Functionality
This App is a GTK frontend to AMD's FidelityFX Super Resolution codebase, which allows you to upscale basically anything that is some kind of an image. This App is a GTK frontend to AMD's FidelityFX Super Resolution codebase, which allows you to upscale basically anything that is some kind of an image.
@@ -16,16 +15,17 @@ If you have any suggestions or features you'd like to have implemented, you may
# Roadmap # Roadmap
V1.0.0: V1.0.0:
- Get the app working -- :white_check_mark: - Get the app working -- :white_check_mark:
- Create installer
- Quality selector (presets and custom multiplier) -- :white_check_mark: - Quality selector (presets and custom multiplier) -- :white_check_mark:
- Filechoosers -- :white_check_mark: - Filechoosers -- :white_check_mark:
- Imageformats: .png, .jpg, .jpeg; Videoformats: .mp4, .mkv -- :white_check_mark: - Imageformats: .png, .jpg, .jpeg; Videoformats: .mp4, .mkv -- :white_check_mark:
- Working UI -- :white_check_mark: - Working UI -- :white_check_mark:
- Basic Wiki - Basic Wiki -- :white_check_mark:
- Add all compiling infos to the repo - Add all compiling infos to the repo -- :white_check_mark:
- Add about section inside app - Add about section inside app
V1.1.0: V1.1.0:
- Migrate to PyQt5
- Create Windows & Mac Version
- Custom Quality target resolution - Custom Quality target resolution
- support more file formats (Which ones not decided yet) - support more file formats (Which ones not decided yet)

21
dev/dump alternative Normal file
View File

@@ -0,0 +1,21 @@
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QApplication, QMainWindow
class FSRImageVideoUpscaler:
def __init__(self):
self.app = QApplication(sys.argv)
self.window = QMainWindow()
self.label = QtWidgets.QLabel(self.window)
def runapp(self):
self.window.setGeometry(200, 200, 800, 600)
self.window.setWindowTitle("FSR Image & Video upscaler")
self.label.setText("Hello World")
self.label.move(300, 300)
self.window.show()
sys.exit(self.app.exec_())
FSRImageVideoUpscaler().runapp()

281
dev/dump.txt Normal file
View File

@@ -0,0 +1,281 @@
class ErrorDialogFileMissing(Gtk.Dialog):
def __init__(self, parent):
super().__init__(title="Error", transient_for=parent, flags=0)
self.add_buttons(Gtk.STOCK_OK, Gtk.ResponseType.OK)
self.set_default_size(150, 100)
self.label = Gtk.Label(label=" No file specified. Please select an input AND output file! ")
self.box = self.get_content_area()
self.box.pack_start(self.label, True, True, 20)
self.show_all()
class ErrorDialogRunning(Gtk.Dialog):
def __init__(self, parent):
super().__init__(title="Error", transient_for=parent, flags=0)
self.add_buttons(Gtk.STOCK_OK, Gtk.ResponseType.OK)
self.set_default_size(150, 100)
self.label = Gtk.Label(label=" You are already upscaling. Please wait for the current job to finish! ")
self.box = self.get_content_area()
self.box.pack_start(self.label, True, True, 20)
self.show_all()
class ErrorDialogCheckFail(Gtk.Dialog):
def __init__(self, parent):
super().__init__(title="Error", transient_for=parent, flags=0)
self.add_buttons(Gtk.STOCK_OK, Gtk.ResponseType.OK)
self.set_default_size(150, 100)
self.label = Gtk.Label(label=" File and settings check failed. \n Make sure to specify the same file extension in the output like in the input \n make sure that the entries you made as settings are valid! (4 >= scale >= 1) ")
self.box = self.get_content_area()
self.box.pack_start(self.label, True, True, 20)
self.show_all()
class HomeWindow(Gtk.Window):
def __init__(self):
super().__init__(title="Test")
self.os_type = sys.platform
self.save_file = ""
self.open_file = ""
# Spawn box
self.main_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.sub_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.orient_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.top_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.quality_select_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.custom_quality_selector_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
# Headerbar
self.hb = Gtk.HeaderBar()
self.hb.set_show_close_button(True)
self.hb.props.title = "FSR Image & Video Upscaler"
self.set_titlebar(self.hb)
# Create filechooser button
self.filechoosebutton = Gtk.Button(label="Choose Input File")
self.filechoosebutton.connect("clicked", self.filechooser_clicked)
self.box.pack_start(self.filechoosebutton, True, True, 0)
# Create output filechooser button
self.opfchooserbutton = Gtk.Button(label="Choose Output File")
self.opfchooserbutton.connect("clicked", self.opfilechooser_clicked)
self.box.pack_start(self.opfchooserbutton, True, True, 0)
# Create start button
self.start_button = Gtk.Button(label="Start upscaling")
self.start_button.connect("clicked", self.start_clicked)
self.box.pack_start(self.start_button, True, True, 0)
# Create Input File label
self.ip_file_label = Gtk.Label(label="Choose input file")
# Create Output File label
self.op_file_label = Gtk.Label(label="Choose output file")
# Pack File labels
self.filebox = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.filebox.pack_start(self.ip_file_label, True, True, 10)
self.filebox.pack_start(self.op_file_label, True, True, 10)
# QualitySelect
self.title = Gtk.Label(label="Upscaling Multiplier Presets")
self.qualities = Gtk.ListStore(str)
self.qualities.append(["2x"])
self.qualities.append(["1.7x"])
self.qualities.append(["1.5x"])
self.qualities.append(["1.3x"])
self.qualities.append(["Custom (will respect value below)"])
self.quality_select = Gtk.ComboBox.new_with_model(self.qualities)
self.text_renderer = Gtk.CellRendererText()
self.quality_select.pack_start(self.text_renderer, True)
self.quality_select.add_attribute(self.text_renderer, "text", 0)
self.quality_select.connect("changed", self.on_quality_change)
self.quality_select_shrink = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.quality_select_shrink.pack_start(self.quality_select, True, False, 10)
self.quality_select_box.pack_start(self.title, True, True, 0)
self.quality_select_box.pack_start(self.quality_select_shrink, True, True, 20)
# Custom Quality Selector
self.custom_quality_selector_title = Gtk.Label(label="Custom Upscaling Multiplier\nNOTE that factors greater than 2 are not recommended!\nFactors greater than 4 will not run!")
self.custom_quality_selector_shrink = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.custom_quality_selector = Gtk.Entry()
self.custom_quality_selector_shrink.pack_start(self.custom_quality_selector, True, False, 10)
self.custom_quality_selector_box.pack_start(self.custom_quality_selector_title, True, True, 0)
self.custom_quality_selector_box.pack_start(self.custom_quality_selector_shrink, True, True, 20)
# Info
self.infos = Gtk.Label(label="Settings")
# Details
self.details = Gtk.Label(label="Ready")
# Separator
self.separator = Gtk.Separator().new(Gtk.Orientation.HORIZONTAL)
# Packing boxes
self.top_box.pack_start(self.infos, True, True, 0)
self.top_box.pack_start(self.quality_select_box, True, True, 0)
self.top_box.pack_start(self.custom_quality_selector_box, True, True, 0)
self.top_box.pack_start(self.details, True, True, 0)
self.top_box.pack_start(self.separator, True, False, 0)
self.orient_box.pack_start(self.filebox, True, True, 0)
self.orient_box.pack_start(self.box, True, True, 0)
self.sub_box.pack_start(self.orient_box, True, True, 30)
self.main_box.pack_start(self.top_box, True, True, 0)
self.main_box.pack_end(self.sub_box, True, True, 5)
self.add(self.main_box)
def on_quality_change(self, quality):
# get data from quality changer
self.tree_iter = quality.get_active_iter()
if self.tree_iter is not None:
self.model = quality.get_model()
self.output = self.model[self.tree_iter][0]
def filechooser_clicked(self, widget):
self.filechooserdialog = Gtk.FileChooserDialog(title="Choose input file", action=Gtk.FileChooserAction.OPEN)
self.filechooserdialog.add_buttons(
Gtk.STOCK_CANCEL,
Gtk.ResponseType.CANCEL,
Gtk.STOCK_OPEN,
Gtk.ResponseType.OK,
)
self.response = self.filechooserdialog.run()
if self.response == Gtk.ResponseType.OK:
self.ip_file_label.set_text(self.filechooserdialog.get_filename())
self.open_file = self.filechooserdialog.get_filename()
elif self.response == Gtk.ResponseType.CANCEL:
pass
self.filechooserdialog.destroy()
def opfilechooser_clicked(self, widget):
self.filechooserdialog_save = Gtk.FileChooserDialog(title="Choose output file", action=Gtk.FileChooserAction.SAVE)
Gtk.FileChooser.set_do_overwrite_confirmation(self.filechooserdialog_save, True)
if self.os_type == "linux":
Gtk.FileChooser.set_current_folder(self.filechooserdialog_save, "/home")
elif self.os_type == "win32":
Gtk.FileChooser.set_current_folder(self.filechooserdialog_save, "%HOMEPATH%")
else:
pass
if str(self.open_file)[len(self.open_file) - 4:] == ".mp4":
Gtk.FileChooser.set_current_name(self.filechooserdialog_save, "video.mp4")
elif str(self.open_file)[len(self.open_file) - 4:] == ".mkv":
Gtk.FileChooser.set_current_name(self.filechooserdialog_save, "video.mkv")
elif str(self.open_file)[len(self.open_file) - 4:] == ".png":
Gtk.FileChooser.set_current_name(self.filechooserdialog_save, "image.png")
elif str(self.open_file)[len(self.open_file) - 4:] == ".jpg":
Gtk.FileChooser.set_current_name(self.filechooserdialog_save, "image.jpg")
elif str(self.open_file)[len(self.open_file) - 4:] == ".jpeg":
Gtk.FileChooser.set_current_name(self.filechooserdialog_save, "image.jpeg")
else:
Gtk.FileChooser.set_current_name(self.filechooserdialog_save, "")
self.filechooserdialog_save.add_buttons(
Gtk.STOCK_CANCEL,
Gtk.ResponseType.CANCEL,
Gtk.STOCK_SAVE,
Gtk.ResponseType.OK,
)
self.response = self.filechooserdialog_save.run()
if self.response == Gtk.ResponseType.OK:
self.op_file_label.set_text(self.filechooserdialog_save.get_filename())
self.save_file = self.filechooserdialog_save.get_filename()
elif self.response == Gtk.ResponseType.CANCEL:
pass
self.filechooserdialog_save.destroy()
def info_button(self):
self.info_dialog = Gtk.Dialog()
self.remove_event = Gtk.Button(label="Don't show again")
self.info_dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OK, Gtk.ResponseType.OK)
self.info_dialog.set_default_size(150, 100)
self.box = self.info_dialog.get_content_area()
self.label = Gtk.Label(label=" Upscaling. This process will take long (if a Video). \n Duration depends on your Hardware and length and resolution of video \n You may see the output of the app, if you switch to the other window that is behind it. \n\n\n click \"ok\" to start upscaling")
self.box.pack_start(self.label, True, True, 0)
self.info_dialog.show_all()
self.info_response = self.info_dialog.run()
self.info_dialog.destroy()
def start_clicked(self, widget):
self.respawn = True
try:
if self.scaler.is_alive():
self.respawn = False
else:
self.respawn = True
except AttributeError:
self.respawn = True
if self.respawn:
if str(self.open_file) != "" and str(self.save_file) != "":
if checks.perform(self.output, self.custom_quality_selector.get_text(), self.open_file, self.save_file):
if self.output == "Custom (will respect value below)":
self.quality_selected = "custom"
if self.custom_quality_selector.get_text()[len(self.custom_quality_selector.get_text()) - 1] == "x":
self.q = f"{self.custom_quality_selector.get_text()} {self.custom_quality_selector.get_text()}"
else:
self.q = f"{self.custom_quality_selector.get_text()}x {self.custom_quality_selector.get_text()}x"
else:
self.quality_selected = "default"
self.q = str(arg.get(self.output))
self.go = True
if self.go:
self.details.set_text("Starting upscaling process")
print("\n\nStarting upscaling process!\n\n")
self.info_button()
if self.info_response == Gtk.ResponseType.OK:
self.details.set_text("Upscaling")
self.scaler = multiprocessing.Process(name="scaler",
target=handler.handler,
args=("./bin/lib/FidelityFX_CLI.exe",
self.open_file,
self.quality_selected,
self.q,
self.save_file,)
)
self.scaler.start()
elif self.info_response == Gtk.ResponseType.CANCEL:
self.details.set_text("Ready")
print("aborted")
else:
raise Exception
else:
self.details.set_text("File-checks failed! Please check your entries!")
print("File-checks unsuccessful. Please check your entries!")
self.checkerror()
else:
self.details.set_text("No file specified!")
print("no file specified")
self.fileerror()
else:
self.runningerror()
print("Already running!")
def runningerror(self):
self.runningerrordialog = ErrorDialogRunning(self)
self.runningerrordialog.run()
self.runningerrordialog.destroy()
def fileerror(self):
self.fileerrordialog = ErrorDialogFileMissing(self)
self.fileerrordialog.run()
self.fileerrordialog.destroy()
def checkerror(self):
self.checkerrordialog = ErrorDialogCheckFail(self)
self.checkerrordialog.run()
self.checkerrordialog.destroy()
win = HomeWindow()
win.set_default_size(800, 600)
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()

BIN
dev/logo.xcf Normal file

Binary file not shown.

View File

@@ -13,14 +13,12 @@ import multiprocessing
import bin.checks import bin.checks
import bin.arg_assembly import bin.arg_assembly
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
arg = bin.arg_assembly.ArgAssembly() arg = bin.arg_assembly.ArgAssembly()
checks = bin.checks.Checks() checks = bin.checks.Checks()
handler = bin.handler.Handler() handler = bin.handler.Handler()
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class ErrorDialogFileMissing(Gtk.Dialog): class ErrorDialogFileMissing(Gtk.Dialog):
def __init__(self, parent): def __init__(self, parent):
@@ -61,7 +59,6 @@ class HomeWindow(Gtk.Window):
self.os_type = sys.platform self.os_type = sys.platform
self.save_file = "" self.save_file = ""
self.open_file = "" self.open_file = ""
# Spawn box # Spawn box
self.main_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) self.main_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.sub_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL) self.sub_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
@@ -155,6 +152,8 @@ class HomeWindow(Gtk.Window):
self.main_box.pack_end(self.sub_box, True, True, 5) self.main_box.pack_end(self.sub_box, True, True, 5)
self.add(self.main_box) self.add(self.main_box)
def on_quality_change(self, quality): def on_quality_change(self, quality):
# get data from quality changer # get data from quality changer
self.tree_iter = quality.get_active_iter() self.tree_iter = quality.get_active_iter()

View File

@@ -0,0 +1,50 @@
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(
['fsrimagevideoupscaler.py'],
pathex=[],
binaries=[],
datas=[('config', 'config')],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='FSR Image & Video Upscaler',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='fsrimagevideoupscaler',
)

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

View File

@@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Name=FSR Image & Video Upscaler
Comment=Upscale your videos and images with FSR
Path=/opt/fsrimageupscaler
Exec=/opt/fsrimageupscaler/FSR\ Image\ \&\ Video\ Upscaler
Icon=fsrimageupscaler

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB