[CF]提交文件

This commit is contained in:
songbingle 2025-06-06 14:00:10 +08:00
parent 48fde32a15
commit 51afd06383
35 changed files with 55 additions and 2 deletions

BIN
runs/detect/predict49/4.avi Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

View File

@ -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 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 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 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

1 epoch time train/box_loss train/cls_loss train/dfl_loss metrics/precision(B) metrics/recall(B) metrics/mAP50(B) metrics/mAP50-95(B) val/box_loss val/cls_loss val/dfl_loss lr/pg0 lr/pg1 lr/pg2
88 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
89 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
90 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
91 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
92 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
93 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
94 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
95 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
96 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
97 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
98 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
99 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
100 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
101 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

View File

@ -20,7 +20,7 @@ while cap.isOpened():
detected_object = frame[y1:y2, x1:x2] 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') 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) cv2.imwrite(save_path, detected_object)
print(f"截图保存{save_path}") print(f"保存:{save_path}")
annotated_frame = results[0].plot() annotated_frame = results[0].plot()
cv2.imshow('YOLOv8 Detection', annotated_frame) cv2.imshow('YOLOv8 Detection', annotated_frame)
if cv2.waitKey(1) & 0xFF == ord(' '): if cv2.waitKey(1) & 0xFF == ord(' '):

42
src/show.py Normal file
View File

@ -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)

View File

@ -1,3 +1,3 @@
from ultralytics import YOLO 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) results = model.predict("../res/4.mp4", show=True, save=True)