# 사용자 정의로 학습된 모델을 이용하여 샘플 애플리케이션 실행

이 예제에서는 사용자 정의로 학습된 YoloV8 모델을 사용합니다.

요구 조건

1. 애플리케이션/플러그인 코드를 개발하기 위해 확장 가능한 SDK(eSDK)를 설치합니다.

    eSDK를 설정하고 소스 코드를 다운로드 및 컴파일하는 방법에 대한 지침은 [Qualcomm 지능형 멀티미디어 소프트웨어 개발 키트(IM SDK) 빠른 시작 가이드](https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-51/introduction.html) 를 참조하세요.
2. [자체 AI/ML 애플리케이션 개발](https://docs.qualcomm.com/doc/80-70020-15BK/topic/develop-your-own-application.html) 에서 소스 코드를 다운로드하고 커스텀 참조 앱을 컴파일하는 방법에 대한 지침을 참조하세요.
3. [Qualcomm 신경망 처리 SDK용 모델 및 레이블 파일 다운로드](https://docs.qualcomm.com/doc/80-70020-15BK/topic/classify-objects-with-default-model.html#download-model-files) 를 진행합니다.

## 사용자 정의로 학습된 YoloV8 LiteRT 모델 사용

Qualcomm IM SDK 참조 애플리케이션은 객체 감지에 YoloV8 모델을 사용합니다. 이 예시에서는 사용자 정의로 학습된 YoloV8 변형을 사용해 보는 방법을 설명합니다.

다음 단계를 사용하여 현재 참조 애플리케이션에서 자체 커스텀 학습된 YoloV8 모델을 실행하세요.

1. 참조 앱에서 기존 모델을 새 모델로 대체합니다.
2. 커스텀 레이블로 레이블 파일을 수정합니다.
3. 수정된 모델로 참조 애플리케이션을 실행합니다.

### 레이블 수정

Qualcomm IM SDK와 해당 참조 앱을 사용할 때, 앱이 인식하는 특정 형식의 레이블을 사용해야 합니다. 이 레이블 파일 내에서 각 레이블에 대한 `<label_name>`, `<hex_value_for_label_id>`, `<hex_value_for_color>` 값을 업데이트해야 합니다.

레이블 파일 내에서 각 레이블의 형식은 아래에 표시된 템플릿을 따라야 합니다.

(structure)"<label_name>,id=(guint)<hex_value_for_label_id>,color=(guint)<hex_value_for_color>;"
    Copy to clipboard

예시:

(structure)"person,id=(guint)0x0,color=(guint)0x00FF00FF;"
    (structure)"bicycle,id=(guint)0x1,color=(guint)0x00FF00FF;"
    (structure)"car,id=(guint)0x2,color=(guint)0x0000FFFF;"
    (structure)"motorcycle,id=(guint)0x3,color=(guint)0x00FF00FF;"
    Copy to clipboard

### 커스텀 모델을 사용하여 객체 감지 실행

LiteRT 런타임을 사용하여 객체 감지 모델을 실행하려면 명령줄 매개변수에 커스텀 레이블 파일과 함께 사용자 정의로 학습된 모델을 지정하고 다음 명령어를 실행합니다.

1. 모델을 기기에 복사합니다.

scp yolov8_custom.tflite root@<IP address of the target device>:/etc/models/
        Copy to clipboard
2. 레이블을 기기에 복사합니다.

scp yolov8_custom.labels root@<IP address of the target device>:/etc/labels/
        Copy to clipboard
3. 기기에 로그인합니다.

ssh root@<IP address of the target device>
        Copy to clipboard
4. 아래에 표시된 대로 `/etc/configs/config_detection.json` 파일을 수정합니다.

{
        "file-path": "/etc/media/video.mp4",
        "ml-framework": "tflite",
        "yolo-model-type": "yolov8",
        "model": "/etc/models/yolov8_custom.tflite",
        "labels": "/etc/labels/yolov8_custom.labels",
        "constants": "<constants for custom YOLOv8 model>",
        "threshold": 40,
        "runtime": "dsp"
        }
        Copy to clipboard
5. 다음 명령어를 실행하여 Weston 서비스를 활성화합니다.

export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_ DISPLAY=wayland-1
        Copy to clipboard
6. 샘플 애플리케이션을 실행합니다.

gst-ai-object-detection --config-file=/etc/configs/config_detection.json
        Copy to clipboard

참고

- 사용 가능한 도움말 옵션을 표시하려면 다음 명령어를 실행하세요.

gst-ai-object-detection -h
        Copy to clipboard
- 사용 사례를 중지하려면 <kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">CTRL</kbd>+<kbd class="kbd docutils literal notranslate">C</kbd></kbd> 를 사용하세요.

Last Published: Dec 23, 2025

[Previous Topic
기본 모델을 사용하여 객체 분류](https://docs.qualcomm.com/bundle/publicresource/80-70020-15BK/topics/classify-objects-with-default-model.md) [Next Topic
Qualcomm Device Cloud를 사용하여 샘플 애플리케이션 실행](https://docs.qualcomm.com/bundle/publicresource/80-70020-15BK/topics/sample-app-qdc.md)