shivahanifi / SCDD-image-segmentation-keras

Implementation of Segnet, FCN, UNet , PSPNet and other models in Keras.
https://divamgupta.com/image-segmentation/2019/06/06/deep-learning-semantic-segmentation-keras.html
MIT License
0 stars 0 forks source link

modify 'class_wise_IU` logging #11

Open shivahanifi opened 1 day ago

shivahanifi commented 1 day ago

This is the 'class_wise_IU'. I want to modify the its log in wandb to have it visually tracable.

'class_wise_IU': array([0.69118123, 0.32474498, 0.17643695, 0.        , 0.44040612,
126        0.2937495 , 0.        , 0.03243989, 0.        , 0.        ,
127        0.        , 0.        , 0.        , 0.        , 0.00240512,
128        0.        , 0.        , 0.        , 0.14435879, 0.        ,
129        0.00274044, 0.15647806, 0.        , 0.        ])}
shivahanifi commented 1 day ago

Log as a dictionary

# Prepare class-wise IoU for logging
class_wise_IU = evaluation_result['class_wise_IU']
class_iou_dict = {f"class_{i}": iou for i, iou in enumerate(class_wise_IU)}

# Log the class-wise IoU as a dictionary
wandb.log({"class_wise_IU": class_iou_dict})

TO DO: make class names appear

shivahanifi commented 1 day ago

TO DO: make class names appear

# Prepare class-wise IoU for logging
class_wise_IU = evaluation_result['class_wise_IU']
label_desc = df['Desc'].tolist()
wandb.config.labels_Desc = label_desc
class_iou_dict = {f"class_{i}:{label_desc[i]}": iou for i, iou in enumerate(class_wise_IU)}

# Log evaluation results
wandb.log({"frequency_weighted_IU": evaluation_result['frequency_weighted_IU'], 
            "mean_IU": evaluation_result['mean_IU'], 
            "class_wise_IU": class_iou_dict,  
            })