From d72608756b189ed1420837e68dc6e7d17aa05a16 Mon Sep 17 00:00:00 2001 From: "Michael Pilosov, PhD" Date: Thu, 22 Feb 2024 08:25:59 +0000 Subject: [PATCH] really high res images... will be slow. --- callbacks.py | 10 ++++++---- newsearch.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/callbacks.py b/callbacks.py index f17da49..72f6c6a 100644 --- a/callbacks.py +++ b/callbacks.py @@ -35,12 +35,14 @@ class SaveImageCallback(Callback): version = pl_module.trainer.logger.version fname = Path(f"{self.final_dir}") / Path(f"v{version}") pl_module.eval() - create_circle(pl_module, fname=fname) + create_circle(pl_module, fname=fname, dpi=300, figsize=(6, 6)) if self.save_interval > 0: import os log_dir = str(Path(pl_module.trainer.logger.log_dir)) fps = 12 - os.system( - f'ffmpeg -i {log_dir}/e%04d.png -c:v libx264 -vf "fps={fps},format=yuv420p,pad=ceil(iw/2)*2:ceil(ih/2)*2" {log_dir}/a{version}.mp4' - ) + _cmd = f'ffmpeg -r {fps} -f image2 -i {log_dir}/e%04d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2:color=white" {log_dir}/a{version}.mp4' + os.system(_cmd) + # os.system( + # f'ffmpeg -i {log_dir}/e%04d.png -c:v libx264 -vf "fps={fps},format=yuv420p,pad=ceil(iw/2)*2:ceil(ih/2)*2" {log_dir}/a{version}.mp4' + # ) diff --git a/newsearch.py b/newsearch.py index 56a1823..a52c068 100644 --- a/newsearch.py +++ b/newsearch.py @@ -33,7 +33,7 @@ depths = [1, 2, 4, 8, 16] # widths, depths = [512], [4] batch_size_values = [256] -max_epochs_values = [100] +max_epochs_values = [420] # at 12 fps, around 35s seeds = list(range(21, 1992)) optimizers = [ # "Adagrad",