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

YOLOv5 AzureML์˜ ๐Ÿš€

์ด ๊ฐ€์ด๋“œ๋Š” AzureML ์ปดํ“จํŒ… ์ธ์Šคํ„ด์Šค์—์„œ YOLOv5 ์„ ์‚ฌ์šฉํ•˜๋Š” ๋น ๋ฅธ ์‹œ์ž‘ ๋ฐฉ๋ฒ•์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

์ด ๊ฐ€์ด๋“œ๋Š” ๋น ๋ฅธ ์ฒดํ—˜์„ ์œ„ํ•œ ๋น ๋ฅธ ์‹œ์ž‘์ž…๋‹ˆ๋‹ค. AzureML์˜ ๋ชจ๋“  ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋ ค๋ฉด ๋‹ค์Œ ์„ค๋ช…์„œ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”:

์ „์ œ ์กฐ๊ฑด

AzureML ์ž‘์—… ๊ณต๊ฐ„์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

์ปดํ“จํŒ… ์ธ์Šคํ„ด์Šค ๋งŒ๋“ค๊ธฐ

AzureML ์ž‘์—… ์˜์—ญ์—์„œ ์ปดํ“จํŒ… > ์ธ์Šคํ„ด์Šค ์ปดํ“จํŒ… > ์ƒˆ๋กœ ๋งŒ๋“ค๊ธฐ๋ฅผ ์„ ํƒํ•˜๊ณ  ํ•„์š”ํ•œ ๋ฆฌ์†Œ์Šค๊ฐ€ ์žˆ๋Š” ์ธ์Šคํ„ด์Šค๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

create-compute-arrow

ํ„ฐ๋ฏธ๋„ ์—ด๊ธฐ

์ด์ œ ๋…ธํŠธ๋ถ ๋ณด๊ธฐ์—์„œ ํ„ฐ๋ฏธ๋„์„ ์—ด๊ณ  ์ปดํ“จํŒ…์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.

ํ„ฐ๋ฏธ๋„ ํ™”์‚ดํ‘œ ์—ด๊ธฐ

์„ค์ • ๋ฐ ์‹คํ–‰ YOLOv5

์ด์ œ ๊ฐ€์ƒ ํ™˜๊ฒฝ์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

conda create --name yolov5env -y
conda activate yolov5env
conda install pip -y

YOLOv5 ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋ฅผ ํ•˜์œ„ ๋ชจ๋“ˆ๊ณผ ํ•จ๊ป˜ ๋ณต์ œํ•ฉ๋‹ˆ๋‹ค:

git clone https://github.com/ultralytics/yolov5
cd yolov5
git submodule update --init --recursive # Note that you might have a message asking you to add your folder as a safe.directory just copy the recommended command

ํ•„์š”ํ•œ ์ข…์†์„ฑ์„ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค:

pip install -r yolov5/requirements.txt
pip install onnx>=1.10.0

YOLOv5 ๋ชจ๋ธ์„ ํ•™์Šต์‹œํ‚ต๋‹ˆ๋‹ค:

python train.py

์ •๋ฐ€๋„, ๋ฆฌ์ฝœ ๋ฐ mAP์— ๋Œ€ํ•œ ๋ชจ๋ธ ๊ฒ€์ฆ

python val.py --weights yolov5s.pt

์ด๋ฏธ์ง€์™€ ๋™์˜์ƒ์—์„œ ์ถ”๋ก ์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค:

python detect.py --weights yolov5s.pt --source path/to/images

๋‹ค๋ฅธ ํ˜•์‹์œผ๋กœ ๋ชจ๋ธ์„ ๋‚ด๋ณด๋ƒ…๋‹ˆ๋‹ค:

python detect.py --weights yolov5s.pt --source path/to/images

๋…ธํŠธ๋ถ ์‚ฌ์šฉ ์‹œ ์ฐธ๊ณ  ์‚ฌํ•ญ

๋…ธํŠธ๋ถ์—์„œ ์ด๋Ÿฌํ•œ ๋ช…๋ น์„ ์‹คํ–‰ํ•˜๋ ค๋ฉด ์ƒˆ ์ปค๋„์„ ๋งŒ๋“ค๊ณ  ๋…ธํŠธ๋ถ ์ƒ๋‹จ์—์„œ ์ƒˆ ์ปค๋„์„ ์„ ํƒํ•ด์•ผ ํ•œ๋‹ค๋Š” ์ ์— ์œ ์˜ํ•˜์„ธ์š”.

Python ์…€์„ ๋งŒ๋“ค๋ฉด ์ž๋™์œผ๋กœ ์‚ฌ์šฉ์ž ์ง€์ • ํ™˜๊ฒฝ์ด ์‚ฌ์šฉ๋˜์ง€๋งŒ bash ์…€์„ ์ถ”๊ฐ€ํ•˜๋Š” ๊ฒฝ์šฐ source activate <your-env> ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์‚ฌ์šฉ์ž ์ง€์ • ํ™˜๊ฒฝ์„ ์‚ฌ์šฉํ•˜๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด

%%bash
source activate newenv
python val.py --weights yolov5s.pt


Created 2023-11-12, Updated 2024-06-02
Authors: glenn-jocher (3), ouphi (1)

๋Œ“๊ธ€