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

Ultralytics YOLO ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์—์„œ ๋ฒ„๊ทธ ๋ฆฌํฌํŠธ๋ฅผ ์œ„ํ•œ ์ตœ์†Œํ•œ์˜ ์žฌํ˜„ ๊ฐ€๋Šฅํ•œ ์˜ˆ์ œ ๋งŒ๋“ค๊ธฐ

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

1. ๋ฌธ์ œ ๊ฒฉ๋ฆฌํ•˜๊ธฐ

MRE๋ฅผ ๋งŒ๋“œ๋Š” ์ฒซ ๋ฒˆ์งธ ๋‹จ๊ณ„๋Š” ๋ฌธ์ œ๋ฅผ ๊ฒฉ๋ฆฌํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ฆ‰, ๋ฌธ์ œ์™€ ์ง์ ‘ ๊ด€๋ จ์ด ์—†๋Š” ๋ถˆํ•„์š”ํ•œ ์ฝ”๋“œ๋‚˜ ์ข…์†์„ฑ์„ ๋ชจ๋‘ ์ œ๊ฑฐํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋ฌธ์ œ๋ฅผ ์ผ์œผํ‚ค๋Š” ์ฝ”๋“œ์˜ ํŠน์ • ๋ถ€๋ถ„์— ์ง‘์ค‘ํ•˜๊ณ  ๊ด€๋ จ ์—†๋Š” ์ฝ”๋“œ๋Š” ๋ชจ๋‘ ์ œ๊ฑฐํ•˜์„ธ์š”.

2. ๊ณต๊ฐœ ๋ชจ๋ธ ๋ฐ ๋ฐ์ดํ„ฐ ์„ธํŠธ ์‚ฌ์šฉ

MRE๋ฅผ ๋งŒ๋“ค ๋•Œ๋Š” ๊ณต๊ฐœ์ ์œผ๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋ชจ๋ธ๊ณผ ๋ฐ์ดํ„ฐ ์„ธํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ฌธ์ œ๋ฅผ ์žฌํ˜„ํ•˜์„ธ์š”. ์˜ˆ๋ฅผ ๋“ค์–ด, 'yolov8n.pt' ๋ชจ๋ธ๊ณผ 'coco8.yaml' ๋ฐ์ดํ„ฐ ์„ธํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์„ธ์š”. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ์œ ์ง€ ๊ด€๋ฆฌ์ž์™€ ๊ธฐ์—ฌ์ž๊ฐ€ ๋…์  ๋ฐ์ดํ„ฐ๋‚˜ ์‚ฌ์šฉ์ž ์ง€์ • ๋ชจ๋ธ์— ์•ก์„ธ์Šคํ•˜์ง€ ์•Š๊ณ ๋„ ์˜ˆ์ œ๋ฅผ ์‰ฝ๊ฒŒ ์‹คํ–‰ํ•˜๊ณ  ๋ฌธ์ œ๋ฅผ ์กฐ์‚ฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

3. ํ•„์š”ํ•œ ๋ชจ๋“  ์ข…์†์„ฑ ํฌํ•จํ•˜๊ธฐ

MRE์— ํ•„์š”ํ•œ ๋ชจ๋“  ์ข…์†์„ฑ์„ ํฌํ•จํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ฝ”๋“œ๊ฐ€ ์™ธ๋ถ€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์— ์˜์กดํ•˜๋Š” ๊ฒฝ์šฐ ํ•„์š”ํ•œ ํŒจํ‚ค์ง€์™€ ํ•ด๋‹น ๋ฒ„์ „์„ ์ง€์ •ํ•˜์„ธ์š”. ์ด์ƒ์ ์œผ๋กœ๋Š” requirements.txt ํŒŒ์ผ์— ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ ๋ฒ„๊ทธ ๋ฆฌํฌํŠธ์— ์ข…์†์„ฑ์„ ๋‚˜์—ดํ•˜์„ธ์š”.

4. ๋ฌธ์ œ์— ๋Œ€ํ•œ ๋ช…ํ™•ํ•œ ์„ค๋ช… ์ž‘์„ฑ

๋ฐœ์ƒํ•œ ๋ฌธ์ œ์— ๋Œ€ํ•ด ๋ช…ํ™•ํ•˜๊ณ  ๊ฐ„๊ฒฐํ•˜๊ฒŒ ์„ค๋ช…ํ•˜์„ธ์š”. ์˜ˆ์ƒ๋˜๋Š” ๋™์ž‘๊ณผ ์‹ค์ œ๋กœ ๋ฐœ์ƒํ•œ ๋™์ž‘์„ ์„ค๋ช…ํ•˜์„ธ์š”. ํ•ด๋‹น๋˜๋Š” ๊ฒฝ์šฐ ๊ด€๋ จ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๋‚˜ ๋กœ๊ทธ๋ฅผ ํฌํ•จํ•˜์„ธ์š”.

5. ์˜ฌ๋ฐ”๋ฅธ ์ฝ”๋“œ ํ˜•์‹ ์ง€์ •

MRE๋ฅผ ์ œ์ถœํ•  ๋•Œ๋Š” ์ด์Šˆ ์„ค๋ช…์˜ ์ฝ”๋“œ ๋ธ”๋ก์„ ์‚ฌ์šฉํ•˜์—ฌ ์ฝ”๋“œ ํ˜•์‹์„ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์ง€์ •ํ•˜์„ธ์š”. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค์ด ์ฝ”๋“œ๋ฅผ ๋” ์‰ฝ๊ฒŒ ์ฝ๊ณ  ์ดํ•ดํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. GitHub์—์„œ๋Š” ์ฝ”๋“œ๋ฅผ ์„ธ ๊ฐœ์˜ ๋ฐฑํ‹ฑ(```)์œผ๋กœ ๊ฐ์‹ธ๊ณ  ์–ธ์–ด๋ฅผ ์ง€์ •ํ•˜์—ฌ ์ฝ”๋“œ ๋ธ”๋ก์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

# Your Python code goes here

6. MRE ํ…Œ์ŠคํŠธ

MRE๋ฅผ ์ œ์ถœํ•˜๊ธฐ ์ „์— ๋ฌธ์ œ๋ฅผ ์ •ํ™•ํ•˜๊ฒŒ ์žฌํ˜„ํ•˜๋Š”์ง€ ํ…Œ์ŠคํŠธํ•˜์„ธ์š”. ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค์ด ๋ฌธ์ œ๋‚˜ ์ˆ˜์ • ์—†์ด ์˜ˆ์ œ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”.

MRE์˜ ์˜ˆ

๋‹ค์Œ์€ ๊ฐ€์ƒ์˜ ๋ฒ„๊ทธ ๋ฆฌํฌํŠธ๋ฅผ ์œ„ํ•œ MRE์˜ ์˜ˆ์ž…๋‹ˆ๋‹ค:

๋ฒ„๊ทธ ์„ค๋ช…:

์‹คํ–‰ํ•  ๋•Œ detect.py ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ์ž…๋ ฅ tensor ์˜ ์น˜์ˆ˜์™€ ๊ด€๋ จ๋œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

MRE:

import torch
from ultralytics import YOLO

# Load the model
model = YOLO("yolov8n.pt")

# Load a 0-channel image
image = torch.rand(1, 0, 640, 640)

# Run the model
results = model(image)

์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€์ž…๋‹ˆ๋‹ค:

RuntimeError: Expected input[1, 0, 640, 640] to have 3 channels, but got 0 channels instead

์ข…์†์„ฑ:

  • torch==2.0.0
  • ultralytics==8.0.90

์ด ์˜ˆ์‹œ์—์„œ๋Š” ์ตœ์†Œํ•œ์˜ ์ฝ”๋“œ๋กœ ๋ฌธ์ œ๋ฅผ ์‹œ์—ฐํ•˜๊ณ , ๊ณต๊ฐœ ๋ชจ๋ธ('yolov8n.pt')์„ ์‚ฌ์šฉํ•˜๋ฉฐ, ํ•„์š”ํ•œ ๋ชจ๋“  ์ข…์†์„ฑ์„ ํฌํ•จํ•˜๊ณ , ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€์™€ ํ•จ๊ป˜ ๋ฌธ์ œ์— ๋Œ€ํ•œ ๋ช…ํ™•ํ•œ ์„ค๋ช…์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

์ด ๊ฐ€์ด๋“œ๋ผ์ธ์„ ๋”ฐ๋ฅด๋ฉด Ultralytics YOLO ๋ฆฌํฌ์ง€ํ† ๋ฆฌ์˜ ๊ด€๋ฆฌ์ž์™€ ๊ธฐ์—ฌ์ž๊ฐ€ ๋ฌธ์ œ๋ฅผ ๋” ํšจ์œจ์ ์œผ๋กœ ์ดํ•ดํ•˜๊ณ  ํ•ด๊ฒฐํ•˜๋Š” ๋ฐ ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค.



2023-11-12 ์ƒ์„ฑ๋จ, 2023-11-12 ์—…๋ฐ์ดํŠธ๋จ
์ž‘์„ฑ์ž: glenn-jocher (1)

๋Œ“๊ธ€