Add and use saveNpArray

This commit is contained in:
Benjamin Loison 2024-04-25 15:59:26 +02:00
parent 65708e4977
commit 4907d0c0fb
Signed by: Benjamin_Loison
SSH Key Fingerprint: SHA256:BtnEgYTlHdOg1u+RmYcDE0mnfz1rhv5dSbQ2gyxW8B8

View File

@ -136,6 +136,10 @@ if minColor is None or maxColor is None:
print(f'{minColor=}')
print(f'{maxColor=}')
def saveNpArray(fileName, npArray):
with open(f'{fileName}.npy', 'wb') as f:
np.save(f, npArray)
if denoiser == 'mean':
means = {}
for color in Color:
@ -157,6 +161,5 @@ for color in colors:
for imageFileName in tqdm(imagesFileNames, f'Denoising images for color {color}'):
treatImage(imageFileName, color = color)
npArrayFilePath = f'mean_{imagesFolderPathFileName}_{denoiser}_{color}.npy'
with open(npArrayFilePath, 'wb') as f:
np.save(f, mean)
npArrayFilePath = f'mean_{imagesFolderPathFileName}_{denoiser}_{color}'
saveNpArray(npArrayFilePath, mean)