Skip to content

Commit

Permalink
add benchmark mode button
Browse files Browse the repository at this point in the history
  • Loading branch information
TNTwise committed Aug 22, 2024
1 parent 4b89b85 commit 4bfd1f2
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 18 deletions.
1 change: 0 additions & 1 deletion backend/src/InterpolateTorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ def tensor_to_frame(self, frame: torch.Tensor):

return (
frame
.byte()
.contiguous()
.cpu()
.numpy()
Expand Down
1 change: 0 additions & 1 deletion backend/src/UpscaleTorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ def renderToNPArray(self, image: torch.Tensor) -> torch.Tensor:
.float()
.clamp(0.0, 1.0)
.mul(255)
.byte()
.contiguous()
.detach()
.cpu()
Expand Down
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ def startRender(self):
self.interpolationMultiplierComboBox.currentText()
),
model=self.modelComboBox.currentText(),
benchmarkMode=self.benchmarkModeCheckBox.isChecked(),
)
else:
pass
Expand Down
8 changes: 7 additions & 1 deletion src/ui/ProcessTab.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ def run(
backend: str,
interpolationTimes: int,
model: str,
benchmarkMode: bool,
):
self.inputFile = inputFile
self.outputPath = outputPath
Expand All @@ -265,7 +266,7 @@ def run(
Then, based on the settings selected, it will build a command that is then passed into rve-backend
Finally, It will handle the render via ffmpeg. Taking in the frames from pipe and handing them into ffmpeg on a sperate thread
"""

self.benchmarkMode = benchmarkMode
# get model attributes
self.modelFile = models[model][0]
self.downloadFile = models[model][1]
Expand Down Expand Up @@ -365,6 +366,11 @@ def renderToPipeThread(self, method: str, backend: str, interpolateTimes: int):
"--interpolateFactor",
f"{interpolateTimes}",
]

if self.benchmarkMode:
command += [
"--benchmark"
]
self.renderProcess = subprocess.Popen(
command,
stdout=subprocess.PIPE,
Expand Down
Binary file modified src/ui/__pycache__/DownloadTab.cpython-311.pyc
Binary file not shown.
Binary file modified src/ui/__pycache__/MoreTab.cpython-311.pyc
Binary file not shown.
Binary file modified src/ui/__pycache__/ProcessTab.cpython-311.pyc
Binary file not shown.
Binary file modified src/ui/__pycache__/QTcustom.cpython-311.pyc
Binary file not shown.
Binary file modified src/ui/__pycache__/QTstyle.cpython-311.pyc
Binary file not shown.
Binary file modified src/ui/__pycache__/SettingsTab.cpython-311.pyc
Binary file not shown.
69 changes: 54 additions & 15 deletions testRVEInterface.ui
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ QPushButton:hover{
background-color:#343b47;
}

QCheckBox{
color:#fff;
background-color:#fff;
}
</string>
</property>
<widget class="QWidget" name="centralwidget">
Expand Down Expand Up @@ -784,6 +788,54 @@ li.checked::marker { content: &quot;\2612&quot;; }
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_6" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_15">
<item>
<widget class="QLabel" name="label_18">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>Benchmark Mode</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="benchmarkModeCheckBox">
<property name="styleSheet">
<string notr="true">QCheckBox::indicator{
border : 1px solid white;
border-radius: 2px;
}
QCheckBox::indicator::checked{
background-color:white;
}
</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QVBoxLayout" name="verticalLayout_13">
Expand All @@ -792,7 +844,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
<property name="minimumSize">
<size>
<width>0</width>
<height>170</height>
<height>40</height>
</size>
</property>
<property name="maximumSize">
Expand Down Expand Up @@ -822,7 +874,7 @@ li.checked::marker { content: &quot;\2612&quot;; }
<property name="minimumSize">
<size>
<width>0</width>
<height>150</height>
<height>40</height>
</size>
</property>
<property name="maximumSize">
Expand Down Expand Up @@ -868,19 +920,6 @@ li.checked::marker { content: &quot;\2612&quot;; }
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
Expand Down

0 comments on commit 4bfd1f2

Please sign in to comment.