Make split_and_compare_prnus_of_subgroups.py execution compatible with chaining shell commands

Otherwise it is stuck on `plt.show` until it is closed but we want to
chain with a notification command, so the notification is not
interesting in this case.
This commit is contained in:
Benjamin Loison 2024-04-27 19:36:45 +02:00
parent 9d8e5ddbec
commit 80a33428d6
No known key found for this signature in database

View File

@ -18,6 +18,8 @@ NUMBER_OF_SUBGROUPS = 2
DENOISER = 'wavelet'
IMAGES_FOLDER = 'flat-field/TIF'
setting = IMAGES_FOLDER.replace('/', '_') + f'_{DENOISER}'
imagesFileNames = os.listdir(IMAGES_FOLDER)
# To not have a bias (chronological for instance) when split to make subgroups.
shuffle(imagesFileNames)
@ -46,10 +48,11 @@ minimum = np.min(mostImagesSubgroupPrnuEstimatesNpArray)
maximum = np.max(mostImagesSubgroupPrnuEstimatesNpArray)
for subgroupIndex in range(NUMBER_OF_SUBGROUPS):
plt.imsave(f'prnu_subgroup_{subgroupIndex}.png', (subgroupsIterativeMean[subgroupIndex].mean - minimum) / (maximum - minimum))
plt.imsave(f'{setting}_estimated_prnu_subgroup_{subgroupIndex}.png', (subgroupsIterativeMean[subgroupIndex].mean - minimum) / (maximum - minimum))
plt.title(f'RMS between both subgroups estimated PRNUs with {DENOISER} denoiser for a given number of images among them')
plt.xlabel('Number of images of each subgroup')
plt.ylabel('RMS between both subgroups estimated PRNUs')
plt.plot(rmss)
plt.show()
plt.savefig(f'{setting}_rms_between_estimated_prnu_of_2_subgroups.svg')
#plt.show()