INNER CODE UNIT · Python

log_and_collect_files

fofr/cog-face-to-sticker · predict.py:42

    def log_and_collect_files(self, directory, prefix=""):
        files = []
        for f in os.listdir(directory):
            if f == "__MACOSX":
                continue
            path = os.path.join(directory, f)
            if os.path.isfile(path):
                print(f"{prefix}{f}")
                files.append(Path(path))
            elif os.path.isdir(path):
                print(f"{prefix}{f}/")
                files.extend(self.log_and_collect_files(path, prefix=f"{prefix}{f}/"))
        return files

    def update_workflow(self, workflow, **kwargs):
        loader = workflow["2"]["inputs"]
        sampler = workflow["4"]["inputs"]
        load_image = workflow["22"]["inputs"]

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…