merge_imgs

This commit is contained in:
2025-06-23 11:29:52 +08:00
parent a17373d576
commit 56b161dc49
8 changed files with 182 additions and 48 deletions

View File

@ -389,6 +389,7 @@ class ConfusionMatrix:
cls = detect_cur_cpu[5]
c = int(cls)
label = f'{names[c]} {conf:.2f} iou:{float(iou):.2f}'
print(">>>>>>>>>>>>>>>>>>> label: {} C: {}".format(label, c))
if fp_flag:
annotator.box_label(xyxy, label, color=(125, 0, 125)) ##fp iou匹配上类别错误 紫色框
else:
@ -465,7 +466,7 @@ class ConfusionMatrix:
annotators_tp = self.create_annotator(images_tp, Annotator, names)
annotators_all = self.create_annotator(images_all, Annotator, names)
### 新建不同检测类别保存的文件夹,文件夹名称为类别索引
date_path = 'confusion_0717_cls10_' + str(self.iou_thres)
date_path = 'confusion_gift_cls4_' + str(self.iou_thres)
paths_fn = self.makdirs_file(date_path, img_name, self.nc, str_c='FN')
paths_fp = self.makdirs_file(date_path, img_name, self.nc, str_c='FP')
paths_fp_bg = self.makdirs_file(date_path, img_name, self.nc, str_c='FP_bg')
@ -485,7 +486,7 @@ class ConfusionMatrix:
cls_flag_list_tp = [False for _ in range(self.nc)] ###混淆矩阵斜对角线上类别flag
## 混淆矩阵可视化 flag 设置
save_oneImg = False ### 将所有pred_box与gt_box匹配结果画在一张图片上
save_oneImg = True #pred_box与gt_box匹配结果画在一张图片上
save_byClass = True ### 将所有pred_box与gt_box匹配结果按box类别分类保存其中tp、fn、fp按gt_box类别划分fp_bg按pred_box划分
cls_flag_list = []
###=========================