(outdir)
| 77 | |
| 78 | |
| 79 | def save_current_code(outdir): |
| 80 | now = datetime.datetime.now() # current date and time |
| 81 | date_time = now.strftime("%m_%d-%H:%M:%S") |
| 82 | src_dir = "." |
| 83 | dst_dir = os.path.join(outdir, "code", "{}".format(date_time)) |
| 84 | shutil.copytree( |
| 85 | src_dir, |
| 86 | dst_dir, |
| 87 | ignore=shutil.ignore_patterns( |
| 88 | ".vscode*", |
| 89 | "assets*", |
| 90 | "example*", |
| 91 | "checkpoints*", |
| 92 | "OLD*", |
| 93 | "logs*", |
| 94 | "out*", |
| 95 | "runs*", |
| 96 | "*.png", |
| 97 | "*.mp4", |
| 98 | "*__pycache__*", |
| 99 | "*.git*", |
| 100 | "*.idea*", |
| 101 | "*.zip", |
| 102 | "*.jpg", |
| 103 | "*.pth", |
| 104 | ), |
| 105 | dirs_exist_ok=True, |
| 106 | ) |
| 107 | return dst_dir |
| 108 | |
| 109 | |
| 110 | def train(args): |