Skip to content

Commit

Permalink
updated GUI for the newest version of Anime4kCPP
Browse files Browse the repository at this point in the history
  • Loading branch information
k4yt3x committed Sep 1, 2020
1 parent 188a44c commit 68e6331
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 4 deletions.
19 changes: 17 additions & 2 deletions src/video2x_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Creator: Video2X GUI
Author: K4YT3X
Date Created: May 5, 2020
Last Modified: June 30, 2020
Last Modified: September 1, 2020
"""

# local imports
Expand Down Expand Up @@ -34,7 +34,7 @@
from PyQt5.QtWidgets import *
import magic

GUI_VERSION = '2.7.1'
GUI_VERSION = '2.7.2'

LEGAL_INFO = f'''Video2X GUI Version: {GUI_VERSION}\\
Upscaler Version: {UPSCALER_VERSION}\\
Expand Down Expand Up @@ -395,6 +395,11 @@ def __init__(self, *args, **kwargs):
self.anime4kcpp_post_processing_check_box = self.findChild(QCheckBox, 'anime4kCppPostProcessingCheckBox')
self.anime4kcpp_gpu_mode_check_box = self.findChild(QCheckBox, 'anime4kCppGpuModeCheckBox')
self.anime4kcpp_cnn_mode_check_box = self.findChild(QCheckBox, 'anime4kCppCnnModeCheckBox')
self.anime4kcpp_hdn_check_box = self.findChild(QCheckBox, 'anime4kCppHdnCheckBox')
self.anime4kcpp_hdn_level_spin_box = self.findChild(QSpinBox, 'anime4kCppHdnLevelSpinBox')
self.anime4kcpp_force_fps_double_spin_box = self.findChild(QDoubleSpinBox, 'anime4kCppForceFpsDoubleSpinBox')
self.anime4kcpp_disable_progress_check_box = self.findChild(QCheckBox, 'anime4kCppDisableProgressCheckBox')
self.anime4kcpp_alpha_check_box = self.findChild(QCheckBox, 'anime4kCppAlphaCheckBox')

# FFmpeg settings
# global options
Expand Down Expand Up @@ -557,6 +562,11 @@ def load_configurations(self):
self.anime4kcpp_post_processing_check_box.setChecked(settings['postprocessing'])
self.anime4kcpp_gpu_mode_check_box.setChecked(settings['GPUMode'])
self.anime4kcpp_cnn_mode_check_box.setChecked(settings['CNNMode'])
self.anime4kcpp_hdn_check_box.setChecked(settings['HDN'])
self.anime4kcpp_hdn_level_spin_box.setValue(settings['HDNLevel'])
self.anime4kcpp_force_fps_double_spin_box.setValue(settings['forceFps'])
self.anime4kcpp_disable_progress_check_box.setChecked(settings['disableProgress'])
self.anime4kcpp_alpha_check_box.setChecked(settings['alpha'])

# ffmpeg
# global options
Expand Down Expand Up @@ -666,6 +676,11 @@ def resolve_driver_settings(self):
self.config['anime4kcpp']['postprocessing'] = bool(self.anime4kcpp_post_processing_check_box.isChecked())
self.config['anime4kcpp']['GPUMode'] = bool(self.anime4kcpp_gpu_mode_check_box.isChecked())
self.config['anime4kcpp']['CNNMode'] = bool(self.anime4kcpp_cnn_mode_check_box.isChecked())
self.config['anime4kcpp']['HDN'] = bool(self.anime4kcpp_hdn_check_box.isChecked())
self.config['anime4kcpp']['HDNLevel'] = self.anime4kcpp_hdn_level_spin_box.value()
self.config['anime4kcpp']['forceFps'] = self.anime4kcpp_force_fps_double_spin_box.value()
self.config['anime4kcpp']['disableProgress'] = bool(self.anime4kcpp_disable_progress_check_box.isChecked())
self.config['anime4kcpp']['alpha'] = bool(self.anime4kcpp_alpha_check_box.isChecked())

# ffmpeg
self.config['ffmpeg']['ffmpeg_path'] = os.path.expandvars(self.ffmpeg_path_line_edit.text())
Expand Down
53 changes: 53 additions & 0 deletions src/video2x_gui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,27 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="anime4kCppHdnCheckBox">
<property name="text">
<string>HDN</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="anime4kCppDisableProgressCheckBox">
<property name="text">
<string>Disable Progress</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="anime4kCppAlphaCheckBox">
<property name="text">
<string>Preserve Alpha Channel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -1942,6 +1963,38 @@
</property>
</spacer>
</item>
<item row="8" column="0">
<layout class="QHBoxLayout" name="anime4kCppHdnLevelHorizontalLayout">
<item>
<widget class="QLabel" name="anime4kCppHdnLevelLabel">
<property name="text">
<string>HDN Level</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="anime4kCppHdnLevelSpinBox">
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="1">
<layout class="QHBoxLayout" name="anime4kCppForceFpsHorizontalLayout">
<item>
<widget class="QLabel" name="anime4kCppForceFpsLabel">
<property name="text">
<string>Force FPS</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="anime4kCppForceFpsDoubleSpinBox"/>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
Expand Down
4 changes: 2 additions & 2 deletions src/wrappers/anime4kcpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Name: Anime4KCPP Driver
Author: K4YT3X
Date Created: May 3, 2020
Last Modified: August 20, 2020
Last Modified: September 1, 2020
Description: This class is a high-level wrapper
for Anime4KCPP.
Expand Down Expand Up @@ -66,7 +66,7 @@ def parse_arguments(arguments):
parser.add_argument('-h', '--platformID', type=int, help='Specify the platform ID')
parser.add_argument('-d', '--deviceID', type=int, help='Specify the device ID')
parser.add_argument('-C', '--codec', type=str, help='Specify the codec for encoding from mp4v(recommended in Windows), dxva(for Windows), avc1(H264, recommended in Linux), vp09(very slow), hevc(not support in Windowds), av01(not support in Windowds) (string [=mp4v])')
parser.add_argument('-F', '--forceFps', action='store_true', help='Set output video fps to the specifying number, 0 to disable')
parser.add_argument('-F', '--forceFps', type=float, help='Set output video fps to the specifying number, 0 to disable')
parser.add_argument('-D', '--disableProgress', action='store_true', help='disable progress display')
parser.add_argument('-W', '--webVideo', type=str, help='process the video from URL')
parser.add_argument('-A', '--alpha', action='store_true', help='preserve the Alpha channel for transparent image')
Expand Down

0 comments on commit 68e6331

Please sign in to comment.