Skip to content
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

Random_StyleIAMDataset bug? #18

Open
vincentkk6356 opened this issue Oct 24, 2024 · 1 comment
Open

Random_StyleIAMDataset bug? #18

vincentkk6356 opened this issue Oct 24, 2024 · 1 comment

Comments

@vincentkk6356
Copy link

vincentkk6356 commented Oct 24, 2024

def get_style_ref(self, wr_id): # Choose the style image whose length exceeds 32 pixels
style_list = os.listdir(os.path.join(self.style_path, wr_id))
random.shuffle(style_list)
for index in range(len(style_list)):
style_ref = style_list[index]
style_image = cv2.imread(os.path.join(self.style_path, wr_id, style_ref), flags=0)
laplace_image = cv2.imread(os.path.join(self.laplace_path, wr_id, style_ref), flags=0)
if style_image.shape[1] > 128:
break
else:
continue
style_image = style_image/255.0
laplace_image = laplace_image/255.0
return style_image, laplace_image

Why is this function looping all the images instead of just picking one? It slows down the inference by quite a lot.

@dailenson
Copy link
Owner

dailenson commented Oct 26, 2024

This function isn't looping through all the images. It stops once it finds an image with a width greater than 128 pixels. The reasoning behind this is that longer images help ensure more stable performance, as mentioned in Section I of our paper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants