[CF]提交文件

This commit is contained in:
songbingle 2025-06-09 17:59:54 +08:00
parent 4ebfdaf313
commit 1631a82943
41 changed files with 22 additions and 28 deletions

BIN
data/images/pic/test_0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 KiB

BIN
data/images/pic/test_10.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 KiB

BIN
data/images/pic/test_20.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 312 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

BIN
data/images/pic/test_30.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

BIN
data/images/pic/test_40.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 KiB

BIN
data/images/pic/test_50.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 KiB

BIN
data/images/pic/test_60.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

BIN
data/images/pic/test_70.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 376 KiB

BIN
data/images/pic/test_80.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 KiB

BIN
data/images/pic/test_90.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

BIN
runs/pose/predict3/test.avi Normal file

Binary file not shown.

View File

@ -9,16 +9,18 @@ label = input("请输入标签:")
# model = YOLO("yolov8n.pt")
model = YOLO(r"C:/workspace/le-yolo/runs/detect/train42/weights/best.pt")
video_path = 'C:/workspace/le-yolo/res/3.mp4'
video_to_pic(video_path)
file_path = 'C:/workspace/le-yolo/data/images/test/'
for filename in os.listdir(file_path):
img = cv2.imread(filename)
results = model(img)
# img_path = '../data/images/train/3fb0f9ac-t2_0.jpg'
# img = cv2.imread(img_path)
# results = model(img)
video_path = 'C:/workspace/le-yolo/res/2.mp4'
cap = cv2.VideoCapture(video_path)
if not cap.isOpened():
print("无法打开视频")
exit()
while True:
# 读取一帧
ret, frame = cap.read()
# 如果读取失败,退出循环
if not ret:
break
results = model(frame)
detections = results[0].boxes
boxes = detections.xyxy.cpu().numpy()
x1_min = int(np.min(boxes[:, 0]))
@ -26,15 +28,17 @@ for filename in os.listdir(file_path):
x2_max = int(np.max(boxes[:, 2]))
y2_max = int(np.max(boxes[:, 3]))
whole_image_box = np.array([[x1_min, y1_min, x2_max, y2_max]])
# 可视化
original_boxes = results[0].boxes.xyxy.tolist()
new_box = whole_image_box.tolist()
combined_boxes = original_boxes + new_box
combined_boxes = np.array(combined_boxes)
annotated_image = results[0].plot()
cv2.imshow(label, annotated_image)
cv2.waitKey(0)
cv2.destroyAllWindows()
if cv2.waitKey(25) & 0xFF == ord(' '):
break
cap.release()
cv2.destroyAllWindows()

View File

@ -1,11 +0,0 @@
path: /home/le/le-yolo/data
train: images/train
val: images/val
test: images/test
# 关键点坐标 13个关键点每个关键点有3个坐标[x,y,v]
kpt_shape: [13, 3]
# 翻转索引
flip_idx: [5, 4, 3, 2, 1, 0, 8, 9, 6, 7]
names: [ 'person' ]

View File

@ -10,7 +10,8 @@ cap = cv2.VideoCapture(vide_opath)
# cap = cv2.VideoCapture(0) # 打开摄像头
# 连接顺序 0,1) 0-1
# 17个关键点 鼻子 眼睛 耳朵 肩膀 手肘 手腕 胯 膝盖 脚腕
# 17个关键点
# 鼻子 [眼睛 耳朵 肩膀 手肘 手腕 胯 膝盖 脚腕]
connections = [
(3, 1), (1, 0), (0, 2), (2, 4), (1, 2), (4, 6), (3, 5),
(5, 6), (5, 7), (7, 9),

View File

@ -1,5 +1,5 @@
import cv2
# 视频抽帧 并保存
# 视频抽帧 并保存 video = cv2.VideoCapture(0) # 摄像头
def video_to_pic(vide_opath):
# vide_opath = 'C:/workspace/le-yolo/res/6.mp4'
video = cv2.VideoCapture(vide_opath)
@ -9,7 +9,7 @@ def video_to_pic(vide_opath):
else:
ret = False
timeF = 10 # 帧数
filepath = 'C:/pic/test_' # 保存图片的路径
filepath = 'C:/workspace/le-yolo/data/images/pic/test_' # 保存图片的路径
while ret:
ret, frame = video.read()
if num % timeF == 0: