Skip to content

fix: lq image written multiple times due to missing check for existing file. #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions neosr/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,8 +924,10 @@ def nondist_validation(
# add original lq and gt to results folder, once
if self.opt["val"].get("save_lq", True):
save_lq_img_path = Path(v_folder) / img_name / f"{img_name}_lq.png"
original_lq = tensor2img([visuals["lq"]])
imwrite(original_lq, str(save_lq_img_path))

if not Path.exists(save_lq_img_path):
original_lq = tensor2img([visuals["lq"]])
imwrite(original_lq, str(save_lq_img_path))

# check for dataset option save_tb, to save images on tb_logger
if self.is_train:
Expand Down