VideoSpeedTest.py : Add numba checkbox
This commit is contained in:
parent
bfc63bb730
commit
09ce81655d
@ -31,6 +31,13 @@ except ImportError:
|
||||
cp = None
|
||||
_has_cupy = False
|
||||
|
||||
try:
|
||||
import numba
|
||||
_has_numba = True
|
||||
except ImportError:
|
||||
numba = None
|
||||
_has_numba = False
|
||||
|
||||
try:
|
||||
from pyqtgraph.widgets.RawImageWidget import RawImageGLWidget
|
||||
except ImportError:
|
||||
@ -71,6 +78,8 @@ else:
|
||||
# read in CLI args
|
||||
ui.cudaCheck.setChecked(args.cuda and _has_cupy)
|
||||
ui.cudaCheck.setEnabled(_has_cupy)
|
||||
ui.numbaCheck.setChecked(_has_numba and pg.getConfigOption("useNumba"))
|
||||
ui.numbaCheck.setEnabled(_has_numba)
|
||||
ui.framesSpin.setValue(args.frames)
|
||||
ui.widthSpin.setValue(args.size[0])
|
||||
ui.heightSpin.setValue(args.size[1])
|
||||
@ -216,6 +225,11 @@ def noticeCudaCheck():
|
||||
xp = np
|
||||
mkData()
|
||||
|
||||
|
||||
def noticeNumbaCheck():
|
||||
pg.setConfigOption('useNumba', _has_numba and ui.numbaCheck.isChecked())
|
||||
|
||||
|
||||
mkData()
|
||||
|
||||
|
||||
@ -229,6 +243,7 @@ ui.widthSpin.valueChanged.connect(updateSize)
|
||||
ui.heightSpin.valueChanged.connect(updateSize)
|
||||
ui.framesSpin.valueChanged.connect(updateSize)
|
||||
ui.cudaCheck.toggled.connect(noticeCudaCheck)
|
||||
ui.numbaCheck.toggled.connect(noticeNumbaCheck)
|
||||
|
||||
|
||||
ptr = 0
|
||||
|
@ -22,6 +22,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="2" colspan="2">
|
||||
<widget class="QCheckBox" name="numbaCheck">
|
||||
<property name="text">
|
||||
<string>Use Numba if available</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="downsampleCheck">
|
||||
<property name="text">
|
||||
|
@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'examples/VideoTemplate.ui'
|
||||
# Form implementation generated from reading ui file '.\VideoTemplate.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.1
|
||||
# Created by: PyQt5 UI code generator 5.15.4
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
@ -22,6 +22,9 @@ class Ui_MainWindow(object):
|
||||
self.cudaCheck = QtWidgets.QCheckBox(self.centralwidget)
|
||||
self.cudaCheck.setObjectName("cudaCheck")
|
||||
self.gridLayout_2.addWidget(self.cudaCheck, 9, 0, 1, 2)
|
||||
self.numbaCheck = QtWidgets.QCheckBox(self.centralwidget)
|
||||
self.numbaCheck.setObjectName("numbaCheck")
|
||||
self.gridLayout_2.addWidget(self.numbaCheck, 9, 2, 1, 2)
|
||||
self.downsampleCheck = QtWidgets.QCheckBox(self.centralwidget)
|
||||
self.downsampleCheck.setObjectName("downsampleCheck")
|
||||
self.gridLayout_2.addWidget(self.downsampleCheck, 8, 0, 1, 2)
|
||||
@ -183,6 +186,7 @@ class Ui_MainWindow(object):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
|
||||
self.cudaCheck.setText(_translate("MainWindow", "Use CUDA (GPU) if available"))
|
||||
self.numbaCheck.setText(_translate("MainWindow", "Use Numba if available"))
|
||||
self.downsampleCheck.setText(_translate("MainWindow", "Auto downsample"))
|
||||
self.scaleCheck.setText(_translate("MainWindow", "Scale Data"))
|
||||
self.rawRadio.setText(_translate("MainWindow", "RawImageWidget"))
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Form implementation generated from reading ui file 'VideoTemplate.ui'
|
||||
# Form implementation generated from reading ui file '.\VideoTemplate.ui'
|
||||
#
|
||||
# Created by: PyQt6 UI code generator 6.0.0
|
||||
# Created by: PyQt6 UI code generator 6.0.3
|
||||
#
|
||||
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
|
||||
# run again. Do not edit this file unless you know what you are doing.
|
||||
@ -20,6 +20,9 @@ class Ui_MainWindow(object):
|
||||
self.cudaCheck = QtWidgets.QCheckBox(self.centralwidget)
|
||||
self.cudaCheck.setObjectName("cudaCheck")
|
||||
self.gridLayout_2.addWidget(self.cudaCheck, 9, 0, 1, 2)
|
||||
self.numbaCheck = QtWidgets.QCheckBox(self.centralwidget)
|
||||
self.numbaCheck.setObjectName("numbaCheck")
|
||||
self.gridLayout_2.addWidget(self.numbaCheck, 9, 2, 1, 2)
|
||||
self.downsampleCheck = QtWidgets.QCheckBox(self.centralwidget)
|
||||
self.downsampleCheck.setObjectName("downsampleCheck")
|
||||
self.gridLayout_2.addWidget(self.downsampleCheck, 8, 0, 1, 2)
|
||||
@ -181,6 +184,7 @@ class Ui_MainWindow(object):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
|
||||
self.cudaCheck.setText(_translate("MainWindow", "Use CUDA (GPU) if available"))
|
||||
self.numbaCheck.setText(_translate("MainWindow", "Use Numba if available"))
|
||||
self.downsampleCheck.setText(_translate("MainWindow", "Auto downsample"))
|
||||
self.scaleCheck.setText(_translate("MainWindow", "Scale Data"))
|
||||
self.rawRadio.setText(_translate("MainWindow", "RawImageWidget"))
|
||||
|
@ -32,6 +32,11 @@ class Ui_MainWindow(object):
|
||||
|
||||
self.gridLayout_2.addWidget(self.cudaCheck, 9, 0, 1, 2)
|
||||
|
||||
self.numbaCheck = QCheckBox(self.centralwidget)
|
||||
self.numbaCheck.setObjectName(u"numbaCheck")
|
||||
|
||||
self.gridLayout_2.addWidget(self.numbaCheck, 9, 2, 1, 2)
|
||||
|
||||
self.downsampleCheck = QCheckBox(self.centralwidget)
|
||||
self.downsampleCheck.setObjectName(u"downsampleCheck")
|
||||
|
||||
@ -264,6 +269,7 @@ class Ui_MainWindow(object):
|
||||
def retranslateUi(self, MainWindow):
|
||||
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
|
||||
self.cudaCheck.setText(QCoreApplication.translate("MainWindow", u"Use CUDA (GPU) if available", None))
|
||||
self.numbaCheck.setText(QCoreApplication.translate("MainWindow", u"Use Numba if available", None))
|
||||
self.downsampleCheck.setText(QCoreApplication.translate("MainWindow", u"Auto downsample", None))
|
||||
self.scaleCheck.setText(QCoreApplication.translate("MainWindow", u"Scale Data", None))
|
||||
self.rawRadio.setText(QCoreApplication.translate("MainWindow", u"RawImageWidget", None))
|
||||
|
@ -3,7 +3,7 @@
|
||||
################################################################################
|
||||
## Form generated from reading UI file 'VideoTemplate.ui'
|
||||
##
|
||||
## Created by: Qt User Interface Compiler version 6.0.0
|
||||
## Created by: Qt User Interface Compiler version 6.0.3
|
||||
##
|
||||
## WARNING! All changes made in this file will be lost when recompiling UI file!
|
||||
################################################################################
|
||||
@ -32,6 +32,11 @@ class Ui_MainWindow(object):
|
||||
|
||||
self.gridLayout_2.addWidget(self.cudaCheck, 9, 0, 1, 2)
|
||||
|
||||
self.numbaCheck = QCheckBox(self.centralwidget)
|
||||
self.numbaCheck.setObjectName(u"numbaCheck")
|
||||
|
||||
self.gridLayout_2.addWidget(self.numbaCheck, 9, 2, 1, 2)
|
||||
|
||||
self.downsampleCheck = QCheckBox(self.centralwidget)
|
||||
self.downsampleCheck.setObjectName(u"downsampleCheck")
|
||||
|
||||
@ -264,6 +269,7 @@ class Ui_MainWindow(object):
|
||||
def retranslateUi(self, MainWindow):
|
||||
MainWindow.setWindowTitle(QCoreApplication.translate("MainWindow", u"MainWindow", None))
|
||||
self.cudaCheck.setText(QCoreApplication.translate("MainWindow", u"Use CUDA (GPU) if available", None))
|
||||
self.numbaCheck.setText(QCoreApplication.translate("MainWindow", u"Use Numba if available", None))
|
||||
self.downsampleCheck.setText(QCoreApplication.translate("MainWindow", u"Auto downsample", None))
|
||||
self.scaleCheck.setText(QCoreApplication.translate("MainWindow", u"Scale Data", None))
|
||||
self.rawRadio.setText(QCoreApplication.translate("MainWindow", u"RawImageWidget", None))
|
||||
|
Loading…
x
Reference in New Issue
Block a user