mirror of
https://github.com/gudovskiy/cflow-ad.git
synced 2025-06-03 14:59:47 +08:00
fixed old np.bool with bool
This commit is contained in:
parent
703f046d5c
commit
c9c759168b
6
train.py
6
train.py
@ -329,11 +329,11 @@ def train(c):
|
|||||||
super_mask = score_mask.max() - score_mask
|
super_mask = score_mask.max() - score_mask
|
||||||
# calculate detection AUROC
|
# calculate detection AUROC
|
||||||
score_label = np.max(super_mask, axis=(1, 2))
|
score_label = np.max(super_mask, axis=(1, 2))
|
||||||
gt_label = np.asarray(gt_label_list, dtype=np.bool)
|
gt_label = np.asarray(gt_label_list, dtype=bool)
|
||||||
det_roc_auc = roc_auc_score(gt_label, score_label)
|
det_roc_auc = roc_auc_score(gt_label, score_label)
|
||||||
_ = det_roc_obs.update(100.0*det_roc_auc, epoch)
|
_ = det_roc_obs.update(100.0*det_roc_auc, epoch)
|
||||||
# calculate segmentation AUROC
|
# calculate segmentation AUROC
|
||||||
gt_mask = np.squeeze(np.asarray(gt_mask_list, dtype=np.bool), axis=1)
|
gt_mask = np.squeeze(np.asarray(gt_mask_list, dtype=bool), axis=1)
|
||||||
seg_roc_auc = roc_auc_score(gt_mask.flatten(), super_mask.flatten())
|
seg_roc_auc = roc_auc_score(gt_mask.flatten(), super_mask.flatten())
|
||||||
save_best_seg_weights = seg_roc_obs.update(100.0*seg_roc_auc, epoch)
|
save_best_seg_weights = seg_roc_obs.update(100.0*seg_roc_auc, epoch)
|
||||||
if save_best_seg_weights and c.action_type != 'norm-test':
|
if save_best_seg_weights and c.action_type != 'norm-test':
|
||||||
@ -352,7 +352,7 @@ def train(c):
|
|||||||
pros_std = []
|
pros_std = []
|
||||||
threds = []
|
threds = []
|
||||||
fprs = []
|
fprs = []
|
||||||
binary_score_maps = np.zeros_like(super_mask, dtype=np.bool)
|
binary_score_maps = np.zeros_like(super_mask, dtype=bool)
|
||||||
for step in range(max_step):
|
for step in range(max_step):
|
||||||
thred = max_th - step * delta
|
thred = max_th - step * delta
|
||||||
# segmentation
|
# segmentation
|
||||||
|
Loading…
x
Reference in New Issue
Block a user