[~] Refactor

This commit is contained in:
Siarhei Siniak 2021-07-23 10:17:18 +03:00
parent 62b4d53b77
commit 21793a86ea

@ -1019,6 +1019,10 @@ def kernel_15(
)
)
t29 = 'output-gif'
if not os.path.exists(t29):
os.makedirs(t29, exist_ok=True)
for t2 in [
'baseball glove',
'baseball bat',
@ -1029,6 +1033,10 @@ def kernel_15(
t3 = o_14['o_13']['t1']
t4 = numpy.where(t3.name.data == t2)[0]
t30 = 'output-png/%s' % t28
if not os.path.exists(t30):
os.makedirs(t30, exist_ok=True)
numpy.random.seed(0)
t22 = numpy.random.choice(t4, 10)
pprint.pprint(t22)
@ -1078,10 +1086,13 @@ def kernel_15(
)
)
matplotlib.pyplot.imshow(t14)
t25 = 'kernel_15-%s-%05d.jpg' % (
t25 = os.path.join(
t30,
'kernel_15-%s-%05d.jpg' % (
t28,
t7,
)
)
f.savefig(t25)
t24.append(t25)
matplotlib.pyplot.close(f)
@ -1094,7 +1105,10 @@ def kernel_15(
], axis=1).T
)
t23 = 'output-%s.gif' % t28
t23 = os.path.join(
t29,
'output-%s.gif' % t28
)
if os.path.exists(t23):
subprocess.check_call(['rm', t23])