์ฝ˜ํ…์ธ ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ

๊ณ ๊ธ‰ ๋ฐ์ดํ„ฐ ์‹œ๊ฐํ™”: Ultralytics YOLO11 ๐Ÿš€์„ ์‚ฌ์šฉํ•œ ํžˆํŠธ ๋งต

ํžˆํŠธ๋งต ์†Œ๊ฐœ

๋กœ ์ƒ์„ฑ๋œ ํžˆํŠธ๋งต์€ Ultralytics YOLO11 ๋กœ ์ƒ์„ฑ๋œ ํžˆํŠธ๋งต์€ ๋ณต์žกํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ์ƒ์ƒํ•œ ์ƒ‰์ƒ์œผ๋กœ ๊ตฌ๋ถ„๋œ ๋งคํŠธ๋ฆญ์Šค๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ์ด ์‹œ๊ฐ์  ๋„๊ตฌ๋Š” ๋‹ค์–‘ํ•œ ์ƒ‰์ƒ ์ŠคํŽ™ํŠธ๋Ÿผ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋‹ค์–‘ํ•œ ๋ฐ์ดํ„ฐ ๊ฐ’์„ ๋‚˜ํƒ€๋‚ด๋ฉฐ, ๋”ฐ๋œปํ•œ ์ƒ‰์กฐ๋Š” ๋” ๋†’์€ ๊ฐ•๋„๋ฅผ, ์ฐจ๊ฐ€์šด ์ƒ‰์กฐ๋Š” ๋” ๋‚ฎ์€ ๊ฐ’์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. ํžˆํŠธ๋งต์€ ๋ณต์žกํ•œ ๋ฐ์ดํ„ฐ ํŒจํ„ด, ์ƒ๊ด€๊ด€๊ณ„, ์ด์ƒ ์ง•ํ›„๋ฅผ ์‹œ๊ฐํ™”ํ•˜๋Š” ๋ฐ ํƒ์›”ํ•˜๋ฉฐ, ๋‹ค์–‘ํ•œ ์˜์—ญ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ํ•ด์„ํ•˜๋Š” ๋ฐ ์ ‘๊ทผํ•˜๊ธฐ ์‰ฝ๊ณ  ๋งค๋ ฅ์ ์ธ ์ ‘๊ทผ ๋ฐฉ์‹์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.



Watch: ํžˆํŠธ๋งต์„ ์‚ฌ์šฉํ•œ Ultralytics YOLO11

๋ฐ์ดํ„ฐ ๋ถ„์„์— ํžˆํŠธ๋งต์„ ์„ ํƒํ•˜๋Š” ์ด์œ ๋Š” ๋ฌด์—‡์ธ๊ฐ€์š”?

  • ์ง๊ด€์ ์ธ ๋ฐ์ดํ„ฐ ๋ถ„ํฌ ์‹œ๊ฐํ™”: ํžˆํŠธ๋งต์€ ๋ณต์žกํ•œ ๋ฐ์ดํ„ฐ ์ง‘ํ•ฉ์„ ์ดํ•ดํ•˜๊ธฐ ์‰ฌ์šด ์‹œ๊ฐ์  ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜ํ•˜์—ฌ ๋ฐ์ดํ„ฐ ์ง‘์ค‘๋„์™€ ๋ถ„ํฌ์— ๋Œ€ํ•œ ์ดํ•ด๋ฅผ ๊ฐ„์†Œํ™”ํ•ฉ๋‹ˆ๋‹ค.
  • ํšจ์œจ์ ์ธ ํŒจํ„ด ํƒ์ง€: ๋ฐ์ดํ„ฐ๋ฅผ ํžˆํŠธ๋งต ํ˜•์‹์œผ๋กœ ์‹œ๊ฐํ™”ํ•˜๋ฉด ์ถ”์„ธ, ๊ตฐ์ง‘, ์ด์ƒ๊ฐ’์„ ๋” ์‰ฝ๊ฒŒ ๋ฐœ๊ฒฌํ•  ์ˆ˜ ์žˆ์–ด ๋ถ„์„๊ณผ ์ธ์‚ฌ์ดํŠธ๋ฅผ ๋” ๋น ๋ฅด๊ฒŒ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ํ–ฅ์ƒ๋œ ๊ณต๊ฐ„ ๋ถ„์„ ๋ฐ ์˜์‚ฌ ๊ฒฐ์ •: ํžˆํŠธ๋งต์€ ๊ณต๊ฐ„ ๊ด€๊ณ„๋ฅผ ์„ค๋ช…ํ•˜๋Š” ๋ฐ ์œ ์šฉํ•˜๋ฉฐ ๋น„์ฆˆ๋‹ˆ์Šค ์ธํ…”๋ฆฌ์ „์Šค, ํ™˜๊ฒฝ ์—ฐ๊ตฌ, ๋„์‹œ ๊ณ„ํš๊ณผ ๊ฐ™์€ ๋ถ„์•ผ์˜ ์˜์‚ฌ ๊ฒฐ์ • ํ”„๋กœ์„ธ์Šค๋ฅผ ๋•์Šต๋‹ˆ๋‹ค.

์‹ค์ œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜

๊ตํ†ตํŽธ ๋ฆฌํ…Œ์ผ
Ultralytics YOLO11 ์šด์†ก ํžˆํŠธ๋งต Ultralytics YOLO11 ๋ฆฌํ…Œ์ผ ํžˆํŠธ๋งต
Ultralytics YOLO11 ์šด์†ก ํžˆํŠธ๋งต Ultralytics YOLO11 ๋ฆฌํ…Œ์ผ ํžˆํŠธ๋งต

Ultralytics YOLO11 ์˜ˆ์ œ๋ฅผ ์‚ฌ์šฉํ•œ ํžˆํŠธ๋งต

# Run a heatmap example
yolo solutions heatmap show=True

# Pass a source video
yolo solutions heatmap source="path/to/video/file.mp4"

# Pass a custom colormap
yolo solutions heatmap colormap=cv2.COLORMAP_INFERNO

# Heatmaps + object counting
yolo solutions heatmap region=[(20, 400), (1080, 400), (1080, 360), (20, 360)]
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))

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

# In case you want to apply object counting + heatmaps, you can pass region points.
# region_points = [(20, 400), (1080, 400)]  # Define line points
# region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360)]  # Define region points
# region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360), (20, 400)]  # Define polygon points

# Init heatmap
heatmap = solutions.Heatmap(
    show=True,  # Display the output
    model="yolo11n.pt",  # Path to the YOLO11 model file
    colormap=cv2.COLORMAP_PARULA,  # Colormap of heatmap
    # region=region_points,  # If you want to do object counting with heatmaps, you can pass region_points
    # classes=[0, 2],  # If you want to generate heatmap for specific classes i.e person and car.
    # show_in=True,  # Display in counts
    # show_out=True,  # Display out counts
    # line_width=2,  # Adjust the line width for bounding boxes and text display
)

# 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 = heatmap.generate_heatmap(im0)
    video_writer.write(im0)

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

์ธ์ˆ˜ Heatmap()

์ด๋ฆ„ ์œ ํ˜• ๊ธฐ๋ณธ๊ฐ’ ์„ค๋ช…
model str None Ultralytics YOLO ๋ชจ๋ธ ํŒŒ์ผ ๊ฒฝ๋กœ
colormap int cv2.COLORMAP_JET ํžˆํŠธ๋งต์— ์‚ฌ์šฉํ•  ์ปฌ๋Ÿฌ๋งต์ž…๋‹ˆ๋‹ค.
show bool False ์ด๋ฏธ์ง€๋ฅผ ํžˆํŠธ๋งต ์˜ค๋ฒ„๋ ˆ์ด์™€ ํ•จ๊ป˜ ํ‘œ์‹œํ• ์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค.
show_in bool True ์˜์—ญ์— ๋“ค์–ด์˜ค๋Š” ๊ฐ์ฒด ์ˆ˜๋ฅผ ํ‘œ์‹œํ• ์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค.
show_out bool True ์˜์—ญ์„ ๋ฒ—์–ด๋‚˜๋Š” ๊ฐ์ฒด ์ˆ˜๋ฅผ ํ‘œ์‹œํ• ์ง€ ์—ฌ๋ถ€์ž…๋‹ˆ๋‹ค.
region list None ์นด์šดํŠธ ์˜์—ญ์„ ์ •์˜ํ•˜๋Š” ํฌ์ธํŠธ(์„  ๋˜๋Š” ๋‹ค๊ฐํ˜•)์ž…๋‹ˆ๋‹ค.
line_width int 2 ๊ทธ๋ฆฌ๊ธฐ์— ์‚ฌ์šฉ๋œ ์„ ์˜ ๋‘๊ป˜์ž…๋‹ˆ๋‹ค.

์ธ์ˆ˜ model.track

์ธ์ˆ˜ ์œ ํ˜• ๊ธฐ๋ณธ๊ฐ’ ์„ค๋ช…
source str None ์ด๋ฏธ์ง€ ๋˜๋Š” ๋™์˜์ƒ์˜ ์†Œ์Šค ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ํŒŒ์ผ ๊ฒฝ๋กœ ๋ฐ URL์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.
persist bool False ํ”„๋ ˆ์ž„ ๊ฐ„ ์˜ค๋ธŒ์ ํŠธ๋ฅผ ์ง€์†์ ์œผ๋กœ ์ถ”์ ํ•˜์—ฌ ๋น„๋””์˜ค ์‹œํ€€์Šค ์ „์ฒด์—์„œ ID๋ฅผ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
tracker str botsort.yaml ์‚ฌ์šฉํ•  ์ถ”์  ์•Œ๊ณ ๋ฆฌ์ฆ˜์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค(์˜ˆ, bytetrack.yaml ๋˜๋Š” botsort.yaml.
conf float 0.3 ํƒ์ง€ ์‹ ๋ขฐ ์ž„๊ณ„๊ฐ’์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ’์ด ๋‚ฎ์„์ˆ˜๋ก ๋” ๋งŽ์€ ๊ฐœ์ฒด๋ฅผ ์ถ”์ ํ•  ์ˆ˜ ์žˆ์ง€๋งŒ ์˜คํƒ์ด ํฌํ•จ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
iou float 0.5 ์ค‘๋ณต ๊ฐ์ง€๋ฅผ ํ•„ํ„ฐ๋งํ•˜๊ธฐ ์œ„ํ•œ IoU( Intersection over Union ) ์ž„๊ณ„๊ฐ’์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
classes list None ํด๋ž˜์Šค ์ธ๋ฑ์Šค๋ณ„๋กœ ๊ฒฐ๊ณผ๋ฅผ ํ•„ํ„ฐ๋งํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด classes=[0, 2, 3] ์ง€์ •๋œ ํด๋ž˜์Šค๋งŒ ์ถ”์ ํ•ฉ๋‹ˆ๋‹ค.
verbose bool True ์ถ”์  ๊ฒฐ๊ณผ์˜ ํ‘œ์‹œ๋ฅผ ์ œ์–ดํ•˜์—ฌ ์ถ”์ ๋œ ๊ฐœ์ฒด์˜ ์‹œ๊ฐ์  ์ถœ๋ ฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

ํžˆํŠธ๋งต ์ปฌ๋Ÿฌ๋งต

์ปฌ๋Ÿฌ๋งต ์ด๋ฆ„ ์„ค๋ช…
cv::COLORMAP_AUTUMN ๊ฐ€์„ ์ƒ‰ ์ง€๋„
cv::COLORMAP_BONE ๋ผˆ๋Œ€ ์ƒ‰์ƒ ๋งต
cv::COLORMAP_JET ์ œํŠธ ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_WINTER ๊ฒจ์šธ ์ƒ‰์ƒ ์ง€๋„
cv::COLORMAP_RAINBOW ๋ ˆ์ธ๋ณด์šฐ ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_OCEAN ๋ฐ”๋‹ค ์ƒ‰์ƒ ์ง€๋„
cv::COLORMAP_SUMMER ์—ฌ๋ฆ„ ์ƒ‰์ƒ ์ง€๋„
cv::COLORMAP_SPRING ๋ด„ ์ƒ‰์ƒ ์ง€๋„
cv::COLORMAP_COOL ๋ฉ‹์ง„ ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_HSV HSV(์ƒ‰์กฐ, ์ฑ„๋„, ๊ฐ’) ์ƒ‰์ƒ ๋งต
cv::COLORMAP_PINK ํ•‘ํฌ ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_HOT ํ•ซ ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_PARULA ํŒŒ๋ฃฐ๋ผ ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_MAGMA ๋งˆ๊ทธ๋งˆ ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_INFERNO ์ธํŽ˜๋ฅด๋…ธ ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_PLASMA ํ”Œ๋ผ์ฆˆ๋งˆ ์ƒ‰์ƒ ๋งต
cv::COLORMAP_VIRIDIS ๋น„๋ฆฌ๋””์Šค ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_CIVIDIS ์‹œ๋น„๋””์Šค ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_TWILIGHT ํ™ฉํ˜ผ ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_TWILIGHT_SHIFTED ์‹œํ”„ํŠธ๋œ ํ™ฉํ˜ผ ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_TURBO ํ„ฐ๋ณด ์ปฌ๋Ÿฌ ๋งต
cv::COLORMAP_DEEPGREEN ๋”ฅ ๊ทธ๋ฆฐ ์ปฌ๋Ÿฌ ๋งต

์ด๋Ÿฌํ•œ ์ปฌ๋Ÿฌ๋งต์€ ์ผ๋ฐ˜์ ์œผ๋กœ ๋‹ค์–‘ํ•œ ์ƒ‰์ƒ ํ‘œํ˜„์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์‹œ๊ฐํ™”ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

์ž์ฃผ ๋ฌป๋Š” ์งˆ๋ฌธ

Ultralytics YOLO11 ํžˆํŠธ๋งต์€ ์–ด๋–ป๊ฒŒ ์ƒ์„ฑ๋˜๋ฉฐ ์–ด๋–ค ์ด์ ์ด ์žˆ๋‚˜์š”?

Ultralytics YOLO11 ๋Š” ๋ณต์žกํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ์ƒ‰์ƒ์œผ๋กœ ๊ตฌ๋ถ„๋œ ํ–‰๋ ฌ๋กœ ๋ณ€ํ™˜ํ•˜์—ฌ ํžˆํŠธ๋งต์„ ์ƒ์„ฑํ•˜๋ฉฐ, ๋‹ค์–‘ํ•œ ์ƒ‰์ƒ์ด ๋ฐ์ดํ„ฐ ๊ฐ•๋„๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. ํžˆํŠธ๋งต์„ ์‚ฌ์šฉํ•˜๋ฉด ๋ฐ์ดํ„ฐ์˜ ํŒจํ„ด, ์ƒ๊ด€๊ด€๊ณ„, ์ด์ƒ ์ง•ํ›„๋ฅผ ๋” ์‰ฝ๊ฒŒ ์‹œ๊ฐํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋œปํ•œ ์ƒ‰์กฐ๋Š” ๋” ๋†’์€ ๊ฐ’์„ ๋‚˜ํƒ€๋‚ด๊ณ  ์ฐจ๊ฐ€์šด ์ƒ‰์กฐ๋Š” ๋” ๋‚ฎ์€ ๊ฐ’์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค. ์ฃผ์š” ์ด์ ์œผ๋กœ๋Š” ๋ฐ์ดํ„ฐ ๋ถ„ํฌ์˜ ์ง๊ด€์ ์ธ ์‹œ๊ฐํ™”, ํšจ์œจ์ ์ธ ํŒจํ„ด ๊ฐ์ง€, ์˜์‚ฌ ๊ฒฐ์ •์„ ์œ„ํ•œ ํ–ฅ์ƒ๋œ ๊ณต๊ฐ„ ๋ถ„์„ ๋“ฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ๊ณผ ๊ตฌ์„ฑ ์˜ต์…˜์€ ํžˆํŠธ๋งต ๊ตฌ์„ฑ ์„น์…˜์„ ์ฐธ์กฐํ•˜์„ธ์š”.

Ultralytics YOLO11 ์„ ์‚ฌ์šฉํ•˜์—ฌ ์˜ค๋ธŒ์ ํŠธ ์ถ”์ ๊ณผ ํžˆํŠธ๋งต ์ƒ์„ฑ์„ ๋™์‹œ์— ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋‚˜์š”?

์˜ˆ, Ultralytics YOLO11 ๊ฐ์ฒด ์ถ”์ ๊ณผ ํžˆํŠธ๋งต ์ƒ์„ฑ์„ ๋™์‹œ์— ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” Heatmap ์†”๋ฃจ์…˜์„ ๊ฐ์ฒด ์ถ”์  ๋ชจ๋ธ๊ณผ ํ†ตํ•ฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋ ค๋ฉด ํžˆํŠธ๋งต ๊ฐ์ฒด๋ฅผ ์ดˆ๊ธฐํ™”ํ•˜๊ณ  YOLO11 ์˜ ์ถ”์  ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ์€ ๊ฐ„๋‹จํ•œ ์˜ˆ์‹œ์ž…๋‹ˆ๋‹ค:

import cv2

from ultralytics import solutions

cap = cv2.VideoCapture("path/to/video/file.mp4")
heatmap = solutions.Heatmap(colormap=cv2.COLORMAP_PARULA, show=True, model="yolo11n.pt")

while cap.isOpened():
    success, im0 = cap.read()
    if not success:
        break
    im0 = heatmap.generate_heatmap(im0)
    cv2.imshow("Heatmap", im0)
    if cv2.waitKey(1) & 0xFF == ord("q"):
        break

cap.release()
cv2.destroyAllWindows()

์ž์„ธํ•œ ์•ˆ๋‚ด๋Š” ์ถ”์  ๋ชจ๋“œ ํŽ˜์ด์ง€๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

Ultralytics YOLO11 ํžˆํŠธ๋งต์ด OpenCV๋‚˜ Matplotlib ๊ฐ™์€ ๋‹ค๋ฅธ ๋ฐ์ดํ„ฐ ์‹œ๊ฐํ™” ๋„๊ตฌ์™€ ๋‹ค๋ฅธ ์ ์€ ๋ฌด์—‡์ธ๊ฐ€์š”?

Ultralytics YOLO11 ํžˆํŠธ๋งต์€ ๊ฐ์ฒด ๊ฐ์ง€ ๋ฐ ์ถ”์  ๋ชจ๋ธ๊ณผ์˜ ํ†ตํ•ฉ์„ ์œ„ํ•ด ํŠน๋ณ„ํžˆ ์„ค๊ณ„๋˜์–ด ์‹ค์‹œ๊ฐ„ ๋ฐ์ดํ„ฐ ๋ถ„์„์„ ์œ„ํ•œ ์—”๋“œํˆฌ์—”๋“œ ์†”๋ฃจ์…˜์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. OpenCV๋‚˜ Matplotlib ๊ฐ™์€ ์ผ๋ฐ˜์ ์ธ ์‹œ๊ฐํ™” ๋„๊ตฌ์™€ ๋‹ฌ๋ฆฌ YOLO11 ํžˆํŠธ๋งต์€ ์„ฑ๋Šฅ๊ณผ ์ž๋™ ์ฒ˜๋ฆฌ์— ์ตœ์ ํ™”๋˜์–ด ์žˆ์–ด ์ง€์†์ ์ธ ์ถ”์ , ๊ฐ์‡  ๊ณ„์ˆ˜ ์กฐ์ •, ์‹ค์‹œ๊ฐ„ ๋น„๋””์˜ค ์˜ค๋ฒ„๋ ˆ์ด์™€ ๊ฐ™์€ ๊ธฐ๋Šฅ์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. YOLO11 ์˜ ๊ณ ์œ ํ•œ ๊ธฐ๋Šฅ์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ Ultralytics YOLO11 ์†Œ๊ฐœ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

Ultralytics YOLO11 ์„ ์‚ฌ์šฉํ•˜์—ฌ ํžˆํŠธ ๋งต์—์„œ ํŠน์ • ๊ฐ์ฒด ํด๋ž˜์Šค๋งŒ ์‹œ๊ฐํ™”ํ•˜๋ ค๋ฉด ์–ด๋–ป๊ฒŒ ํ•ด์•ผ ํ•˜๋‚˜์š”?

์—์„œ ์›ํ•˜๋Š” ํด๋ž˜์Šค๋ฅผ ์ง€์ •ํ•˜์—ฌ ํŠน์ • ์˜ค๋ธŒ์ ํŠธ ํด๋ž˜์Šค๋ฅผ ์‹œ๊ฐํ™”ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. track() YOLO ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ์ž๋™์ฐจ์™€ ์‚ฌ๋žŒ๋งŒ ์‹œ๊ฐํ™”ํ•˜๋ ค๋Š” ๊ฒฝ์šฐ(ํด๋ž˜์Šค ์ธ๋ฑ์Šค๊ฐ€ 0๊ณผ 2๋ผ๊ณ  ๊ฐ€์ •ํ•  ๊ฒฝ์šฐ) classes ๋งค๊ฐœ ๋ณ€์ˆ˜๋ฅผ ์ ์ ˆํžˆ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

import cv2

from ultralytics import solutions

cap = cv2.VideoCapture("path/to/video/file.mp4")
heatmap = solutions.Heatmap(show=True, model="yolo11n.pt", classes=[0, 2])

while cap.isOpened():
    success, im0 = cap.read()
    if not success:
        break
    im0 = heatmap.generate_heatmap(im0)
    cv2.imshow("Heatmap", im0)
    if cv2.waitKey(1) & 0xFF == ord("q"):
        break

cap.release()
cv2.destroyAllWindows()

๊ธฐ์—…์ด ๋ฐ์ดํ„ฐ ๋ถ„์„์—์„œ ํžˆํŠธ๋งต ์ƒ์„ฑ์„ ์œ„ํ•ด Ultralytics YOLO11 ์„ ์„ ํƒํ•ด์•ผ ํ•˜๋Š” ์ด์œ ๋Š” ๋ฌด์—‡์ธ๊ฐ€์š”?

Ultralytics YOLO11 ๋Š” ๊ณ ๊ธ‰ ๊ฐœ์ฒด ๊ฐ์ง€ ๊ธฐ๋Šฅ๊ณผ ์‹ค์‹œ๊ฐ„ ํžˆํŠธ๋งต ์ƒ์„ฑ ๊ธฐ๋Šฅ์„ ์›ํ™œํ•˜๊ฒŒ ํ†ตํ•ฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ๋ฅผ ๋ณด๋‹ค ํšจ๊ณผ์ ์œผ๋กœ ์‹œ๊ฐํ™”ํ•˜๊ณ ์ž ํ•˜๋Š” ๊ธฐ์—…์—๊ฒŒ ์ด์ƒ์ ์ธ ์„ ํƒ์ž…๋‹ˆ๋‹ค. ์ฃผ์š” ์žฅ์ ์œผ๋กœ๋Š” ์ง๊ด€์ ์ธ ๋ฐ์ดํ„ฐ ๋ถ„ํฌ ์‹œ๊ฐํ™”, ํšจ์œจ์ ์ธ ํŒจํ„ด ๊ฐ์ง€, ๋” ๋‚˜์€ ์˜์‚ฌ ๊ฒฐ์ •์„ ์œ„ํ•œ ํ–ฅ์ƒ๋œ ๊ณต๊ฐ„ ๋ถ„์„์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ, ์˜๊ตฌ ์ถ”์ , ์‚ฌ์šฉ์ž ์ •์˜ ๊ฐ€๋Šฅํ•œ ์ปฌ๋Ÿฌ๋งต, ๋‹ค์–‘ํ•œ ๋‚ด๋ณด๋‚ด๊ธฐ ํ˜•์‹ ์ง€์›๊ณผ ๊ฐ™์€ YOLO11 ์˜ ์ตœ์ฒจ๋‹จ ๊ธฐ๋Šฅ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋‹ค๋ฅธ ๋„๊ตฌ๋ณด๋‹ค ์šฐ์ˆ˜ํ•ฉ๋‹ˆ๋‹ค. TensorFlow ๋ฐ ์ข…ํ•ฉ์ ์ธ ๋ฐ์ดํ„ฐ ๋ถ„์„์„ ์œ„ํ•œ OpenCV์™€ ๊ฐ™์€ ๋‹ค๋ฅธ ๋„๊ตฌ๋ณด๋‹ค ์šฐ์ˆ˜ํ•ฉ๋‹ˆ๋‹ค. ๋น„์ฆˆ๋‹ˆ์Šค ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ Ultralytics ์š”๊ธˆ์ œ์—์„œ ํ™•์ธํ•˜์„ธ์š”.

๐Ÿ“…1 ๋…„ ์ „ ์ƒ์„ฑ๋จ โœ๏ธ ์—…๋ฐ์ดํŠธ๋จ 15์ผ ์ „

๋Œ“๊ธ€