mirror of
https://gitee.com/nanjing-yimao-information/ieemoo-ai-gift.git
synced 2025-08-18 21:30:25 +00:00
测试代码
This commit is contained in:
@ -43,7 +43,7 @@ PIN_MEMORY = str(os.getenv("PIN_MEMORY", True)).lower() == "true" # global pin_
|
||||
def img2label_paths(img_paths):
|
||||
"""Define label paths as a function of image paths."""
|
||||
# sa, sb = f"{os.sep}images{os.sep}", f"{os.sep}labels{os.sep}" # /images/, /labels/ substrings
|
||||
sa, sb = f"{os.sep}images{os.sep}", f"{os.sep}labels_class2{os.sep}" # /images/, /labels/ substrings
|
||||
sa, sb = f"{os.sep}images{os.sep}", f"{os.sep}labels{os.sep}" # /images/, /labels/ substrings
|
||||
return [sb.join(x.rsplit(sa, 1)).rsplit(".", 1)[0] + ".txt" for x in img_paths]
|
||||
|
||||
|
||||
|
@ -148,9 +148,9 @@ class DetectionValidator(BaseValidator):
|
||||
pred[:, 5] = 0
|
||||
|
||||
# =======Targets 2 分类======
|
||||
column = pred[:,5]
|
||||
condition2 = (column != 10)
|
||||
pred[:,5][condition2] = 0
|
||||
# column = pred[:,5]
|
||||
# condition2 = (column != 10)
|
||||
# pred[:,5][condition2] = 0
|
||||
# ===========================
|
||||
|
||||
predn = self._prepare_pred(pred, pbatch)
|
||||
|
@ -389,7 +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))
|
||||
# print(">>>>>>>>>>>>>>>>>>> label: {} C: {}".format(label, c))
|
||||
if fp_flag:
|
||||
annotator.box_label(xyxy, label, color=(125, 0, 125)) ##fp iou匹配上,类别错误 紫色框
|
||||
else:
|
||||
|
Reference in New Issue
Block a user