Skip to content

Commit

Permalink
fix: start super-resolution restoration from noise
Browse files Browse the repository at this point in the history
  • Loading branch information
royale authored and beniz committed Sep 22, 2023
1 parent 8f8ccf0 commit 3bce4a9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions models/palette_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ def set_input(self, data):
else:
self.mask = data["B_label_mask"].to(self.device)
else: # e.g. super-resolution
self.y_t = data["A"].to(self.device)
self.gt_image = data["A"].to(self.device)
self.mask = None

Expand Down Expand Up @@ -746,7 +745,6 @@ def inference(self):
elif self.task == "super_resolution":
self.output, self.visuals = netG.restoration(
y_cond=self.cond_image[: self.inference_num],
y_t=self.cond_image[: self.inference_num],
sample_num=self.sample_num,
cls=None,
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/gen_single_image_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ def generate(
img_tensor.clone().detach(), mask.clone().detach(), {}
)
else:
y_t = img_tensor.clone().detach()
y_t = torch.randn_like(img_tensor)

if opt.alg_palette_cond_image_creation == "previous_frame":
if previous_frame is not None:
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ if [ $OUT != 0 ]; then
fi

###### diffusion super-resolution process test
python3 -m pytest -p no:cacheprovider -s "${current_dir}/../tests/test_run_sr_diffusion.py" --dataroot "$TARGET_MASK_SEM_DIR"
python3 -m pytest -p no:cacheprovider -s "${current_dir}/../tests/test_run_sr_diffusion.py" --dataroot "$TARGET_MASK_SEM_DIR/trainA/img"
OUT=$?

if [ $OUT != 0 ]; then
Expand Down

0 comments on commit 3bce4a9

Please sign in to comment.