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

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


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

๋Œ“๊ธ€