From c94a5f608e3237710b4b82065fe3f0f57ccca1f6 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Thu, 22 Jul 2021 11:35:15 +0300 Subject: [PATCH] [~] Refactor --- python/tasks/mlb_player.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/python/tasks/mlb_player.py b/python/tasks/mlb_player.py index 7603c68..d8ec44a 100644 --- a/python/tasks/mlb_player.py +++ b/python/tasks/mlb_player.py @@ -1027,6 +1027,7 @@ def kernel_15( t22 = numpy.random.choice(t4, 10) pprint.pprint(t22) import tqdm + t24 = [] for t5 in tqdm.tqdm(t22): t6 = t3.video_path.data[t5] t7 = t3.frame_id.data[t5] @@ -1070,10 +1071,25 @@ def kernel_15( ) ) matplotlib.pyplot.imshow(t14) - f.savefig('kernel_15-%05d.png' % t7) + t25 = 'kernel_15-%05d.png' % t7 + f.savefig(t25) + t24.append(t25) matplotlib.pyplot.close(f) pprint.pprint([t8, t21]) + t23 = 'output.gif' + if os.path.exists(t23): + subprocess.check_call(['rm', t23]) - return + subprocess.check_call( + [ + 'convert', + '-delay', + '100', + '-loop', + '0', + *t24, + t23, + ] + )