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

Ultralytics YOLO πŸš€μ„ μ‚¬μš©ν•˜μ—¬ λ‹€λ₯Έ μ˜μ—­μ—μ„œ 개체 수 κ³„μ‚°ν•˜κΈ°

μ˜μ—­ λ‚΄ 였브젝트 μΉ΄μš΄νŒ…μ΄λž€ λ¬΄μ—‡μΈκ°€μš”?

Object counting in regions with Ultralytics YOLO11 involves precisely determining the number of objects within specified areas using advanced computer vision. This approach is valuable for optimizing processes, enhancing security, and improving efficiency in various applications.



Watch: Ultralytics YOLO11 | Ultralytics μ†”λ£¨μ…˜ πŸš€μ„ μ‚¬μš©ν•œ λ‹€μ–‘ν•œ μ˜μ—­μ—μ„œμ˜ 개체 수 계산

지역 λ‚΄ 였브젝트 μΉ΄μš΄νŒ…μ˜ μž₯점은?

  • 정밀도와 μ •ν™•μ„±: κ³ κΈ‰ 컴퓨터 λΉ„μ „μœΌλ‘œ 개체λ₯Ό μ„ΈλŠ” μ˜μ—­μ—μ„œλŠ” μ •λ°€ν•˜κ³  μ •ν™•ν•œ 개수 계산이 κ°€λŠ₯ν•˜λ―€λ‘œ μˆ˜λ™ 계산과 κ΄€λ ¨λœ 였λ₯˜λ₯Ό μ΅œμ†Œν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
  • νš¨μœ¨μ„± κ°œμ„ : μžλ™ν™”λœ 개체 μΉ΄μš΄νŒ…μ€ 운영 νš¨μœ¨μ„±μ„ ν–₯μƒμ‹œμΌœ λ‹€μ–‘ν•œ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ—μ„œ μ‹€μ‹œκ°„ κ²°κ³Όλ₯Ό μ œκ³΅ν•˜κ³  ν”„λ‘œμ„ΈμŠ€λ₯Ό κ°„μ†Œν™”ν•©λ‹ˆλ‹€.
  • λ‹€λͺ©μ μ„± 및 적용: 지역 λ‚΄ 객체 κ³„μˆ˜μ˜ λ‹€μš©λ„μ„± 덕뢄에 제쑰 및 κ°μ‹œμ—μ„œ ꡐ톡 λͺ¨λ‹ˆν„°λ§μ— 이λ₯΄κΈ°κΉŒμ§€ λ‹€μ–‘ν•œ μ˜μ—­μ— μ μš©ν•  수 μžˆμ–΄ κ΄‘λ²”μœ„ν•œ ν™œμš©λ„μ™€ νš¨μœ¨μ„±μ„ μ œκ³΅ν•©λ‹ˆλ‹€.

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

λ¦¬ν…ŒμΌ λ§ˆμΌ“ 슀트리트
People Counting in Different Region using Ultralytics YOLO11 Crowd Counting in Different Region using Ultralytics YOLO11
People Counting in Different Region using Ultralytics YOLO11 Crowd Counting in Different Region using Ultralytics YOLO11

지역 계산 μ˜ˆμ‹œ

import cv2

from ultralytics import solutions

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

# Define region points
# region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360)] # Pass region as list

# pass region as dictionary
region_points = {
    "region-01": [(50, 50), (250, 50), (250, 250), (50, 250)],
    "region-02": [(640, 640), (780, 640), (780, 720), (640, 720)],
}

# Video writer
video_writer = cv2.VideoWriter("region_counting.avi", cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))

# Init RegionCounter
region = solutions.RegionCounter(
    show=True,
    region=region_points,
    model="yolo11n.pt",
)

# Process video
while cap.isOpened():
    success, im0 = cap.read()
    if not success:
        print("Video frame is empty or video processing has been successfully completed.")
        break
    im0 = region.count(im0)
    video_writer.write(im0)

cap.release()
video_writer.release()
cv2.destroyAllWindows()

Ultralytics μ½”λ“œ μ˜ˆμ‹œ

Ultralytics 지역 μΉ΄μš΄νŒ… λͺ¨λ“ˆμ€ 예제 μ„Ήμ…˜μ—μ„œ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이 예제λ₯Ό μ‚΄νŽ΄λ³΄κ³  μ½”λ“œλ₯Ό μ‚¬μš©μž μ§€μ •ν•˜μ—¬ νŠΉμ • μ‚¬μš© 사둀에 맞게 μˆ˜μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

인수 RegionCounter

λ‹€μŒμ€ ν‘œμž…λ‹ˆλ‹€. RegionCounter 인수λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€:

이름 μœ ν˜• κΈ°λ³Έκ°’ μ„€λͺ…
model str None Ultralytics YOLO λͺ¨λΈ 파일 경둜
region list [(20, 400), (1260, 400)] 계산 μ˜μ—­μ„ μ •μ˜ν•˜λŠ” 포인트 λͺ©λ‘μž…λ‹ˆλ‹€.
line_width int 2 경계 μƒμžμ˜ μ„  λ‘κ»˜μž…λ‹ˆλ‹€.
show bool False λΉ„λ””μ˜€ 슀트림 ν‘œμ‹œ μ—¬λΆ€λ₯Ό μ œμ–΄ν•˜λŠ” ν”Œλž˜κ·Έμž…λ‹ˆλ‹€.

자주 λ¬»λŠ” 질문

What is object counting in specified regions using Ultralytics YOLO11?

Object counting in specified regions with Ultralytics YOLO11 involves detecting and tallying the number of objects within defined areas using advanced computer vision. This precise method enhances efficiency and accuracy across various applications like manufacturing, surveillance, and traffic monitoring.

How do I run the region based object counting script with Ultralytics YOLO11?

Follow these steps to run object counting in Ultralytics YOLO11:

  1. Ultralytics 리포지토리λ₯Ό λ³΅μ œν•˜κ³  λ””λ ‰ν† λ¦¬λ‘œ μ΄λ™ν•©λ‹ˆλ‹€:

    git clone https://github.com/ultralytics/ultralytics
    cd ultralytics/examples/YOLOv8-Region-Counter
    
  2. 지역 μΉ΄μš΄νŒ… 슀크립트λ₯Ό μ‹€ν–‰ν•©λ‹ˆλ‹€:

    python yolov8_region_counter.py --source "path/to/video.mp4" --save-img
    

더 λ§Žμ€ μ˜΅μ…˜μ„ 보렀면 지역 카운트 μ‹€ν–‰ μ„Ήμ…˜μ„ μ°Έμ‘°ν•˜μ„Έμš”.

Why should I use Ultralytics YOLO11 for object counting in regions?

Using Ultralytics YOLO11 for object counting in regions offers several advantages:

  • 정밀도와 μ •ν™•μ„±: μˆ˜λ™ κ³„μ‚°μ—μ„œ ν”νžˆ λ³Ό 수 μžˆλŠ” 였λ₯˜λ₯Ό μ΅œμ†Œν™”ν•©λ‹ˆλ‹€.
  • νš¨μœ¨μ„± κ°œμ„ : μ‹€μ‹œκ°„ κ²°κ³Όλ₯Ό μ œκ³΅ν•˜κ³  ν”„λ‘œμ„ΈμŠ€λ₯Ό κ°„μ†Œν™”ν•©λ‹ˆλ‹€.
  • λ‹€λͺ©μ μ„± 및 ν™œμš©λ„: λ‹€μ–‘ν•œ 도메인에 μ μš©ν•˜μ—¬ ν™œμš©λ„λ₯Ό λ†’μž…λ‹ˆλ‹€.

μž₯점 μ„Ήμ…˜μ—μ„œ 더 μžμ„Έν•œ ν˜œνƒμ„ μ‚΄νŽ΄λ³΄μ„Έμš”.

μ§€μ—­μ—μ„œ 였브젝트 μΉ΄μš΄νŒ…μ˜ μ‹€μ œ 적용 μ‚¬λ‘€μ—λŠ” μ–΄λ–€ 것이 μžˆλ‚˜μš”?

Object counting with Ultralytics YOLO11 can be applied to numerous real-world scenarios:

  • μ†Œλ§€μ—…: μœ λ™μΈκ΅¬ 뢄석을 μœ„ν•œ μ‚¬λžŒ 수 계산
  • μ‹œμž₯ 거리: ꡰ쀑 밀도 관리.

μ‹€μ œ 적용 사둀 μ„Ήμ…˜μ—μ„œ 더 λ§Žμ€ 사둀λ₯Ό μ‚΄νŽ΄λ³΄μ„Έμš”.

πŸ“…1 λ…„ μ „ 생성됨 ✏️ μ—…λ°μ΄νŠΈλ¨ 17 일 μ „

λŒ“κΈ€