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

์•„๋งˆ์กด ์„ธ์ด์ง€๋ฉ”์ด์ปค ์—”๋“œํฌ์ธํŠธ์— YOLOv8 ๋ฐฐํฌ ๊ฐ€์ด๋“œ

Ultralytics' YOLOv8 ๊ณผ ๊ฐ™์€ ๊ณ ๊ธ‰ ์ปดํ“จํ„ฐ ๋น„์ „ ๋ชจ๋ธ์„ Amazon SageMaker ์—”๋“œํฌ์ธํŠธ์— ๋ฐฐํฌํ•˜๋ฉด ๋‹ค์–‘ํ•œ ๋จธ์‹  ๋Ÿฌ๋‹ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์— ๋Œ€ํ•œ ๊ด‘๋ฒ”์œ„ํ•œ ๊ฐ€๋Šฅ์„ฑ์ด ์—ด๋ฆฝ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ๋ชจ๋ธ์„ ํšจ๊ณผ์ ์œผ๋กœ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ํ•ต์‹ฌ์€ ์„ค์ •, ๊ตฌ์„ฑ, ๋ฐฐํฌ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ดํ•ดํ•˜๋Š” ๋ฐ ์žˆ์Šต๋‹ˆ๋‹ค. YOLOv8 ๋Š” AWS์˜ ๊ฐ•๋ ฅํ•˜๊ณ  ํ™•์žฅ ๊ฐ€๋Šฅํ•œ ๋จธ์‹  ๋Ÿฌ๋‹ ์„œ๋น„์Šค์ธ Amazon SageMaker์™€ ์›ํ™œํ•˜๊ฒŒ ํ†ตํ•ฉ๋˜๋ฉด ๋”์šฑ ๊ฐ•๋ ฅํ•ด์ง‘๋‹ˆ๋‹ค.

์ด ๊ฐ€์ด๋“œ๋Š” Amazon SageMaker ์—”๋“œํฌ์ธํŠธ์— YOLOv8 PyTorch ๋ชจ๋ธ์„ ๋ฐฐํฌํ•˜๋Š” ๊ณผ์ •์„ ๋‹จ๊ณ„๋ณ„๋กœ ์•ˆ๋‚ดํ•ฉ๋‹ˆ๋‹ค. AWS ํ™˜๊ฒฝ์„ ์ค€๋น„ํ•˜๊ณ , ๋ชจ๋ธ์„ ์ ์ ˆํ•˜๊ฒŒ ๊ตฌ์„ฑํ•˜๊ณ , ๋ฐฐํฌ๋ฅผ ์œ„ํ•ด AWS CloudFormation ๋ฐ AWS ํด๋ผ์šฐ๋“œ ๊ฐœ๋ฐœ ํ‚คํŠธ(CDK)์™€ ๊ฐ™์€ ๋„๊ตฌ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฐ ํ•„์š”ํ•œ ํ•„์ˆ˜ ์‚ฌํ•ญ์„ ๋ฐฐ์šฐ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

์•„๋งˆ์กด ์„ธ์ด์ง€๋ฉ”์ด์ปค

์•„๋งˆ์กด ์„ธ์ด์ง€๋ฉ”์ด์ปค ๊ฐœ์š”

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

Amazon SageMaker ์—”๋“œํฌ์ธํŠธ์— YOLOv8 ๋ฐฐํฌํ•˜๊ธฐ

Amazon SageMaker์— YOLOv8 ์„ ๋ฐฐํฌํ•˜๋ฉด ์‹ค์‹œ๊ฐ„ ์ถ”๋ก ์„ ์œ„ํ•ด ๊ด€๋ฆฌํ˜• ํ™˜๊ฒฝ์„ ์‚ฌ์šฉํ•˜๊ณ  ์ž๋™ ํ™•์žฅ ๋“ฑ์˜ ๊ธฐ๋Šฅ์„ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์—์„œ AWS ์•„ํ‚คํ…์ฒ˜๋ฅผ ์‚ดํŽด๋ณด์„ธ์š”.

AWS ์•„ํ‚คํ…์ฒ˜

1๋‹จ๊ณ„: AWS ํ™˜๊ฒฝ ์„ค์ •

๋จผ์ € ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ „์ œ ์กฐ๊ฑด์ด ๊ฐ–์ถ”์–ด์ ธ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜์„ธ์š”:

  • AWS ๊ณ„์ •: ์•„์ง ๊ณ„์ •์ด ์—†๋Š” ๊ฒฝ์šฐ AWS ๊ณ„์ •์— ๊ฐ€์ž…ํ•˜์„ธ์š”.

  • ๊ตฌ์„ฑ๋œ IAM ์—ญํ• : Amazon SageMaker, AWS CloudFormation ๋ฐ Amazon S3์— ํ•„์š”ํ•œ ๊ถŒํ•œ์ด ์žˆ๋Š” IAM ์—ญํ• ์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์ด ์—ญํ• ์—๋Š” ์ด๋Ÿฌํ•œ ์„œ๋น„์Šค์— ์•ก์„ธ์Šคํ•  ์ˆ˜ ์žˆ๋Š” ์ •์ฑ…์ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

  • AWS CLI: ์•„์ง ์„ค์น˜ํ•˜์ง€ ์•Š์€ ๊ฒฝ์šฐ, AWS ๋ช…๋ น์ค„ ์ธํ„ฐํŽ˜์ด์Šค(CLI)๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜์—ฌ ์„ค์น˜ํ•˜๊ณ  ๊ณ„์ • ์„ธ๋ถ€ ์ •๋ณด๋กœ ๊ตฌ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์„ค์น˜ ๋ฐฉ๋ฒ•์€ AWS CLI ์ง€์นจ์„ ๋”ฐ๋ฅด์„ธ์š”.

  • AWS CDK: ์•„์ง ์„ค์น˜ํ•˜์ง€ ์•Š์€ ๊ฒฝ์šฐ, ๋ฐฐํฌ ์Šคํฌ๋ฆฝํŒ…์— ์‚ฌ์šฉํ•  AWS ํด๋ผ์šฐ๋“œ ๊ฐœ๋ฐœ ํ‚คํŠธ(CDK)๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค. ์„ค์น˜ ๋ฐฉ๋ฒ•์€ AWS CDK ์ง€์นจ์„ ๋”ฐ๋ฅด์„ธ์š”.

  • ์ ์ ˆํ•œ ์„œ๋น„์Šค ํ• ๋‹น๋Ÿ‰: Amazon SageMaker์—์„œ ๋‘ ๊ฐœ์˜ ๊ฐœ๋ณ„ ๋ฆฌ์†Œ์Šค, ์ฆ‰ ์—”๋“œํฌ์ธํŠธ ์‚ฌ์šฉ์„ ์œ„ํ•œ ml.m5.4xlarge์™€ ๋…ธํŠธ๋ถ ์ธ์Šคํ„ด์Šค ์‚ฌ์šฉ์„ ์œ„ํ•œ ml.m5.4xlarge์— ๋Œ€ํ•œ ์ถฉ๋ถ„ํ•œ ์ฟผํ„ฐ๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ์ด๋“ค ๊ฐ๊ฐ์—๋Š” ์ตœ์†Œ ํ•˜๋‚˜์˜ ํ• ๋‹น๋Ÿ‰ ๊ฐ’์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ํ˜„์žฌ ํ• ๋‹น๋Ÿ‰์ด ์ด ์š”๊ตฌ ์‚ฌํ•ญ๋ณด๋‹ค ์ ๋‹ค๋ฉด ๊ฐ๊ฐ์— ๋Œ€ํ•ด ํ• ๋‹น๋Ÿ‰ ์ฆ๊ฐ€๋ฅผ ์š”์ฒญํ•˜๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค. AWS ์„œ๋น„์Šค ํ• ๋‹น๋Ÿ‰ ์„ค๋ช…์„œ์˜ ์ž์„ธํ•œ ์ง€์นจ์— ๋”ฐ๋ผ ํ• ๋‹น๋Ÿ‰ ์ฆ๋Ÿ‰์„ ์š”์ฒญํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

2๋‹จ๊ณ„: YOLOv8 ์„ธ์ด์ง€๋ฉ”์ด์ปค ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋ณต์ œํ•˜๊ธฐ

๋‹ค์Œ ๋‹จ๊ณ„๋Š” SageMaker์— YOLOv8 ๋ฐฐํฌ๋ฅผ ์œ„ํ•œ ๋ฆฌ์†Œ์Šค๊ฐ€ ํฌํ•จ๋œ ํŠน์ • AWS ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋ฅผ ๋ณต์ œํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์ด ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋Š” GitHub์—์„œ ํ˜ธ์ŠคํŒ…๋˜๋ฉฐ ํ•„์š”ํ•œ CDK ์Šคํฌ๋ฆฝํŠธ ๋ฐ ๊ตฌ์„ฑ ํŒŒ์ผ์ด ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

  • GitHub ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋ฅผ ๋ณต์ œํ•ฉ๋‹ˆ๋‹ค: ํ„ฐ๋ฏธ๋„์—์„œ ๋‹ค์Œ ๋ช…๋ น์„ ์‹คํ–‰ํ•˜์—ฌ ํ˜ธ์ŠคํŠธ-yolov8-์˜จ-์„ธ๊ทธ๋ฉ”์ด์ปค-์—”๋“œํฌ์ธํŠธ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋ฅผ ๋ณต์ œํ•ฉ๋‹ˆ๋‹ค:
git clone https://github.com/aws-samples/host-yolov8-on-sagemaker-endpoint.git
  • ๋ณต์ œ๋œ ๋””๋ ‰ํ† ๋ฆฌ๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค: ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ๋ณต์ œ๋œ ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋กœ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค:
cd host-yolov8-on-sagemaker-endpoint/yolov8-pytorch-cdk

3๋‹จ๊ณ„: CDK ํ™˜๊ฒฝ ์„ค์ •

์ด์ œ ํ•„์š”ํ•œ ์ฝ”๋“œ๊ฐ€ ์ค€๋น„๋˜์—ˆ์œผ๋ฏ€๋กœ AWS CDK๋กœ ๋ฐฐํฌํ•  ํ™˜๊ฒฝ์„ ์„ค์ •ํ•˜์„ธ์š”.

  • Python ๊ฐ€์ƒ ํ™˜๊ฒฝ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค: Python ํ™˜๊ฒฝ๊ณผ ์ข…์†์„ฑ์„ ๊ฒฉ๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ์‹คํ–‰:
python3 -m venv .venv
  • ๊ฐ€์ƒ ํ™˜๊ฒฝ์„ ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค:
source .venv/bin/activate
  • ์ข…์† ์š”์†Œ๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค: ํ”„๋กœ์ ํŠธ์— ํ•„์š”ํ•œ Python ์ข…์† ์š”์†Œ๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค:
pip3 install -r requirements.txt
  • AWS CDK ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์—…๊ทธ๋ ˆ์ด๋“œ: ์ตœ์‹  ๋ฒ„์ „์˜ AWS CDK ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค:
pip install --upgrade aws-cdk-lib

4๋‹จ๊ณ„: AWS CloudFormation ์Šคํƒ ๋งŒ๋“ค๊ธฐ

  • CDK ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ํ•ฉ์„ฑํ•ฉ๋‹ˆ๋‹ค: CDK ์ฝ”๋“œ์—์„œ AWS CloudFormation ํ…œํ”Œ๋ฆฟ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค:
cdk synth
  • CDK ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๋ถ€ํŠธ์ŠคํŠธ๋žฉ: CDK ๋ฐฐํฌ๋ฅผ ์œ„ํ•ด AWS ํ™˜๊ฒฝ์„ ์ค€๋น„ํ•ฉ๋‹ˆ๋‹ค:
cdk bootstrap
  • ์Šคํƒ์„ ๋ฐฐํฌํ•ฉ๋‹ˆ๋‹ค: ํ•„์š”ํ•œ AWS ๋ฆฌ์†Œ์Šค๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ๋ชจ๋ธ์„ ๋ฐฐํฌํ•ฉ๋‹ˆ๋‹ค:
cdk deploy

5๋‹จ๊ณ„: YOLOv8 ๋ชจ๋ธ ๋ฐฐํฌ

๋ฐฐํฌ ์ง€์นจ์„ ์‚ดํŽด๋ณด๊ธฐ ์ „์— Ultralytics ์—์„œ ์ œ๊ณตํ•˜๋Š” ๋‹ค์–‘ํ•œ YOLOv8 ๋ชจ๋ธ์„ ํ™•์ธํ•˜์„ธ์š”. ํ”„๋กœ์ ํŠธ ์š”๊ตฌ์‚ฌํ•ญ์— ๊ฐ€์žฅ ์ ํ•ฉํ•œ ๋ชจ๋ธ์„ ์„ ํƒํ•˜๋Š” ๋ฐ ๋„์›€์ด ๋  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

AWS ํด๋ผ์šฐ๋“œํฌ๋ฉ”์ด์…˜ ์Šคํƒ์„ ์ƒ์„ฑํ•œ ํ›„ ๋‹ค์Œ ๋‹จ๊ณ„๋Š” YOLOv8 ์„ ๋ฐฐํฌํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

  • ๋…ธํŠธ๋ถ ์ธ์Šคํ„ด์Šค๋ฅผ ์—ฝ๋‹ˆ๋‹ค: AWS ์ฝ˜์†”๋กœ ์ด๋™ํ•ด Amazon SageMaker ์„œ๋น„์Šค๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค. ๋Œ€์‹œ๋ณด๋“œ์—์„œ "๋…ธํŠธ๋ถ ์ธ์Šคํ„ด์Šค"๋ฅผ ์„ ํƒํ•œ ๋‹ค์Œ, CDK ๋ฐฐํฌ ์Šคํฌ๋ฆฝํŠธ๋กœ ๋งŒ๋“  ๋…ธํŠธ๋ถ ์ธ์Šคํ„ด์Šค๋ฅผ ์ฐพ์Šต๋‹ˆ๋‹ค. ๋…ธํŠธ๋ถ ์ธ์Šคํ„ด์Šค๋ฅผ ์—ด์–ด ์ฃผํ”ผํ„ฐ ํ™˜๊ฒฝ์— ์•ก์„ธ์Šคํ•ฉ๋‹ˆ๋‹ค.

  • inference.py์— ์•ก์„ธ์Šคํ•˜๊ณ  ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค: Jupyter์—์„œ SageMaker ๋…ธํŠธ๋ถ ์ธ์Šคํ„ด์Šค๋ฅผ ์—ฐ ํ›„, inference.py ํŒŒ์ผ์„ ์ฐพ์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์ด inference.py์˜ output_fn ํ•จ์ˆ˜๋ฅผ ํŽธ์ง‘ํ•˜๊ณ  ๊ตฌ๋ฌธ ์˜ค๋ฅ˜๊ฐ€ ์—†๋Š”์ง€ ํ™•์ธํ•˜๋ฉด์„œ ๋ณ€๊ฒฝ ๋‚ด์šฉ์„ ์Šคํฌ๋ฆฝํŠธ์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.

def output_fn(prediction_output, content_type):
    print("Executing output_fn from inference.py ...")
    infer = {}
    for result in prediction_output:
        if 'boxes' in result._keys and result.boxes is not None:
            infer['boxes'] = result.boxes.numpy().data.tolist()
        if 'masks' in result._keys and result.masks is not None:
            infer['masks'] = result.masks.numpy().data.tolist()
        if 'keypoints' in result._keys and result.keypoints is not None:
            infer['keypoints'] = result.keypoints.numpy().data.tolist()
        if 'probs' in result._keys and result.probs is not None:
            infer['probs'] = result.probs.numpy().data.tolist()
    return json.dumps(infer)
  • 1_DeployEndpoint.ipynb๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์—”๋“œํฌ์ธํŠธ ๋ฐฐํฌ: Jupyter ํ™˜๊ฒฝ์—์„œ sm-notebook ๋””๋ ‰ํ„ฐ๋ฆฌ์— ์žˆ๋Š” 1_DeployEndpoint.ipynb ๋…ธํŠธ๋ถ์„ ์—ฝ๋‹ˆ๋‹ค. ๋…ธํŠธ๋ถ์˜ ์ง€์นจ์— ๋”ฐ๋ผ ์…€์„ ์‹คํ–‰ํ•˜์—ฌ YOLOv8 ๋ชจ๋ธ์„ ๋‹ค์šด๋กœ๋“œํ•˜๊ณ , ์—…๋ฐ์ดํŠธ๋œ ์ถ”๋ก  ์ฝ”๋“œ์™€ ํ•จ๊ป˜ ํŒจํ‚ค์ง•ํ•œ ๋‹ค์Œ, Amazon S3 ๋ฒ„ํ‚ท์— ์—…๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค. ์ด ๋…ธํŠธ๋ถ์€ YOLOv8 ๋ชจ๋ธ์— ๋Œ€ํ•œ ์„ธ์ด์ง€๋ฉ”์ด์ปค ์—”๋“œํฌ์ธํŠธ๋ฅผ ๋งŒ๋“ค๊ณ  ๋ฐฐํฌํ•˜๋Š” ๊ณผ์ •์„ ์•ˆ๋‚ดํ•ฉ๋‹ˆ๋‹ค.

6๋‹จ๊ณ„: ๋ฐฐํฌ ํ…Œ์ŠคํŠธ

์ด์ œ YOLOv8 ๋ชจ๋ธ์ด ๋ฐฐํฌ๋˜์—ˆ์œผ๋ฏ€๋กœ ์„ฑ๋Šฅ๊ณผ ๊ธฐ๋Šฅ์„ ํ…Œ์ŠคํŠธํ•˜๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.

  • ํ…Œ์ŠคํŠธ ๋…ธํŠธ๋ถ์„ ์—ฝ๋‹ˆ๋‹ค: ๋™์ผํ•œ Jupyter ํ™˜๊ฒฝ์—์„œ sm-notebook ๋””๋ ‰ํ„ฐ๋ฆฌ์—์„œ 2_TestEndpoint.ipynb ๋…ธํŠธ๋ถ์„ ์ฐพ์•„ ์—ฝ๋‹ˆ๋‹ค.

  • ํ…Œ์ŠคํŠธ ๋…ธํŠธ๋ถ์„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค: ๋…ธํŠธ๋ถ์˜ ์ง€์นจ์— ๋”ฐ๋ผ ๋ฐฐํฌ๋œ SageMaker ์—”๋“œํฌ์ธํŠธ๋ฅผ ํ…Œ์ŠคํŠธํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—๋Š” ์—”๋“œํฌ์ธํŠธ๋กœ ์ด๋ฏธ์ง€ ์ „์†ก ๋ฐ ์ถ”๋ก  ์‹คํ–‰์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ ์•„๋ž˜์™€ ๊ฐ™์ด ๋ชจ๋ธ์˜ ์„ฑ๋Šฅ๊ณผ ์ •ํ™•๋„๋ฅผ ์‹œ๊ฐํ™”ํ•˜๊ธฐ ์œ„ํ•ด ์ถœ๋ ฅ์„ ํ”Œ๋กœํŒ…ํ•ฉ๋‹ˆ๋‹ค.

ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ YOLOv8

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

7๋‹จ๊ณ„: ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ ๊ด€๋ฆฌ

ํ…Œ์ŠคํŠธ ํ›„์—๋Š” ๋ฐฐํฌ๋œ ๋ชจ๋ธ์„ ์ง€์†์ ์œผ๋กœ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๋Š” ๊ฒƒ์ด ํ•„์ˆ˜์ ์ž…๋‹ˆ๋‹ค.

  • Amazon CloudWatch๋กœ ๋ชจ๋‹ˆํ„ฐ๋งํ•˜์„ธ์š”: Amazon CloudWatch๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ SageMaker ์—”๋“œํฌ์ธํŠธ์˜ ์„ฑ๋Šฅ๊ณผ ์ƒํƒœ๋ฅผ ์ •๊ธฐ์ ์œผ๋กœ ํ™•์ธํ•˜์„ธ์š”.

  • ์—”๋“œํฌ์ธํŠธ ๊ด€๋ฆฌ: ์—”๋“œํฌ์ธํŠธ์˜ ์ง€์†์ ์ธ ๊ด€๋ฆฌ๋ฅผ ์œ„ํ•ด SageMaker ์ฝ˜์†”์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—๋Š” ํ•„์š”์— ๋”ฐ๋ผ ๋ชจ๋ธ์„ ํ™•์žฅ, ์—…๋ฐ์ดํŠธ ๋˜๋Š” ์žฌ๋ฐฐํฌํ•˜๋Š” ๊ฒƒ์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

์ด ๋‹จ๊ณ„๋ฅผ ์™„๋ฃŒํ•˜๋ฉด Amazon ์„ธ์ด์ง€๋ฉ”์ด์ปค ์—”๋“œํฌ์ธํŠธ์—์„œ YOLOv8 ๋ชจ๋ธ์„ ์„ฑ๊ณต์ ์œผ๋กœ ๋ฐฐํฌํ•˜๊ณ  ํ…Œ์ŠคํŠธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ํ”„๋กœ์„ธ์Šค๋ฅผ ํ†ตํ•ด ๋จธ์‹  ๋Ÿฌ๋‹ ๋ฐฐํฌ๋ฅผ ์œ„ํ•œ AWS ์„œ๋น„์Šค ์‚ฌ์šฉ์— ๋Œ€ํ•œ ์‹ค๋ฌด ๊ฒฝํ—˜์„ ์Œ“์„ ์ˆ˜ ์žˆ์„ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ํ–ฅํ›„ ๋‹ค๋ฅธ ๊ณ ๊ธ‰ ๋ชจ๋ธ์„ ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋ฐ˜์„ ๋งˆ๋ จํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์š”์•ฝ

์ด ๊ฐ€์ด๋“œ๋Š” AWS CloudFormation ๋ฐ AWS ํด๋ผ์šฐ๋“œ ๊ฐœ๋ฐœ ํ‚คํŠธ(CDK)๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ Amazon SageMaker ์—”๋“œํฌ์ธํŠธ์— YOLOv8 ๋ฅผ ๋ฐฐํฌํ•˜๋Š” ๊ณผ์ •์„ ๋‹จ๊ณ„๋ณ„๋กœ ์•ˆ๋‚ดํ•ฉ๋‹ˆ๋‹ค. ์ด ํ”„๋กœ์„ธ์Šค์—๋Š” ํ•„์š”ํ•œ GitHub ๋ฆฌํฌ์ง€ํ† ๋ฆฌ ๋ณต์ œ, CDK ํ™˜๊ฒฝ ์„ค์ •, AWS ์„œ๋น„์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋ชจ๋ธ ๋ฐฐํฌ, SageMaker์—์„œ ์„ฑ๋Šฅ ํ…Œ์ŠคํŠธ๊ฐ€ ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

์ž์„ธํ•œ ๊ธฐ์ˆ  ์ •๋ณด๋Š” AWS ๋จธ์‹  ๋Ÿฌ๋‹ ๋ธ”๋กœ๊ทธ์˜ ์ด ๋ฌธ์„œ๋ฅผ ์ฐธ์กฐํ•˜์„ธ์š”. ๋‹ค์–‘ํ•œ ํŠน์ง•๊ณผ ๊ธฐ๋Šฅ์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ Amazon SageMaker ๊ณต์‹ ๋ฌธ์„œ์—์„œ ํ™•์ธํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

๋‹ค์–‘ํ•œ YOLOv8 ํ†ตํ•ฉ์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ณ  ์‹ถ์œผ์‹ ๊ฐ€์š”? Ultralytics ํ†ตํ•ฉ ๊ฐ€์ด๋“œ ํŽ˜์ด์ง€๋ฅผ ๋ฐฉ๋ฌธํ•˜์—ฌ ๋จธ์‹ ๋Ÿฌ๋‹ ํ”„๋กœ์ ํŠธ๋ฅผ ํ–ฅ์ƒ์‹œํ‚ฌ ์ˆ˜ ์žˆ๋Š” ์ถ”๊ฐ€ ๋„๊ตฌ์™€ ๊ธฐ๋Šฅ์„ ์‚ดํŽด๋ณด์„ธ์š”.



์ƒ์„ฑ๋จ 2024-01-04, ์—…๋ฐ์ดํŠธ๋จ 2024-01-07
์ž‘์„ฑ์ž: glenn-jocher (1), abirami-vina (1)

๋Œ“๊ธ€