Skip to content

Commit

Permalink
Minor Update test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
p1x31 committed Jul 12, 2021
1 parent e6b6271 commit b01c01a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Global/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import torch
import torchvision.utils as vutils
import torchvision.transforms as transforms
import torchvision.transforms as transforms
import numpy as np
import cv2

Expand Down Expand Up @@ -140,11 +139,11 @@ def parameter_set(opt):
if opt.NL_use_mask:
mask_name = mask_loader[i]
mask = Image.open(os.path.join(opt.test_mask, mask_name)).convert("RGB")
if opt.mask_dilation!=0:
kernel=np.ones((3,3),np.uint8)
mask=np.array(mask)
mask=cv2.dilate(mask,kernel,iterations=opt.mask_dilation)
mask=Image.fromarray(mask.astype('uint8'))
if opt.mask_dilation != 0:
kernel = np.ones((3,3),np.uint8)
mask = np.array(mask)
mask = cv2.dilate(mask,kernel,iterations = opt.mask_dilation)
mask = Image.fromarray(mask.astype('uint8'))
origin = input
input = irregular_hole_synthesize(input, mask)
mask = mask_transform(mask)
Expand Down Expand Up @@ -190,5 +189,4 @@ def parameter_set(opt):
normalize=True,
)

origin.save(opt.outputs_dir + "/origin/" + input_name)

origin.save(opt.outputs_dir + "/origin/" + input_name)

0 comments on commit b01c01a

Please sign in to comment.