diff --git a/runs/detect/predict49/4.avi b/runs/detect/predict49/4.avi new file mode 100644 index 0000000..e7aed8a Binary files /dev/null and b/runs/detect/predict49/4.avi differ diff --git a/runs/detect/train36/F1_curve.png b/runs/detect/train36/F1_curve.png new file mode 100644 index 0000000..8d55038 Binary files /dev/null and b/runs/detect/train36/F1_curve.png differ diff --git a/runs/detect/train36/PR_curve.png b/runs/detect/train36/PR_curve.png new file mode 100644 index 0000000..9264cae Binary files /dev/null and b/runs/detect/train36/PR_curve.png differ diff --git a/runs/detect/train36/P_curve.png b/runs/detect/train36/P_curve.png new file mode 100644 index 0000000..d7d7558 Binary files /dev/null and b/runs/detect/train36/P_curve.png differ diff --git a/runs/detect/train36/R_curve.png b/runs/detect/train36/R_curve.png new file mode 100644 index 0000000..7dbace1 Binary files /dev/null and b/runs/detect/train36/R_curve.png differ diff --git a/runs/detect/train36/confusion_matrix.png b/runs/detect/train36/confusion_matrix.png new file mode 100644 index 0000000..5a43f5b Binary files /dev/null and b/runs/detect/train36/confusion_matrix.png differ diff --git a/runs/detect/train36/confusion_matrix_normalized.png b/runs/detect/train36/confusion_matrix_normalized.png new file mode 100644 index 0000000..b5ed896 Binary files /dev/null and b/runs/detect/train36/confusion_matrix_normalized.png differ diff --git a/runs/detect/train36/results.csv b/runs/detect/train36/results.csv index dc2a877..c03643d 100644 --- a/runs/detect/train36/results.csv +++ b/runs/detect/train36/results.csv @@ -88,3 +88,14 @@ epoch,time,train/box_loss,train/cls_loss,train/dfl_loss,metrics/precision(B),met 87,602.206,0.44036,0.3477,0.80881,0.97052,0.70044,0.84557,0.62866,1.95032,1.14522,3.08449,0.0002972,0.0002972,0.0002972 88,610.04,0.34605,0.29355,0.82656,0.97052,0.70044,0.84557,0.62866,1.95032,1.14522,3.08449,0.0002774,0.0002774,0.0002774 89,618.104,0.32283,0.27712,0.78311,0.94286,0.70219,0.83861,0.6253,1.94975,1.17272,3.1016,0.0002576,0.0002576,0.0002576 +90,627.396,0.31937,0.2843,0.81442,0.94286,0.70219,0.83861,0.6253,1.94975,1.17272,3.1016,0.0002378,0.0002378,0.0002378 +91,636.531,0.40592,0.3456,0.76639,0.94286,0.70219,0.83861,0.6253,1.94975,1.17272,3.1016,0.000218,0.000218,0.000218 +92,645.424,0.32162,0.25546,0.70747,1,0.70074,0.8321,0.61851,1.94364,1.07547,3.15414,0.0001982,0.0001982,0.0001982 +93,653.162,0.32978,0.27483,0.7712,1,0.70074,0.8321,0.61851,1.94364,1.07547,3.15414,0.0001784,0.0001784,0.0001784 +94,660.746,0.33426,0.27878,0.85918,1,0.70074,0.8321,0.61851,1.94364,1.07547,3.15414,0.0001586,0.0001586,0.0001586 +95,668.458,0.28988,0.27119,0.77331,0.99076,0.68085,0.83074,0.61428,1.94021,0.97339,3.19668,0.0001388,0.0001388,0.0001388 +96,676.066,0.33953,0.28199,0.79338,0.99076,0.68085,0.83074,0.61428,1.94021,0.97339,3.19668,0.000119,0.000119,0.000119 +97,683.81,0.32111,0.27168,0.82616,0.8869,0.7234,0.82786,0.61017,1.92784,0.89589,3.21123,9.92e-05,9.92e-05,9.92e-05 +98,691.47,0.32248,0.28341,0.71945,0.8869,0.7234,0.82786,0.61017,1.92784,0.89589,3.21123,7.94e-05,7.94e-05,7.94e-05 +99,699.162,0.33571,0.27017,0.72974,0.8869,0.7234,0.82786,0.61017,1.92784,0.89589,3.21123,5.96e-05,5.96e-05,5.96e-05 +100,707.196,0.33638,0.25993,0.77413,0.88668,0.7234,0.82078,0.60787,1.92305,0.88185,3.22406,3.98e-05,3.98e-05,3.98e-05 diff --git a/runs/detect/train36/results.png b/runs/detect/train36/results.png new file mode 100644 index 0000000..0f39731 Binary files /dev/null and b/runs/detect/train36/results.png differ diff --git a/runs/detect/train36/train_batch270.jpg b/runs/detect/train36/train_batch270.jpg new file mode 100644 index 0000000..4847a0e Binary files /dev/null and b/runs/detect/train36/train_batch270.jpg differ diff --git a/runs/detect/train36/train_batch271.jpg b/runs/detect/train36/train_batch271.jpg new file mode 100644 index 0000000..e4d4542 Binary files /dev/null and b/runs/detect/train36/train_batch271.jpg differ diff --git a/runs/detect/train36/train_batch272.jpg b/runs/detect/train36/train_batch272.jpg new file mode 100644 index 0000000..5129579 Binary files /dev/null and b/runs/detect/train36/train_batch272.jpg differ diff --git a/runs/detect/train36/val_batch0_labels.jpg b/runs/detect/train36/val_batch0_labels.jpg new file mode 100644 index 0000000..78e0c13 Binary files /dev/null and b/runs/detect/train36/val_batch0_labels.jpg differ diff --git a/runs/detect/train36/val_batch0_pred.jpg b/runs/detect/train36/val_batch0_pred.jpg new file mode 100644 index 0000000..1e0b033 Binary files /dev/null and b/runs/detect/train36/val_batch0_pred.jpg differ diff --git a/runs/detect/train36/val_batch1_labels.jpg b/runs/detect/train36/val_batch1_labels.jpg new file mode 100644 index 0000000..e92d49d Binary files /dev/null and b/runs/detect/train36/val_batch1_labels.jpg differ diff --git a/runs/detect/train36/val_batch1_pred.jpg b/runs/detect/train36/val_batch1_pred.jpg new file mode 100644 index 0000000..10288ba Binary files /dev/null and b/runs/detect/train36/val_batch1_pred.jpg differ diff --git a/runs/detect/train36/val_batch2_labels.jpg b/runs/detect/train36/val_batch2_labels.jpg new file mode 100644 index 0000000..fad7516 Binary files /dev/null and b/runs/detect/train36/val_batch2_labels.jpg differ diff --git a/runs/detect/train36/val_batch2_pred.jpg b/runs/detect/train36/val_batch2_pred.jpg new file mode 100644 index 0000000..bf7a2a0 Binary files /dev/null and b/runs/detect/train36/val_batch2_pred.jpg differ diff --git a/runs/detect/train36/weights/best.pt b/runs/detect/train36/weights/best.pt index 0a878cf..8b5a12e 100644 Binary files a/runs/detect/train36/weights/best.pt and b/runs/detect/train36/weights/best.pt differ diff --git a/runs/detect/train36/weights/last.pt b/runs/detect/train36/weights/last.pt index c130353..19aaa1e 100644 Binary files a/runs/detect/train36/weights/last.pt and b/runs/detect/train36/weights/last.pt differ diff --git a/runs/detect/train362/F1_curve.png b/runs/detect/train362/F1_curve.png new file mode 100644 index 0000000..c29504e Binary files /dev/null and b/runs/detect/train362/F1_curve.png differ diff --git a/runs/detect/train362/PR_curve.png b/runs/detect/train362/PR_curve.png new file mode 100644 index 0000000..55b9e24 Binary files /dev/null and b/runs/detect/train362/PR_curve.png differ diff --git a/runs/detect/train362/P_curve.png b/runs/detect/train362/P_curve.png new file mode 100644 index 0000000..60069f1 Binary files /dev/null and b/runs/detect/train362/P_curve.png differ diff --git a/runs/detect/train362/R_curve.png b/runs/detect/train362/R_curve.png new file mode 100644 index 0000000..fade777 Binary files /dev/null and b/runs/detect/train362/R_curve.png differ diff --git a/runs/detect/train362/confusion_matrix.png b/runs/detect/train362/confusion_matrix.png new file mode 100644 index 0000000..5a43f5b Binary files /dev/null and b/runs/detect/train362/confusion_matrix.png differ diff --git a/runs/detect/train362/confusion_matrix_normalized.png b/runs/detect/train362/confusion_matrix_normalized.png new file mode 100644 index 0000000..b5ed896 Binary files /dev/null and b/runs/detect/train362/confusion_matrix_normalized.png differ diff --git a/runs/detect/train362/val_batch0_labels.jpg b/runs/detect/train362/val_batch0_labels.jpg new file mode 100644 index 0000000..6323831 Binary files /dev/null and b/runs/detect/train362/val_batch0_labels.jpg differ diff --git a/runs/detect/train362/val_batch0_pred.jpg b/runs/detect/train362/val_batch0_pred.jpg new file mode 100644 index 0000000..30f8fca Binary files /dev/null and b/runs/detect/train362/val_batch0_pred.jpg differ diff --git a/runs/detect/train362/val_batch1_labels.jpg b/runs/detect/train362/val_batch1_labels.jpg new file mode 100644 index 0000000..88a3ea2 Binary files /dev/null and b/runs/detect/train362/val_batch1_labels.jpg differ diff --git a/runs/detect/train362/val_batch1_pred.jpg b/runs/detect/train362/val_batch1_pred.jpg new file mode 100644 index 0000000..6ce1ab5 Binary files /dev/null and b/runs/detect/train362/val_batch1_pred.jpg differ diff --git a/runs/detect/train362/val_batch2_labels.jpg b/runs/detect/train362/val_batch2_labels.jpg new file mode 100644 index 0000000..1443d38 Binary files /dev/null and b/runs/detect/train362/val_batch2_labels.jpg differ diff --git a/runs/detect/train362/val_batch2_pred.jpg b/runs/detect/train362/val_batch2_pred.jpg new file mode 100644 index 0000000..120b4a8 Binary files /dev/null and b/runs/detect/train362/val_batch2_pred.jpg differ diff --git a/src/pic.py b/src/pic.py index bb2f44f..9495b5b 100644 --- a/src/pic.py +++ b/src/pic.py @@ -20,7 +20,7 @@ while cap.isOpened(): detected_object = frame[y1:y2, x1:x2] save_path = os.path.join('detected_objects', f'detected_object_{target_class}_{cap.get(cv2.CAP_PROP_POS_FRAMES)}.jpg') cv2.imwrite(save_path, detected_object) - print(f"截图保存至:{save_path}") + print(f"保存:{save_path}") annotated_frame = results[0].plot() cv2.imshow('YOLOv8 Detection', annotated_frame) if cv2.waitKey(1) & 0xFF == ord(' '): diff --git a/src/show.py b/src/show.py new file mode 100644 index 0000000..561f4a0 --- /dev/null +++ b/src/show.py @@ -0,0 +1,42 @@ +import cv2 +from PIL import Image +import os + +folder_path = 'C:/workspace/le-yolo/data/images/train' +for filename in os.listdir(folder_path): + if filename.lower().endswith(('.png', '.jpg', '.jpeg', '.bmp', '.gif')): + img_path = os.path.join(folder_path, filename) + img = cv2.imread(img_path) + height, width, _ = img.shape + + +file_path = 'C:/workspace/le-yolo/data/labels/aut' +txt_files = os.listdir(file_path) +for txt_file in txt_files: + file_path = os.path.join(folder_path, txt_file) + with open(file_path, "r", ) as f: + lines = f.readlines() + for line in lines: + # 解析标注信息 + parts = line.strip().split() + category_id = int(parts[0]) + category_name = 'person' + x_center = float(parts[1]) + y_center = float(parts[2]) + w = float(parts[3]) + h = float(parts[4]) + # 转换为绝对坐标 + x1 = int((x_center - w / 2) * width) + y1 = int((y_center - h / 2) * height) + x2 = int((x_center + w / 2) * width) + y2 = int((y_center + h / 2) * height) + # 在图片上绘制矩形框 + cv2.rectangle(img, (x1, y1), (x2, y2), (255, 0, 0), 2) + # 在图片上绘制标注类别 + cv2.putText(img, category_name, (x1, y1 - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.9, (255, 0, 0), 2) + +cv2.imshow('Annotated Image', img) +cv2.waitKey(0) +cv2.destroyAllWindows() + +cv2.imwrite('annotated_image.jpg', img) \ No newline at end of file diff --git a/src/test.py b/src/test.py index 3ca46c7..5638631 100644 --- a/src/test.py +++ b/src/test.py @@ -1,3 +1,3 @@ from ultralytics import YOLO -model = YOLO(r"C:\workspace\le-yolo\runs\detect\train35\weights\best.pt") +model = YOLO(r"C:\workspace\le-yolo\runs\detect\train36\weights\best.pt") results = model.predict("../res/4.mp4", show=True, save=True)