11 parser = argparse.ArgumentParser(description=
"PhysAugNet CLI")
12 parser.add_argument(
"mode", choices=[
"train_vqvae",
"reconstruct",
"augment_tg",
"augment_combined"])
13 parser.add_argument(
"--config", type=str, default=
"configs/default.yaml")
14 args = parser.parse_args()
15 cfg = load_config(args.config)
16 logger = setup_logger(
"main", cfg[
"log_dir"])
18 if args.mode ==
"train_vqvae":
19 trainer = VQVAETrainer(cfg)
21 elif args.mode ==
"reconstruct":
22 reconstruct_folder(cfg[
"input_dir"], cfg[
"output_dir"], cfg[
"vqvae_path"], cfg[
"vqvae"][
"image_size"])
23 logger.info(f
"Reconstructed images saved to {cfg['output_dir']}")
24 elif args.mode ==
"augment_tg":
25 images, names = load_image_folder(cfg[
"input_dir"])
26 for img, name
in zip(images, names):
27 aug_img = apply_thermal_augmentation(img)
28 save_image(aug_img, f
"{cfg['output_dir']}/{name}")
29 logger.info(f
"Thermal augmentations saved to {cfg['output_dir']}")
30 elif args.mode ==
"augment_combined":
31 apply_combined_augmentation(cfg[
"input_dir"], cfg[
"output_dir"], cfg[
"vqvae_path"])
32 logger.info(f
"Combined augmentations saved to {cfg['output_dir']}")