comparison image_workflow.py @ 21:d5c582cf74bc draft default tip

planemo upload for repository https://github.com/goeckslab/gleam.git commit eed8c1e1d99a8a0c8f3a6bfdd8af48a5bfa19444
author goeckslab
date Tue, 20 Jan 2026 01:25:35 +0000
parents 64872c48a21f
children
comparison
equal deleted inserted replaced
20:64872c48a21f 21:d5c582cf74bc
365 """Execute the full workflow end-to-end.""" 365 """Execute the full workflow end-to-end."""
366 logger.info("Starting workflow...") 366 logger.info("Starting workflow...")
367 self.args.output_dir.mkdir(parents=True, exist_ok=True) 367 self.args.output_dir.mkdir(parents=True, exist_ok=True)
368 368
369 try: 369 try:
370 if getattr(self.args, "torch_home", None):
371 torch_home = Path(self.args.torch_home).expanduser().resolve()
372 torch_home.mkdir(parents=True, exist_ok=True)
373 os.environ["TORCH_HOME"] = str(torch_home)
374 try:
375 import torch
376
377 torch.hub.set_dir(str(torch_home))
378 except Exception as exc:
379 logger.warning("Unable to set Torch Hub cache dir: %s", exc)
380
370 self._create_temp_dirs() 381 self._create_temp_dirs()
371 self._extract_images() 382 self._extract_images()
372 csv_path, split_cfg, split_info = self._prepare_data() 383 csv_path, split_cfg, split_info = self._prepare_data()
373 384
374 use_pretrained = self.args.use_pretrained or self.args.fine_tune 385 use_pretrained = self.args.use_pretrained or self.args.fine_tune