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

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

Deploying advanced computer vision models like Ultralytics' YOLOv8 on Amazon SageMaker Endpoints opens up a wide range of possibilities for various machine learning applications. The key to effectively using these models lies in understanding their setup, configuration, and deployment processes. YOLOv8 becomes even more powerful when integrated seamlessly with Amazon SageMaker, a robust and scalable machine learning service by AWS.

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

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

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

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

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

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

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

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

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

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

  • Configured IAM Roles: You'll need an IAM role with the necessary permissions for Amazon SageMaker, AWS CloudFormation, and Amazon S3. This role should have policies that allow it to access these services.

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

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

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

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

๋‹ค์Œ ๋‹จ๊ณ„๋Š” ์„ธ์ด์ง€๋ฉ”์ด์ปค์— 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 ๋ฐฐํฌ ์Šคํฌ๋ฆฝํŠธ๋กœ ๋งŒ๋“  ๋…ธํŠธ๋ถ ์ธ์Šคํ„ด์Šค๋ฅผ ์ฐพ์Šต๋‹ˆ๋‹ค. ๋…ธํŠธ๋ถ ์ธ์Šคํ„ด์Šค๋ฅผ ์—ด์–ด Jupyter ํ™˜๊ฒฝ์— ์•ก์„ธ์Šคํ•ฉ๋‹ˆ๋‹ค.

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

import json


def output_fn(prediction_output, content_type):
    """Formats model outputs as JSON string according to content_type, extracting attributes like boxes, masks, keypoints."""
    print("Executing output_fn from inference.py ...")
    infer = {}
    for result in prediction_output:
        if result.boxes is not None:
            infer["boxes"] = result.boxes.numpy().data.tolist()
        if result.masks is not None:
            infer["masks"] = result.masks.numpy().data.tolist()
        if result.keypoints is not None:
            infer["keypoints"] = result.keypoints.numpy().data.tolist()
        if result.obb is not None:
            infer["obb"] = result.obb.numpy().data.tolist()
        if 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 ๋ชจ๋ธ์— ๋Œ€ํ•œ SageMaker ์—”๋“œํฌ์ธํŠธ๋ฅผ ๋งŒ๋“ค๊ณ  ๋ฐฐํฌํ•˜๋Š” ๊ณผ์ •์„ ์•ˆ๋‚ดํ•ฉ๋‹ˆ๋‹ค.

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

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

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

  • Run the Test Notebook: Follow the instructions within the notebook to test the deployed SageMaker endpoint. This includes sending an image to the endpoint and running inferences. Then, you'll plot the output to visualize the model's performance and accuracy, as shown below.

ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ 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 ํ†ตํ•ฉ ๊ฐ€์ด๋“œ ํŽ˜์ด์ง€๋ฅผ ๋ฐฉ๋ฌธํ•˜์—ฌ ๋จธ์‹ ๋Ÿฌ๋‹ ํ”„๋กœ์ ํŠธ๋ฅผ ํ–ฅ์ƒ์‹œํ‚ฌ ์ˆ˜ ์žˆ๋Š” ์ถ”๊ฐ€ ๋„๊ตฌ์™€ ๊ธฐ๋Šฅ์„ ์•Œ์•„๋ณด์„ธ์š”.



Created 2024-01-04, Updated 2024-06-02
Authors: glenn-jocher (6), sergiuwaxmann (1), abirami-vina (1)

๋Œ“๊ธ€