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 |
μ§μ κ³μ° μμ
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:
-
Ultralytics 리ν¬μ§ν 리λ₯Ό 볡μ νκ³ λλ ν λ¦¬λ‘ μ΄λν©λλ€:
-
μ§μ μΉ΄μ΄ν μ€ν¬λ¦½νΈλ₯Ό μ€νν©λλ€:
λ λ§μ μ΅μ μ λ³΄λ €λ©΄ μ§μ μΉ΄μ΄νΈ μ€ν μΉμ μ μ°Έμ‘°νμΈμ.
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:
- μ맀μ : μ λμΈκ΅¬ λΆμμ μν μ¬λ μ κ³μ°
- μμ₯ 거리: κ΅°μ€ λ°λ κ΄λ¦¬.
μ€μ μ μ© μ¬λ‘ μΉμ μμ λ λ§μ μ¬λ‘λ₯Ό μ΄ν΄λ³΄μΈμ.