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

What does index parameter in Load Image Batch node mean??? #389

Open
zerobell-lee opened this issue Apr 27, 2024 · 1 comment
Open

What does index parameter in Load Image Batch node mean??? #389

zerobell-lee opened this issue Apr 27, 2024 · 1 comment

Comments

@zerobell-lee
Copy link

I was making images in batch processes, and I rebooted my PC for some reason. And I got the batch index reset.

Even though I tried specifying index parameter, such as 124. it didn't work. It starts with 0 again.

image

So I investigated source code.

    class BatchImageLoader:
        def __init__(self, directory_path, label, pattern):
            self.WDB = WDB
            self.image_paths = []
            self.load_images(directory_path, pattern)
            self.image_paths.sort()
            stored_directory_path = self.WDB.get('Batch Paths', label)
            stored_pattern = self.WDB.get('Batch Patterns', label)
            if stored_directory_path != directory_path or stored_pattern != pattern:
                self.index = 0
                self.WDB.insert('Batch Counters', label, 0)
                self.WDB.insert('Batch Paths', label, directory_path)
                self.WDB.insert('Batch Patterns', label, pattern)
            else:
                self.index = self.WDB.get('Batch Counters', label)
            self.label = label

it even does not use index parameter in the loader. Only when I'm doing continuous task at the same environment, I can get indices sequential. So there is no way to start with specific index.

Then, what is index parameter standing for?

@WAS-PlaiLabs
Copy link
Collaborator

Did, you, like try changing the mode to single_image? hehe

        if mode == 'single_image':
            image, filename = fl.get_image_by_id(index)
            if image == None:
                cstr(f"No valid image was found for the inded `{index}`").error.print()
                return (None, None)

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