Skip to content

Commit

Permalink
fix: gui button sizing & output saving
Browse files Browse the repository at this point in the history
  • Loading branch information
chompaa committed Aug 9, 2023
1 parent 110bbb6 commit 21019eb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ def __init__(self, image_width, image_height):
select_image = QPushButton("Choose File")
select_image.clicked.connect(self.select_image)
select_image.setFixedWidth(self.image_width)
select_image.setFixedHeight(self.image_height)

layout.addWidget(self.display_image, alignment=Qt.AlignmentFlag.AlignCenter)
layout.addWidget(select_image, alignment=Qt.AlignmentFlag.AlignCenter)
Expand Down
6 changes: 1 addition & 5 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
from utils import convert_rgb_to_ycbcr, convert_ycbcr_to_rgb, calculate_psnr


def get_image_name_from_path(path):
return path.split("/")[-1].split("\\")[-1]


def sisr(weights_file, output_folder, image_file, scale, set_status):
cudnn.benchmark = True
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
Expand Down Expand Up @@ -80,7 +76,7 @@ def sisr(weights_file, output_folder, image_file, scale, set_status):

set_status("Saving SRCNN image...")

output.save(f"{output_folder}{image_file.replace('.', f'_srcnn_x{scale}.')}")
output.save(f"{output_folder}{image_name.replace('.', f'_srcnn_x{scale}.')}")

set_status(f"Done! PSNR: {psnr:.2f}")

Expand Down

0 comments on commit 21019eb

Please sign in to comment.