You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
In the file cv_lib/cv_lib/utils.py, the function mask_to_disk normalizes the model prediction before saving. This should not happen, as it will cause the saved results to be incorrect.
defimage_to_disk(mask, fname, cmap_name="seismic"):
""" write segmentation image to disk using a particular colormap """cmap=plt.get_cmap(cmap_name)
Image.fromarray(cmap(normalize(mask), bytes=True)).save(fname)
Specifically, the "normalization" should be done relative to the num_classes value that is specific to the dataset, and not to the model predictions. This is because:
If all the predicted values from the model were the same (regardless of the class), the result would lead to division by zero, which is undefined.
If the results of the model for two samples where different, but the relative values were the same, then the saved results would be the same for the different predictions, which is obviously incorrect.
We should also make sure that the Normalize() function in the same file properly handles division by zero.