Skip to content

20250414-모델 변경 최적화-심승빈 #3

@bert13069598

Description

@bert13069598

모델 변경 최적화

1. 연구 일자

2025-04-14

2. 연구 참여자

  • 심승빈

3. 연구 목표

  • 실시간 프로세스에 영향을 미치지 않는 모델 교체

4. 연구 내용 및 수행 과정

  • 코루틴을 이용한 모델 교체

5. 결과 및 분석

모델 로드까지는 메인 프로세스에 큰 영향이 없었으나 역직렬화 과정에서 GPU를 사용함에 따라 fps 3으로 급감 확인
이후 모델 x 로 변경되면서 fps 감소

27 0.00000 + 0.00870 + 0.00558
32 0.00000 + 0.00870 + 0.00546
33 0.00000 + 0.00870 + 0.00551
start swap
30 0.00017 + 0.00878 + 0.00560
31 0.00006 + 0.00873 + 0.00559
30 0.00006 + 0.00873 + 0.00555
31 0.00006 + 0.00872 + 0.00551
31 0.00006 + 0.00877 + 0.00554
start deserialization
start deserialization
start deserialization
start deserialization
3 0.00011 + 0.01744 + 0.08871
32 0.00012 + 0.00892 + 0.00546
31 0.00012 + 0.00887 + 0.00550
swap yolov8x-obb done 0.01771 + 0.00006
16 0.01781 + 0.02117 + 0.00555
23 0.00000 + 0.02126 + 0.00551
22 0.00000 + 0.02128 + 0.00552
23 0.00000 + 0.02126 + 0.00551

6. 향후 연구 계획

  • 멀티 프로세스를 이용하여 교체 영향 최소화

7. 첨부 파일/자료 링크

import asyncio

class YOLO_OBB_TRT:
    def __init__(self):
        self.engine = None
        self.load_task = asyncio.create_task(self.load_model())

    async def load_model(self):
        print("🛠️ 모델 로드 중...")
        await asyncio.sleep(3)
        print("✅ 모델 로드 끝!")
        return "MODEL_ENGINE"

    async def run(self):
        for i in range(10):
            await asyncio.sleep(1)
            print(f"🔁 반복 {i}")

            if self.load_task is not None and self.load_task.done():
                self.engine = self.load_task.result()
                self.load_task = None
                print("🎉 모델 로드 완료 → 엔진 연결됨!")

            if self.engine:
                print(f"📦 추론 처리 가능!")
            else:
                print(f"⌛ 아직 로딩 중...")

async def main():
    model = YOLO_OBB_TRT()
    await model.run()

asyncio.run(main())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions