μ½˜ν…μΈ λ‘œ κ±΄λ„ˆλ›°κΈ°

Ultralytics YOLOv8 πŸš€μ„ μ‚¬μš©ν•œ μš΄λ™ λͺ¨λ‹ˆν„°λ§

μžμ„Έ 좔정을 ν†΅ν•œ μš΄λ™ λͺ¨λ‹ˆν„°λ§ Ultralytics YOLOv8 λŠ” μ‹ μ²΄μ˜ μ£Όμš” λžœλ“œλ§ˆν¬μ™€ κ΄€μ ˆμ„ μ‹€μ‹œκ°„μœΌλ‘œ μ •ν™•ν•˜κ²Œ μΆ”μ ν•˜μ—¬ μš΄λ™ 평가λ₯Ό ν–₯μƒμ‹œν‚΅λ‹ˆλ‹€. 이 κΈ°μˆ μ€ μš΄λ™ μžμ„Έμ— λŒ€ν•œ 즉각적인 ν”Όλ“œλ°±μ„ μ œκ³΅ν•˜κ³ , μš΄λ™ 루틴을 μΆ”μ ν•˜λ©°, μ„±κ³Ό μ§€ν‘œλ₯Ό μΈ‘μ •ν•˜μ—¬ μ‚¬μš©μžμ™€ νŠΈλ ˆμ΄λ„ˆ λͺ¨λ‘λ₯Ό μœ„ν•΄ νŠΈλ ˆμ΄λ‹ μ„Έμ…˜μ„ μ΅œμ ν™”ν•©λ‹ˆλ‹€.



Watch: Ultralytics YOLOv8 | ν‘Έμ‹œμ—…, ν’€μ—…, 볡근 μš΄λ™μ„ μ΄μš©ν•œ μš΄λ™ λͺ¨λ‹ˆν„°λ§

μš΄λ™ λͺ¨λ‹ˆν„°λ§μ˜ μž₯점은?

  • μ΅œμ ν™”λœ 퍼포먼슀: 더 λ‚˜μ€ κ²°κ³Όλ₯Ό μœ„ν•œ λͺ¨λ‹ˆν„°λ§ 데이터에 κΈ°λ°˜ν•œ λ§žμΆ€ν˜• μš΄λ™.
  • λͺ©ν‘œ 달성: μΈ‘μ • κ°€λŠ₯ν•œ 진행 상황을 μœ„ν•΄ ν”ΌνŠΈλ‹ˆμŠ€ λͺ©ν‘œλ₯Ό μΆ”μ ν•˜κ³  μ‘°μ •ν•˜μ„Έμš”.
  • κ°œμΈν™”: κ°œμΈλ³„ 데이터에 κΈ°λ°˜ν•œ λ§žμΆ€ν˜• μš΄λ™ κ³„νšμœΌλ‘œ μš΄λ™ 효과λ₯Ό 높일 수 μžˆμŠ΅λ‹ˆλ‹€.
  • 건강 인식: 건강 문제 λ˜λŠ” κ³Όλ„ν•œ ν›ˆλ ¨μ„ λ‚˜νƒ€λ‚΄λŠ” νŒ¨ν„΄μ„ 쑰기에 κ°μ§€ν•©λ‹ˆλ‹€.
  • 정보에 κΈ°λ°˜ν•œ μ˜μ‚¬ κ²°μ •: 루틴을 μ‘°μ •ν•˜κ³  ν˜„μ‹€μ μΈ λͺ©ν‘œλ₯Ό μ„€μ •ν•˜κΈ° μœ„ν•œ 데이터 기반 μ˜μ‚¬ κ²°μ •.

μ‹€μ œ μ• ν”Œλ¦¬μΌ€μ΄μ…˜

μš΄λ™ λͺ¨λ‹ˆν„°λ§ μš΄λ™ λͺ¨λ‹ˆν„°λ§
ν‘Έμ‹œμ—… μΉ΄μš΄νŒ… ν’€μ—… μΉ΄μš΄νŒ…
ν‘Έμ‹œμ—… μΉ΄μš΄νŒ… ν’€μ—… μΉ΄μš΄νŒ…

μš΄λ™ λͺ¨λ‹ˆν„°λ§ μ˜ˆμ‹œ

import cv2

from ultralytics import YOLO, solutions

model = YOLO("yolov8n-pose.pt")
cap = cv2.VideoCapture("path/to/video/file.mp4")
assert cap.isOpened(), "Error reading video file"
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))

gym_object = solutions.AIGym(
    line_thickness=2,
    view_img=True,
    pose_type="pushup",
    kpts_to_check=[6, 8, 10],
)

frame_count = 0
while cap.isOpened():
    success, im0 = cap.read()
    if not success:
        print("Video frame is empty or video processing has been successfully completed.")
        break
    frame_count += 1
    results = model.track(im0, verbose=False)  # Tracking recommended
    # results = model.predict(im0)  # Prediction also supported
    im0 = gym_object.start_counting(im0, results, frame_count)

cv2.destroyAllWindows()
import cv2

from ultralytics import YOLO, solutions

model = YOLO("yolov8n-pose.pt")
cap = cv2.VideoCapture("path/to/video/file.mp4")
assert cap.isOpened(), "Error reading video file"
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))

video_writer = cv2.VideoWriter("workouts.avi", cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))

gym_object = solutions.AIGym(
    line_thickness=2,
    view_img=True,
    pose_type="pushup",
    kpts_to_check=[6, 8, 10],
)

frame_count = 0
while cap.isOpened():
    success, im0 = cap.read()
    if not success:
        print("Video frame is empty or video processing has been successfully completed.")
        break
    frame_count += 1
    results = model.track(im0, verbose=False)  # Tracking recommended
    # results = model.predict(im0)  # Prediction also supported
    im0 = gym_object.start_counting(im0, results, frame_count)
    video_writer.write(im0)

cv2.destroyAllWindows()
video_writer.release()
지원

"ν‘Έμ‹œμ—…", "ν’€μ—…" 및 "볡근 μš΄λ™" 지원

ν‚€ν¬μΈνŠΈ 맡

ν‚€ν¬μΈνŠΈ μ£Όλ¬Έ Ultralytics YOLOv8  포즈

인수 AIGym

이름 μœ ν˜• κΈ°λ³Έκ°’ μ„€λͺ…
kpts_to_check list None νŠΉμ • μš΄λ™μ„ κ³„μ‚°ν•˜κΈ° μœ„ν•œ μ„Έ 가지 ν‚€ν¬μΈνŠΈ 인덱슀 λͺ©λ‘κ³Ό ν‚€ν¬μΈνŠΈ 맡
line_thickness int 2 그렀진 μ„ μ˜ λ‘κ»˜μž…λ‹ˆλ‹€.
view_img bool False ν”Œλž˜κ·Έλ₯Ό ν΄λ¦­ν•˜μ—¬ 이미지λ₯Ό ν‘œμ‹œν•©λ‹ˆλ‹€.
pose_up_angle float 145.0 'μœ„λ‘œ' ν¬μ¦ˆμ— λŒ€ν•œ 각도 μž„κ³„κ°’μž…λ‹ˆλ‹€.
pose_down_angle float 90.0 'μ•„λž˜' ν¬μ¦ˆμ— λŒ€ν•œ 각도 μž„κ³„κ°’μž…λ‹ˆλ‹€.
pose_type str pullup 감지할 포즈 μœ ν˜•('pullup', pushup, abworkout, squat).

인수 model.predict

이름 μœ ν˜• κΈ°λ³Έκ°’ μ„€λͺ…
source str 'ultralytics/assets' 이미지 λ˜λŠ” λΉ„λ””μ˜€μ˜ μ†ŒμŠ€ 디렉토리
conf float 0.25 탐지λ₯Ό μœ„ν•œ 객체 μ‹ λ’° μž„κ³„κ°’
iou float 0.7 NMS에 λŒ€ν•œ ꡐ차점 μ˜€λ²„ μœ λ‹ˆμ˜¨(IoU) μž„κ³„κ°’
imgsz int or tuple 640 이미지 크기λ₯Ό 슀칼라 λ˜λŠ” (h, w) λͺ©λ‘(예: (640, 480))으둜 μ§€μ •ν•©λ‹ˆλ‹€.
half bool False λ°˜μ •λ°€λ„ μ‚¬μš©(FP16)
device None or str None μ‹€ν–‰ν•  λ””λ°”μ΄μŠ€(예: CUDA λ””λ°”μ΄μŠ€=0/1/2/3 λ˜λŠ” λ””λ°”μ΄μŠ€=CPU)
max_det int 300 이미지당 μ΅œλŒ€ 탐지 횟수
vid_stride bool False λΉ„λ””μ˜€ ν”„λ ˆμž„ 속도 보폭
stream_buffer bool False λͺ¨λ“  슀트리밍 ν”„λ ˆμž„μ„ λ²„νΌλ§ν•˜κ±°λ‚˜(True) κ°€μž₯ 졜근 ν”„λ ˆμž„μ„ λ°˜ν™˜ν•©λ‹ˆλ‹€(False).
visualize bool False λͺ¨λΈ κΈ°λŠ₯ μ‹œκ°ν™”
augment bool False 예츑 μ†ŒμŠ€μ— 이미지 증강 적용
agnostic_nms bool False ν΄λž˜μŠ€μ— ꡬ애받지 μ•ŠλŠ” NMS
classes list[int] None ν΄λž˜μŠ€λ³„λ‘œ κ²°κ³Όλ₯Ό ν•„ν„°λ§ν•©λ‹ˆλ‹€(예: classes=0 λ˜λŠ” classes=[0,2,3]).
retina_masks bool False 고해상도 μ„ΈλΆ„ν™” 마슀크 μ‚¬μš©
embed list[int] None 주어진 λ ˆμ΄μ–΄μ—μ„œ ν”Όμ²˜ 벑터/μž„λ² λ”©μ„ λ°˜ν™˜ν•©λ‹ˆλ‹€.

인수 model.track

이름 μœ ν˜• κΈ°λ³Έκ°’ μ„€λͺ…
source im0 None 이미지 λ˜λŠ” λΉ„λ””μ˜€μ˜ μ†ŒμŠ€ 디렉토리
persist bool False ν”„λ ˆμž„ κ°„ νŠΈλž™ 지속
tracker str botsort.yaml 좔적 방법 'λ°”μ΄νŠΈνŠΈλž™' λ˜λŠ” 'λ΄‡μ†ŒνŠΈ'
conf float 0.3 μ‹ λ’° μž„κ³„κ°’
iou float 0.5 IOU μž„κ³„κ°’
classes list None ν΄λž˜μŠ€λ³„λ‘œ κ²°κ³Όλ₯Ό ν•„ν„°λ§ν•©λ‹ˆλ‹€(예: classes=0 λ˜λŠ” classes=[0,2,3]).
verbose bool True 개체 좔적 κ²°κ³Ό ν‘œμ‹œ


Created 2023-12-02, Updated 2024-06-10
Authors: glenn-jocher (10), IvorZhu331 (1), RizwanMunawar (4)

λŒ“κΈ€