added more GUI options for waifu2x-converter-cpp

This commit is contained in:
k4yt3x 2020-05-09 20:10:12 -04:00
parent 26558c6159
commit a64fabae87
3 changed files with 113 additions and 7 deletions

View File

@ -257,11 +257,16 @@ class Video2XMainWindow(QMainWindow):
self.waifu2x_converter_cpp_path_edit_button = self.findChild(QPushButton, 'waifu2xConverterCppPathSelectButton')
self.waifu2x_converter_cpp_path_edit_button.clicked.connect(lambda: self.select_driver_binary_path(self.waifu2x_converter_cpp_path_line_edit))
self.waifu2x_converter_cpp_png_compression_spin_box = self.findChild(QSpinBox, 'waifu2xConverterCppPngCompressionSpinBox')
self.waifu2x_converter_cpp_image_quality_spin_box = self.findChild(QSpinBox, 'waifu2xConverterCppImageQualitySpinBox')
self.waifu2x_converter_cpp_block_size_spin_box = self.findChild(QSpinBox, 'waifu2xConverterCppBlockSizeSpinBox')
self.waifu2x_converter_cpp_processor_spin_box = self.findChild(QSpinBox, 'waifu2xConverterCppProcessorSpinBox')
self.waifu2x_converter_cpp_model_combo_box = self.findChild(QComboBox, 'waifu2xConverterCppModelComboBox')
self.waifu2x_converter_cpp_noise_level_spin_box = self.findChild(QSpinBox, 'waifu2xConverterCppNoiseLevelSpinBox')
self.waifu2x_converter_cpp_mode_combo_box = self.findChild(QComboBox, 'waifu2xConverterCppModeComboBox')
self.waifu2x_converter_cpp_disable_gpu_check_box = self.findChild(QCheckBox, 'disableGpuCheckBox')
self.waifu2x_converter_cpp_tta_check_box = self.findChild(QCheckBox, 'ttaCheckBox')
self.waifu2x_converter_cpp_log_level_spin_box = self.findChild(QSpinBox, 'waifu2xConverterCppLogLevelSpinBox')
self.waifu2x_converter_cpp_disable_gpu_check_box = self.findChild(QCheckBox, 'waifu2xConverterCppDisableGpuCheckBox')
self.waifu2x_converter_cpp_force_opencl_check_box = self.findChild(QCheckBox, 'waifu2xConverterCppForceOpenclCheckBox')
self.waifu2x_converter_cpp_tta_check_box = self.findChild(QCheckBox, 'waifu2xConverterCppTtaCheckBox')
# waifu2x-ncnn-vulkan
self.waifu2x_ncnn_vulkan_path_line_edit = self.findChild(QLineEdit, 'waifu2xNcnnVulkanPathLineEdit')
@ -386,9 +391,14 @@ class Video2XMainWindow(QMainWindow):
settings = self.config['waifu2x_converter_cpp']
self.waifu2x_converter_cpp_path_line_edit.setText(str(pathlib.Path(os.path.expandvars(settings['path'])).absolute()))
self.waifu2x_converter_cpp_png_compression_spin_box.setValue(settings['png-compression'])
self.waifu2x_converter_cpp_image_quality_spin_box.setValue(settings['image-quality'])
self.waifu2x_converter_cpp_block_size_spin_box.setValue(settings['block-size'])
self.waifu2x_converter_cpp_processor_spin_box.setValue(settings['processor'])
self.waifu2x_converter_cpp_noise_level_spin_box.setValue(settings['noise-level'])
self.waifu2x_converter_cpp_mode_combo_box.setCurrentText(settings['mode'])
self.waifu2x_converter_cpp_log_level_spin_box.setValue(settings['log-level'])
self.waifu2x_converter_cpp_disable_gpu_check_box.setChecked(settings['disable-gpu'])
self.waifu2x_converter_cpp_force_opencl_check_box.setChecked(settings['force-OpenCL'])
self.waifu2x_converter_cpp_tta_check_box.setChecked(bool(settings['tta']))
# waifu2x-ncnn-vulkan
@ -445,10 +455,15 @@ class Video2XMainWindow(QMainWindow):
# waifu2x-converter-cpp
self.config['waifu2x_converter_cpp']['path'] = os.path.expandvars(self.waifu2x_converter_cpp_path_line_edit.text())
self.config['waifu2x_converter_cpp']['png-compression'] = self.waifu2x_converter_cpp_png_compression_spin_box.value()
self.config['waifu2x_converter_cpp']['image-quality'] = self.waifu2x_converter_cpp_image_quality_spin_box.value()
self.config['waifu2x_converter_cpp']['block-size'] = self.waifu2x_converter_cpp_block_size_spin_box.value()
self.config['waifu2x_converter_cpp']['processor'] = self.waifu2x_converter_cpp_processor_spin_box.value()
self.config['waifu2x_converter_cpp']['model-dir'] = str((pathlib.Path(self.config['waifu2x_converter_cpp']['path']).parent / self.waifu2x_converter_cpp_model_combo_box.currentText()).absolute())
self.config['waifu2x_converter_cpp']['noise-level'] = self.waifu2x_converter_cpp_noise_level_spin_box.value()
self.config['waifu2x_converter_cpp']['mode'] = self.waifu2x_converter_cpp_mode_combo_box.currentText()
self.config['waifu2x_converter_cpp']['log-level'] = self.waifu2x_converter_cpp_log_level_spin_box.value()
self.config['waifu2x_converter_cpp']['disable-gpu'] = bool(self.waifu2x_converter_cpp_disable_gpu_check_box.isChecked())
self.config['waifu2x_converter_cpp']['force-OpenCL'] = bool(self.waifu2x_converter_cpp_force_opencl_check_box.isChecked())
self.config['waifu2x_converter_cpp']['tta'] = int(self.waifu2x_converter_cpp_tta_check_box.isChecked())
# waifu2x-ncnn-vulkan

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.12.0, 2020-05-08T20:28:53. -->
<!-- Written by QtCreator 4.12.0, 2020-05-09T20:09:59. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>718</width>
<width>719</width>
<height>740</height>
</rect>
</property>
@ -652,6 +652,48 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="waifu2xConverterCppImageQualityHorizontalLayout">
<item>
<widget class="QLabel" name="waifu2xConverterCppImageQualityLabel">
<property name="text">
<string>Image Quality</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="waifu2xConverterCppImageQualitySpinBox">
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>101</number>
</property>
<property name="value">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="waifu2xConverterCppBlockSizeHorizontalLayout">
<item>
<widget class="QLabel" name="waifu2xConverterCppBlockSizeLabel">
<property name="text">
<string>Block Size</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="waifu2xConverterCppBlockSizeSpinBox">
<property name="maximum">
<number>9999</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="waifu2xConverterCppProcessorHorizontalLayout">
<item>
@ -696,6 +738,27 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="waifu2xConverterCppNoiseLevelHorizontalLayout">
<item>
<widget class="QLabel" name="waifu2xConverterCppNoiseLevelLabel">
<property name="text">
<string>Noise Level</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="waifu2xConverterCppNoiseLevelSpinBox">
<property name="maximum">
<number>3</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="waifu2xConverterCppModeHorizontalLayout">
<item>
@ -726,17 +789,45 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="waifu2xConverterCppLogLevelHorizontalLayout">
<item>
<widget class="QLabel" name="waifu2xConverterCppLogLevelLabel">
<property name="text">
<string>Log Level</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="waifu2xConverterCppLogLevelSpinBox">
<property name="maximum">
<number>4</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="waifu2xConverterCppOptionsHorizontalLayout">
<item>
<widget class="QCheckBox" name="disableGpuCheckBox">
<widget class="QCheckBox" name="waifu2xConverterCppDisableGpuCheckBox">
<property name="text">
<string>Disable GPU</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="ttaCheckBox">
<widget class="QCheckBox" name="waifu2xConverterCppForceOpenclCheckBox">
<property name="text">
<string>Force OpenCL</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="waifu2xConverterCppTtaCheckBox">
<property name="text">
<string>TTA (Test-Time Augmentation)</string>
</property>
@ -1462,7 +1553,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>718</width>
<width>719</width>
<height>21</height>
</rect>
</property>