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

๋น ๋ฅธ ์‹œ์ž‘ ๊ฐ€์ด๋“œ: ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด์™€ Ultralytics YOLO11

์ด ์ข…ํ•ฉ ๊ฐ€์ด๋“œ๋Š” ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด ๋””๋ฐ”์ด์Šค์— Ultralytics YOLO11 ๋ฐฐํฌ์— ๋Œ€ํ•œ ์ž์„ธํ•œ ์•ˆ๋‚ด๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ ์ด ์ž‘๊ณ  ๊ฐ•๋ ฅํ•œ ์žฅ์น˜์—์„œ YOLO11 ์˜ ๊ธฐ๋Šฅ์„ ๋ณด์—ฌ์ฃผ๊ธฐ ์œ„ํ•œ ์„ฑ๋Šฅ ๋ฒค์น˜๋งˆํฌ๋„ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค.



Watch: ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 5 ์—…๋ฐ์ดํŠธ ๋ฐ ๊ฐœ์„  ์‚ฌํ•ญ.

์ฐธ๊ณ 

์ด ๊ฐ€์ด๋“œ๋Š” ์ตœ์‹  Raspberry Pi OS Bookworm(๋ฐ๋น„์•ˆ 12)์„ ์‹คํ–‰ํ•˜๋Š” Raspberry Pi 4 ๋ฐ Raspberry Pi 5๋กœ ํ…Œ์ŠคํŠธ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. Raspberry Pi 3์™€ ๊ฐ™์€ ๊ตฌํ˜• ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด ๊ธฐ๊ธฐ์—์„œ ์ด ๊ฐ€์ด๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์€ ๋™์ผํ•œ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด OS ๋ถ์›œ์ด ์„ค์น˜๋˜์–ด ์žˆ๋Š” ํ•œ ์ •์ƒ์ ์œผ๋กœ ์ž‘๋™ํ•  ๊ฒƒ์œผ๋กœ ์˜ˆ์ƒ๋ฉ๋‹ˆ๋‹ค.

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด๋ž€ ๋ฌด์—‡์ธ๊ฐ€์š”?

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

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ์‹œ๋ฆฌ์ฆˆ ๋น„๊ต

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 3 ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 4 ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 5
CPU ๋ธŒ๋กœ๋“œ์ปด BCM2837, Cortex-A53 64๋น„ํŠธ SoC ๋ธŒ๋กœ๋“œ์ปด BCM2711, Cortex-A72 64๋น„ํŠธ SoC Broadcom BCM2712, Cortex-A76 64๋น„ํŠธ SoC
CPU ์ตœ๋Œ€ ์ฃผํŒŒ์ˆ˜ 1.4GHz 1.8GHz 2.4GHz
GPU ๋น„๋””์˜ค์ฝ”์–ด IV ๋น„๋””์˜ค์ฝ”์–ด VI ๋น„๋””์˜ค์ฝ”์–ด VII
GPU ์ตœ๋Œ€ ์ฃผํŒŒ์ˆ˜ 400Mhz 500Mhz 800Mhz
๋ฉ”๋ชจ๋ฆฌ 1GB LPDDR2 SDRAM 1GB, 2GB, 4GB, 8GB LPDDR4-3200 SDRAM 4GB, 8GB LPDDR4X-4267 SDRAM
PCIe N/A N/A 1xPCIe 2.0 ์ธํ„ฐํŽ˜์ด์Šค
์ตœ๋Œ€ ์ „๋ ฅ ์†Œ๋ชจ 2.5A@5V 3A@5V 5A@5V(PD ์‚ฌ์šฉ)

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด OS๋ž€ ๋ฌด์—‡์ธ๊ฐ€์š”?

๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด OS (์ด์ „์˜ ๋ผ์ฆˆ๋น„์•ˆ)๋Š” ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด ์žฌ๋‹จ์—์„œ ๋ฐฐํฌํ•˜๋Š” ์†Œํ˜• ์‹ฑ๊ธ€ ๋ณด๋“œ ์ปดํ“จํ„ฐ์ธ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด ์ œํ’ˆ๊ตฐ์„ ์œ„ํ•œ ๋ฐ๋น„์•ˆ GNU/Linux ๋ฐฐํฌํŒ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•˜๋Š” ์œ ๋‹‰์Šค ๊ณ„์—ด ์šด์˜์ฒด์ œ์ž…๋‹ˆ๋‹ค. ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด OS๋Š” ARM CPU๊ฐ€ ํƒ‘์žฌ๋œ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์— ๊ณ ๋„๋กœ ์ตœ์ ํ™”๋˜์–ด ์žˆ์œผ๋ฉฐ, Openbox ์Šคํƒœํ‚น ์œˆ๋„์šฐ ๋งค๋‹ˆ์ €์™€ ํ•จ๊ป˜ ์ˆ˜์ •๋œ LXDE ๋ฐ์Šคํฌํ†ฑ ํ™˜๊ฒฝ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด OS๋Š” ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด์—์„œ ๊ฐ€๋Šฅํ•œ ํ•œ ๋งŽ์€ ๋ฐ๋น„์•ˆ ํŒจํ‚ค์ง€์˜ ์•ˆ์ •์„ฑ๊ณผ ์„ฑ๋Šฅ์„ ๊ฐœ์„ ํ•˜๋Š” ๋ฐ ์ค‘์ ์„ ๋‘๊ณ  ํ™œ๋ฐœํžˆ ๊ฐœ๋ฐœ ์ค‘์ž…๋‹ˆ๋‹ค.

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด OS๋ฅผ ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด๋กœ ํ”Œ๋ž˜์‹œํ•˜๊ธฐ

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด๋ฅผ ์†์— ๋„ฃ์€ ํ›„ ๊ฐ€์žฅ ๋จผ์ € ํ•ด์•ผ ํ•  ์ผ์€ ๋งˆ์ดํฌ๋กœ SD ์นด๋“œ์— ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด OS๋ฅผ ํ”Œ๋ž˜์‹œํ•˜๊ณ , ์žฅ์น˜์— ์‚ฝ์ž…ํ•œ ํ›„ OS๋กœ ๋ถ€ํŒ…ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์˜ ์ž์„ธํ•œ ์‹œ์ž‘ํ•˜๊ธฐ ์„ค๋ช…์„œ๋ฅผ ๋”ฐ๋ผ ์žฅ์น˜๋ฅผ ์ฒ˜์Œ ์‚ฌ์šฉํ•  ์ค€๋น„๋ฅผ ํ•˜์„ธ์š”.

์„ค์ • Ultralytics

๋‹ค์Œ ์ปดํ“จํ„ฐ ๋น„์ „ ํ”„๋กœ์ ํŠธ๋ฅผ ๊ตฌ์ถ•ํ•˜๊ธฐ ์œ„ํ•ด ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์—์„œ Ultralytics ํŒจํ‚ค์ง€๋ฅผ ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์—๋Š” ๋‘ ๊ฐ€์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋‘˜ ์ค‘ ํ•˜๋‚˜๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Docker๋กœ ์‹œ์ž‘ํ•˜๊ธฐ

๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์—์„œ Ultralytics YOLO11 ๋ฅผ ์‹œ์ž‘ํ•˜๋Š” ๊ฐ€์žฅ ๋น ๋ฅธ ๋ฐฉ๋ฒ•์€ ๋ฏธ๋ฆฌ ๋นŒ๋“œ๋œ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์šฉ ๋„์ปค ์ด๋ฏธ์ง€๋กœ ์‹คํ–‰ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜์—ฌ Docker ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๊ฐ€์ ธ์™€ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์—์„œ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. ์ด ์˜ˆ์ œ๋Š” ํŒŒ์ด์ฌ3 ํ™˜๊ฒฝ์˜ ๋ฐ๋น„์•ˆ 12(Bookworm)๊ฐ€ ํฌํ•จ๋œ arm64v8/debian ๋„์ปค ์ด๋ฏธ์ง€๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค.

t=ultralytics/ultralytics:latest-arm64 && sudo docker pull $t && sudo docker run -it --ipc=host $t

์ด ์ž‘์—…์ด ์™„๋ฃŒ๋˜๋ฉด ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด์—์„œ NCNN ์‚ฌ์šฉ ์„น์…˜์œผ๋กœ ๊ฑด๋„ˆ๋œ๋‹ˆ๋‹ค.

Docker ์—†์ด ์‹œ์ž‘

Ultralytics ํŒจํ‚ค์ง€ ์„ค์น˜

์—ฌ๊ธฐ์„œ๋Š” ์„ ํƒ์  ์ข…์†์„ฑ๊ณผ ํ•จ๊ป˜ Ultralytics ํŒจํ‚ค์ง€๋ฅผ ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด์— ์„ค์น˜ํ•˜์—ฌ ๋‹ค๋ฅธ ํ˜•์‹์œผ๋กœ PyTorch ๋ชจ๋ธ์„ ๋‹ค๋ฅธ ํ˜•์‹์œผ๋กœ ๋‚ด๋ณด๋‚ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  1. ํŒจํ‚ค์ง€ ๋ชฉ๋ก ์—…๋ฐ์ดํŠธ, pip ์„ค์น˜ ๋ฐ ์ตœ์‹  ๋ฒ„์ „์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ

    sudo apt update
    sudo apt install python3-pip -y
    pip install -U pip
    
  2. ์„ค์น˜ ultralytics ์„ ํƒ์  ์ข…์†์„ฑ์ด ์žˆ๋Š” pip ํŒจํ‚ค์ง€

    pip install ultralytics[export]
    
  3. ๋””๋ฐ”์ด์Šค ์žฌ๋ถ€ํŒ…

    sudo reboot
    

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด์—์„œ NCNN ์‚ฌ์šฉ

์—์„œ ์ง€์›ํ•˜๋Š” ๋ชจ๋“  ๋ชจ๋ธ ๋‚ด๋ณด๋‚ด๊ธฐ ํ˜•์‹ ์ค‘ Ultralytics, NCNNNCNN ์€ ๋ชจ๋ฐ”์ผ/์ž„๋ฒ ๋””๋“œ ํ”Œ๋žซํผ(์˜ˆ: ARM ์•„ํ‚คํ…์ฒ˜)์— ๊ณ ๋„๋กœ ์ตœ์ ํ™”๋˜์–ด ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ๋””๋ฐ”์ด์Šค๋กœ ์ž‘์—…ํ•  ๋•Œ ์ตœ๊ณ ์˜ ์ถ”๋ก  ์„ฑ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด์™€ ํ•จ๊ป˜ NCNN ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.

๋ชจ๋ธ์„ NCNN ๋กœ ๋ณ€ํ™˜ํ•˜๊ณ  ์ถ”๋ก  ์‹คํ–‰

๋‚ด๋ณด๋‚ธ ๋ชจ๋ธ๋กœ ์ถ”๋ก ์„ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•ด PyTorch ํ˜•์‹์˜ YOLO11n ๋ชจ๋ธ์„ NCNN ์œผ๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ

from ultralytics import YOLO

# Load a YOLO11n PyTorch model
model = YOLO("yolo11n.pt")

# Export the model to NCNN format
model.export(format="ncnn")  # creates 'yolo11n_ncnn_model'

# Load the exported NCNN model
ncnn_model = YOLO("yolo11n_ncnn_model")

# Run inference
results = ncnn_model("https://ultralytics.com/images/bus.jpg")
# Export a YOLO11n PyTorch model to NCNN format
yolo export model=yolo11n.pt format=ncnn  # creates 'yolo11n_ncnn_model'

# Run inference with the exported model
yolo predict model='yolo11n_ncnn_model' source='https://ultralytics.com/images/bus.jpg'

ํŒ

์ง€์›๋˜๋Š” ๋‚ด๋ณด๋‚ด๊ธฐ ์˜ต์…˜์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋ฐฐํฌ ์˜ต์…˜์— ๋Œ€ํ•œUltralytics ๋ฌธ์„œ ํŽ˜์ด์ง€๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 5 YOLO11 ๋ฒค์น˜๋งˆํฌ

YOLO11 ๋ฒค์น˜๋งˆํฌ๋Š” Ultralytics ํŒ€์—์„œ ์†๋„์™€ ์ •ํ™•๋„๋ฅผ ์ธก์ •ํ•˜๋Š” 9๊ฐ€์ง€ ๋ชจ๋ธ ํ˜•์‹( PyTorch, TorchScript, ONNX, OpenVINO, TF SavedModel , TF GraphDef , TF Lite, PaddlePaddle, NCNN)์œผ๋กœ ์‹คํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค. ๋ฒค์น˜๋งˆํฌ๋Š” ๊ธฐ๋ณธ ์ž…๋ ฅ ์ด๋ฏธ์ง€ ํฌ๊ธฐ 640์˜ FP32 ์ •๋ฐ€๋„๋กœ ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 5์—์„œ ์‹คํ–‰๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

๋น„๊ต ์ฐจํŠธ

๋‹ค๋ฅธ ๋ชจ๋ธ์€ ํฌ๊ธฐ๊ฐ€ ๋„ˆ๋ฌด ์ปค์„œ ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด์—์„œ ์‹คํ–‰ํ•˜๊ธฐ ์–ด๋ ต๊ณ  ์ ์ ˆํ•œ ์„ฑ๋Šฅ์„ ์ œ๊ณตํ•˜์ง€ ์•Š๊ธฐ ๋•Œ๋ฌธ์— YOLO11n ๋ฐ YOLO11s ๋ชจ๋ธ์— ๋Œ€ํ•œ ๋ฒค์น˜๋งˆํฌ๋งŒ ํฌํ•จํ–ˆ์Šต๋‹ˆ๋‹ค.

YOLO11 RPi 5์˜ ๋ฒค์น˜๋งˆํฌ
Ultralytics 8.3.39๋กœ ๋ฒค์น˜๋งˆํ‚นํ–ˆ์Šต๋‹ˆ๋‹ค.

์ƒ์„ธ ๋น„๊ต ํ‘œ

์•„๋ž˜ ํ‘œ๋Š” ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 5์—์„œ ์‹คํ–‰๋˜๋Š” 9๊ฐ€์ง€ ํ˜•์‹(PyTorch, TorchScript, ONNX, OpenVINO, TF SavedModel , TF GraphDef , TF Lite, PaddlePaddle, NCNN)์˜ ๋‘ ๊ฐ€์ง€ ๋ชจ๋ธ(YOLO11n, YOLO11s)์— ๋Œ€ํ•œ ๋ฒค์น˜๋งˆํฌ ๊ฒฐ๊ณผ๋กœ, ๊ฐ ์กฐํ•ฉ์˜ ์ƒํƒœ, ํฌ๊ธฐ, mAP50-95(B) ๋ฉ”ํŠธ๋ฆญ ๋ฐ ์ถ”๋ก  ์‹œ๊ฐ„์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.

์„ฑ๋Šฅ

ํ˜•์‹ ์ƒํƒœ ๋””์Šคํฌ ํฌ๊ธฐ(MB) mAP50-95(B) ์ถ”๋ก  ์‹œ๊ฐ„(ms/im)
PyTorch โœ… 5.4 0.6100 405.238
TorchScript โœ… 10.5 0.6082 526.628
ONNX โœ… 10.2 0.6082 168.082
OpenVINO โœ… 10.4 0.6082 81.192
TF SavedModel โœ… 25.8 0.6082 377.968
TF GraphDef โœ… 10.3 0.6082 487.244
TF Lite โœ… 10.3 0.6082 317.398
PaddlePaddle โœ… 20.4 0.6082 561.892
MNN โœ… 10.1 0.6106 112.554
NCNN โœ… 10.2 0.6106 88.026
ํ˜•์‹ ์ƒํƒœ ๋””์Šคํฌ ํฌ๊ธฐ(MB) mAP50-95(B) ์ถ”๋ก  ์‹œ๊ฐ„(ms/im)
PyTorch โœ… 18.4 0.7526 1011.60
TorchScript โœ… 36.5 0.7416 1268.502
ONNX โœ… 36.3 0.7416 324.17
OpenVINO โœ… 36.4 0.7416 179.324
TF SavedModel โœ… 91.1 0.7416 714.382
TF GraphDef โœ… 36.4 0.7416 1019.83
TF Lite โœ… 36.4 0.7416 849.86
PaddlePaddle โœ… 72.5 0.7416 1276.34
MNN โœ… 36.2 0.7409 273.032
NCNN โœ… 36.2 0.7419 194.858

Ultralytics 8.3.39๋กœ ๋ฒค์น˜๋งˆํ‚นํ–ˆ์Šต๋‹ˆ๋‹ค.

๊ฒฐ๊ณผ ์žฌํ˜„

๋ชจ๋“  ๋‚ด๋ณด๋‚ด๊ธฐ ํ˜•์‹์—์„œ ์œ„์˜ Ultralytics ๋ฒค์น˜๋งˆํฌ๋ฅผ ์žฌํ˜„ํ•˜๋ ค๋ฉด ๋‹ค์Œ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•˜์„ธ์š”:

์˜ˆ

from ultralytics import YOLO

# Load a YOLO11n PyTorch model
model = YOLO("yolo11n.pt")

# Benchmark YOLO11n speed and accuracy on the COCO8 dataset for all all export formats
results = model.benchmarks(data="coco8.yaml", imgsz=640)
# Benchmark YOLO11n speed and accuracy on the COCO8 dataset for all all export formats
yolo benchmark model=yolo11n.pt data=coco8.yaml imgsz=640

๋ฒค์น˜๋งˆํ‚น ๊ฒฐ๊ณผ๋Š” ์‹œ์Šคํ…œ์˜ ์ •ํ™•ํ•œ ํ•˜๋“œ์›จ์–ด ๋ฐ ์†Œํ”„ํŠธ์›จ์–ด ๊ตฌ์„ฑ๊ณผ ๋ฒค์น˜๋งˆํฌ๋ฅผ ์‹คํ–‰ํ•  ๋‹น์‹œ ์‹œ์Šคํ…œ์˜ ํ˜„์žฌ ์ž‘์—…๋Ÿ‰์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ๋‹ค๋Š” ์ ์— ์œ ์˜ํ•˜์„ธ์š”. ๊ฐ€์žฅ ์‹ ๋ขฐํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒฐ๊ณผ๋ฅผ ์–ป์œผ๋ ค๋ฉด ๋งŽ์€ ์ˆ˜์˜ ์ด๋ฏธ์ง€๊ฐ€ ํฌํ•จ๋œ ๋ฐ์ดํ„ฐ ์„ธํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์„ธ์š”. data='coco8.yaml' (4 val images), ordata='coco.yaml'` (5000๊ฐœ val ์ด๋ฏธ์ง€).

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ์นด๋ฉ”๋ผ ์‚ฌ์šฉ

์ปดํ“จํ„ฐ ๋น„์ „ ํ”„๋กœ์ ํŠธ์— ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ์ถ”๋ก ์„ ์ˆ˜ํ–‰ํ•˜๊ธฐ ์œ„ํ•ด ์‹ค์‹œ๊ฐ„ ๋น„๋””์˜ค ํ”ผ๋“œ๋ฅผ ๊ฐ€์ ธ์™€์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์˜ ์˜จ๋ณด๋“œ MIPI CSI ์ปค๋„ฅํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๊ณต์‹ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด ์นด๋ฉ”๋ผ ๋ชจ๋“ˆ์„ ์—ฐ๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ๊ฐ€์ด๋“œ์—์„œ๋Š” ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ์นด๋ฉ”๋ผ ๋ชจ๋“ˆ 3์„ ์‚ฌ์šฉํ•˜์—ฌ ๋น„๋””์˜ค ํ”ผ๋“œ๋ฅผ ์ˆ˜์ง‘ํ•˜๊ณ  YOLO11 ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•˜์—ฌ ์ถ”๋ก ์„ ์ˆ˜ํ–‰ํ–ˆ์Šต๋‹ˆ๋‹ค.

์ฐธ๊ณ 

๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 5๋Š” ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 4๋ณด๋‹ค ๋” ์ž‘์€ CSI ์ปค๋„ฅํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜๋ฏ€๋กœ(15ํ•€ ๋Œ€ 22ํ•€), ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด ์นด๋ฉ”๋ผ์— ์—ฐ๊ฒฐํ•˜๋ ค๋ฉด 15ํ•€ ๋Œ€ 22ํ•€ ์–ด๋Œ‘ํ„ฐ ์ผ€์ด๋ธ”์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

์นด๋ฉ”๋ผ ํ…Œ์ŠคํŠธ

์นด๋ฉ”๋ผ๋ฅผ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์— ์—ฐ๊ฒฐํ•œ ํ›„ ๋‹ค์Œ ๋ช…๋ น์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. ์•ฝ 5์ดˆ ๋™์•ˆ ์นด๋ฉ”๋ผ์˜ ์‹ค์‹œ๊ฐ„ ๋น„๋””์˜ค ํ”ผ๋“œ๊ฐ€ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.

rpicam-hello

์นด๋ฉ”๋ผ๋กœ ์ถ”๋ก ํ•˜๊ธฐ

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ์นด๋ฉ”๋ผ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ YOLO11 ๋ชจ๋ธ์„ ์ถ”๋ก ํ•˜๋Š” ๋ฐฉ๋ฒ•์—๋Š” ๋‘ ๊ฐ€์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

์‚ฌ์šฉ๋ฒ•

๋‹ค์Œ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. picamera2์นด๋ฉ”๋ผ ๋ฐ ์ถ”๋ก  YOLO11 ๋ชจ๋ธ์— ์•ก์„ธ์Šคํ•˜๊ธฐ ์œ„ํ•ด ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด OS๊ฐ€ ์‚ฌ์ „ ์„ค์น˜๋˜์–ด ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค.

์˜ˆ

import cv2
from picamera2 import Picamera2

from ultralytics import YOLO

# Initialize the Picamera2
picam2 = Picamera2()
picam2.preview_configuration.main.size = (1280, 720)
picam2.preview_configuration.main.format = "RGB888"
picam2.preview_configuration.align()
picam2.configure("preview")
picam2.start()

# Load the YOLO11 model
model = YOLO("yolo11n.pt")

while True:
    # Capture frame-by-frame
    frame = picam2.capture_array()

    # Run YOLO11 inference on the frame
    results = model(frame)

    # Visualize the results on the frame
    annotated_frame = results[0].plot()

    # Display the resulting frame
    cv2.imshow("Camera", annotated_frame)

    # Break the loop if 'q' is pressed
    if cv2.waitKey(1) == ord("q"):
        break

# Release resources and close windows
cv2.destroyAllWindows()

๋‹ค์Œ์„ ์‚ฌ์šฉํ•˜์—ฌ TCP ์ŠคํŠธ๋ฆผ์„ ์‹œ์ž‘ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. rpicam-vid ๋ฅผ ์—ฐ๊ฒฐํ•˜์—ฌ ๋‚˜์ค‘์— ์ถ”๋ก ํ•  ๋•Œ ์ด ์ŠคํŠธ๋ฆผ URL์„ ์ž…๋ ฅ์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ ๋ช…๋ น์„ ์‹คํ–‰ํ•˜์—ฌ TCP ์ŠคํŠธ๋ฆผ์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

rpicam-vid -n -t 0 --inline --listen -o tcp://127.0.0.1:8888

์ž์„ธํžˆ ์•Œ์•„๋ณด๊ธฐ rpicam-vid ๊ณต์‹ ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ๋ฌธ์„œ์—์„œ ์‚ฌ์šฉ ๋ฐฉ๋ฒ•

์˜ˆ

from ultralytics import YOLO

# Load a YOLO11n PyTorch model
model = YOLO("yolo11n.pt")

# Run inference
results = model("tcp://127.0.0.1:8888")
yolo predict model=yolo11n.pt source="tcp://127.0.0.1:8888"

ํŒ

์ด๋ฏธ์ง€/๋น„๋””์˜ค ์ž…๋ ฅ ์œ ํ˜•์„ ๋ณ€๊ฒฝํ•˜๋ ค๋ฉด ์ถ”๋ก  ์†Œ์Šค์— ๋Œ€ํ•œ ๋ฌธ์„œ๋ฅผ ํ™•์ธํ•˜์„ธ์š”.

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ์‚ฌ์šฉ ์‹œ ๋ชจ๋ฒ” ์‚ฌ๋ก€

YOLO11 ์„ ์‹คํ–‰ํ•˜๋Š” ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด์—์„œ ์„ฑ๋Šฅ์„ ๊ทน๋Œ€ํ™”ํ•˜๊ธฐ ์œ„ํ•ด ๋”ฐ๋ผ์•ผ ํ•  ๋ช‡ ๊ฐ€์ง€ ๋ชจ๋ฒ” ์‚ฌ๋ก€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

  1. SSD ์‚ฌ์šฉ

    ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด๋ฅผ 24์‹œ๊ฐ„ ๋‚ด๋‚ด ๊ณ„์† ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ, SD ์นด๋“œ๋Š” ์ง€์†์ ์ธ ์“ฐ๊ธฐ๋ฅผ ๊ฒฌ๋””์ง€ ๋ชปํ•˜๊ณ  ํŒŒ์†๋  ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ ์‹œ์Šคํ…œ์šฉ์œผ๋กœ SSD๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 5์˜ ์˜จ๋ณด๋“œ PCIe ์ปค๋„ฅํ„ฐ๋ฅผ ํ†ตํ•ด ์ด์ œ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 5์šฉ NVMe ๋ฒ ์ด์Šค์™€ ๊ฐ™์€ ์–ด๋Œ‘ํ„ฐ๋ฅผ ์‚ฌ์šฉํ•ด SSD๋ฅผ ์—ฐ๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  2. GUI ์—†๋Š” ํ”Œ๋ž˜์‹œ

    ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด OS๋ฅผ ํ”Œ๋ž˜์‹œํ•  ๋•Œ ๋ฐ์Šคํฌํ†ฑ ํ™˜๊ฒฝ(๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด OS ๋ผ์ดํŠธ)์„ ์„ค์น˜ํ•˜์ง€ ์•Š๋„๋ก ์„ ํƒํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ์žฅ์น˜์˜ RAM์„ ์•ฝ๊ฐ„ ์ ˆ์•ฝํ•˜์—ฌ ์ปดํ“จํ„ฐ ๋น„์ „ ์ฒ˜๋ฆฌ๋ฅผ ์œ„ํ•œ ๋” ๋งŽ์€ ๊ณต๊ฐ„์„ ํ™•๋ณดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ ๋‹จ๊ณ„

๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์— YOLO ๋ฅผ ์„ฑ๊ณต์ ์œผ๋กœ ์„ค์น˜ํ•˜์‹  ๊ฒƒ์„ ์ถ•ํ•˜๋“œ๋ฆฝ๋‹ˆ๋‹ค! ์ถ”๊ฐ€ ํ•™์Šต ๋ฐ ์ง€์›์€ Ultralytics YOLO11 ๋ฌธ์„œ ๋ฐ ์นด์Šˆ๋ฏธ๋ฅด ์›”๋“œ ์žฌ๋‹จ์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๊ฐ์‚ฌ ๋ฐ ์ธ์šฉ

์ด ๊ฐ€์ด๋“œ๋Š” ๋ฉธ์ข… ์œ„๊ธฐ ์ข… ๋ณด์กด์„ ์œ„ํ•ด YOLO ์„ ์‚ฌ์šฉํ•˜๋Š” ๋‹จ์ฒด์ธ ์นด์Šˆ๋ฏธ๋ฅด ์›”๋“œ ์žฌ๋‹จ์„ ์œ„ํ•ด ๋‹ค์•ˆ ์—˜ํŒ…ํฌ๊ฐ€ ์ฒ˜์Œ์— ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ๋ฌผ์ฒด ๊ฐ์ง€ ๊ธฐ์ˆ  ๋ถ„์•ผ์—์„œ ์„ ๊ตฌ์ ์ธ ์ž‘์—…๊ณผ ๊ต์œก์— ์ค‘์ ์„ ๋‘” ์ด ๋‹จ์ฒด์˜ ๊ณต๋กœ๋ฅผ ์ธ์ •ํ•ฉ๋‹ˆ๋‹ค.

์นด์Šˆ๋ฏธ๋ฅด ์›”๋“œ ์žฌ๋‹จ์˜ ํ™œ๋™์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์›น์‚ฌ์ดํŠธ์—์„œ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

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

๋„์ปค๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๊ณ  ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์—์„œ Ultralytics YOLO11 ์„ค์ •ํ•˜๋ ค๋ฉด ์–ด๋–ป๊ฒŒ ํ•ด์•ผ ํ•˜๋‚˜์š”?

Docker๊ฐ€ ์—†๋Š” ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์—์„œ Ultralytics YOLO11 ์„ ์„ค์ •ํ•˜๋ ค๋ฉด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ฅด์„ธ์š”:

  1. ํŒจํ‚ค์ง€ ๋ชฉ๋ก ์—…๋ฐ์ดํŠธ ๋ฐ ์„ค์น˜ pip:
    sudo apt update
    sudo apt install python3-pip -y
    pip install -U pip
    
  2. ์„ ํƒ์  ์ข…์†์„ฑ๊ณผ ํ•จ๊ป˜ Ultralytics ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค:
    pip install ultralytics[export]
    
  3. ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์ ์šฉํ•˜๋ ค๋ฉด ์žฅ์น˜๋ฅผ ์žฌ๋ถ€ํŒ…ํ•ฉ๋‹ˆ๋‹ค:
    sudo reboot
    

์ž์„ธํ•œ ์ง€์นจ์€ ๋„์ปค ์—†์ด ์‹œ์ž‘ํ•˜๊ธฐ ์„น์…˜์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์—์„œ AI ์ž‘์—…์„ ์œ„ํ•ด Ultralytics YOLO11 ์˜ NCNN ํ˜•์‹์„ ์‚ฌ์šฉํ•ด์•ผ ํ•˜๋Š” ์ด์œ ๋Š” ๋ฌด์—‡์ธ๊ฐ€์š”?

Ultralytics YOLO11์˜ NCNN ํ˜•์‹์€ ๋ชจ๋ฐ”์ผ ๋ฐ ์ž„๋ฒ ๋””๋“œ ํ”Œ๋žซํผ์— ๊ณ ๋„๋กœ ์ตœ์ ํ™”๋˜์–ด ์žˆ์–ด ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด ๊ธฐ๊ธฐ์—์„œ AI ์ž‘์—…์„ ์‹คํ–‰ํ•˜๋Š” ๋ฐ ์ด์ƒ์ ์ž…๋‹ˆ๋‹ค. NCNN ํ˜•์‹์€ ARM ์•„ํ‚คํ…์ฒ˜๋ฅผ ํ™œ์šฉํ•˜์—ฌ ์ถ”๋ก  ์„ฑ๋Šฅ์„ ๊ทน๋Œ€ํ™”ํ•˜์—ฌ ๋‹ค๋ฅธ ํ˜•์‹์— ๋น„ํ•ด ๋” ๋น ๋ฅด๊ณ  ํšจ์œจ์ ์ธ ์ฒ˜๋ฆฌ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ง€์›๋˜๋Š” ๋‚ด๋ณด๋‚ด๊ธฐ ์˜ต์…˜์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋ฐฐํฌ ์˜ต์…˜์— ๋Œ€ํ•œUltralytics ๋ฌธ์„œ ํŽ˜์ด์ง€๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

YOLO11 ๋ชจ๋ธ์„ ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก NCNN ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜ํ•˜๋ ค๋ฉด ์–ด๋–ป๊ฒŒ ํ•ด์•ผ ํ•˜๋‚˜์š”?

Python ๋˜๋Š” CLI ๋ช…๋ น์„ ์‚ฌ์šฉํ•˜์—ฌ PyTorch YOLO11 ๋ชจ๋ธ์„ NCNN ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

์˜ˆ

from ultralytics import YOLO

# Load a YOLO11n PyTorch model
model = YOLO("yolo11n.pt")

# Export the model to NCNN format
model.export(format="ncnn")  # creates 'yolo11n_ncnn_model'

# Load the exported NCNN model
ncnn_model = YOLO("yolo11n_ncnn_model")

# Run inference
results = ncnn_model("https://ultralytics.com/images/bus.jpg")
# Export a YOLO11n PyTorch model to NCNN format
yolo export model=yolo11n.pt format=ncnn  # creates 'yolo11n_ncnn_model'

# Run inference with the exported model
yolo predict model='yolo11n_ncnn_model' source='https://ultralytics.com/images/bus.jpg'

์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด์—์„œ NCNN ์‚ฌ์šฉ ์„น์…˜์„ ์ฐธ์กฐํ•˜์„ธ์š”.

YOLO11 ์‹คํ–‰๊ณผ ๊ด€๋ จ๋œ ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 4์™€ ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 5์˜ ํ•˜๋“œ์›จ์–ด ์ฐจ์ด์ ์€ ๋ฌด์—‡์ธ๊ฐ€์š”?

์ฃผ์š” ์ฐจ์ด์ ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:

  • CPU: ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 4๋Š” ๋ธŒ๋กœ๋“œ์ปด BCM2711, ์ฝ”์–ดํ…์Šค-A72 64๋น„ํŠธ SoC๋ฅผ, ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 5๋Š” ๋ธŒ๋กœ๋“œ์ปด BCM2712, ์ฝ”์–ดํ…์Šค-A76 64๋น„ํŠธ SoC๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
  • ์ตœ๋Œ€ CPU ์ฃผํŒŒ์ˆ˜: ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 4์˜ ์ตœ๋Œ€ ์ฃผํŒŒ์ˆ˜๋Š” 1.8GHz์ด๋ฉฐ, ๋ผ์ฆˆ๋ฒ ๋ฆฌํŒŒ์ด 5๋Š” 2.4GHz์— ๋‹ฌํ•ฉ๋‹ˆ๋‹ค.
  • ๋ฉ”๋ชจ๋ฆฌ: ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 4๋Š” ์ตœ๋Œ€ 8GB์˜ LPDDR4-3200 SDRAM์„ ์ œ๊ณตํ•˜๋ฉฐ, ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 5๋Š” 4GB ๋ฐ 8GB ๋ฒ„์ „์œผ๋กœ ์ œ๊ณต๋˜๋Š” LPDDR4X-4267 SDRAM์„ ํƒ‘์žฌํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

์ด๋Ÿฌํ•œ ๊ฐœ์„  ์‚ฌํ•ญ ๋•๋ถ„์— ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 5์˜ YOLO11 ๋ชจ๋ธ์ด ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด 4์— ๋น„ํ•ด ๋” ๋‚˜์€ ์„ฑ๋Šฅ ๋ฒค์น˜๋งˆํฌ๋ฅผ ๋‹ฌ์„ฑํ•  ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ์‹œ๋ฆฌ์ฆˆ ๋น„๊ต ํ‘œ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”.

๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ์นด๋ฉ”๋ผ ๋ชจ๋“ˆ์ด Ultralytics YOLO11 ์—์„œ ์ž‘๋™ํ•˜๋„๋ก ์„ค์ •ํ•˜๋ ค๋ฉด ์–ด๋–ป๊ฒŒ ํ•ด์•ผ ํ•˜๋‚˜์š”?

YOLO11 ์ถ”๋ก ์„ ์œ„ํ•ด ๋ผ์ฆˆ๋ฒ ๋ฆฌ ํŒŒ์ด ์นด๋ฉ”๋ผ๋ฅผ ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•์—๋Š” ๋‘ ๊ฐ€์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค:

  1. ์‚ฌ์šฉ picamera2:

    import cv2
    from picamera2 import Picamera2
    
    from ultralytics import YOLO
    
    picam2 = Picamera2()
    picam2.preview_configuration.main.size = (1280, 720)
    picam2.preview_configuration.main.format = "RGB888"
    picam2.preview_configuration.align()
    picam2.configure("preview")
    picam2.start()
    
    model = YOLO("yolo11n.pt")
    
    while True:
        frame = picam2.capture_array()
        results = model(frame)
        annotated_frame = results[0].plot()
        cv2.imshow("Camera", annotated_frame)
    
        if cv2.waitKey(1) == ord("q"):
            break
    
    cv2.destroyAllWindows()
    
  2. TCP ์ŠคํŠธ๋ฆผ ์‚ฌ์šฉ:

    rpicam-vid -n -t 0 --inline --listen -o tcp://127.0.0.1:8888
    
    from ultralytics import YOLO
    
    model = YOLO("yolo11n.pt")
    results = model("tcp://127.0.0.1:8888")
    

์ž์„ธํ•œ ์„ค์ • ์ง€์นจ์€ ์นด๋ฉ”๋ผ๋กœ ์ถ”๋ก ํ•˜๊ธฐ ์„น์…˜์„ ์ฐธ์กฐํ•˜์„ธ์š”.

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

๋Œ“๊ธ€