it

Computer Vision YOLO Scaling Strategy — วิธี

computer vision yolo scaling strategy วธ scale
Computer Vision YOLO Scaling Strategy — วิธี

YOLO Object Detection

Computer Vision YOLO Scaling Strategy — วิธี

YOLO You Only Look Once Real-time Object Detection ตรวจจับวัตถุครั้งเดียว YOLOv8 Ultralytics Detection Segmentation Pose Estimation CCTV Autonomous Driving

Scale ได้หลายระดับ Model Nano Small Medium Large GPU TensorRT Kubernetes Batch Processing Edge Device Jetson Raspberry Pi

ModelParametersmAPSpeed (ms)เหมาะกับ
YOLOv8n3.2M37.31.2Edge / Mobile
YOLOv8s11.2M44.92.1Edge / Light Server
YOLOv8m25.9M50.24.7Server
YOLOv8l43.7M52.97.1Server GPU
YOLOv8x68.2M53.910.8High Accuracy
Computer Vision YOLO Scaling Strategy — วิธี

Performance Optimization

# optimization.py — YOLO Performance Optimization

optimizations = {

    "TensorRT FP16": {

        "speedup": "2-3x faster",

        "accuracy_loss": "< 0.5% mAP",

        "command": "yolo export model=yolov8m.pt format=engine half=True",

        "requirement": "NVIDIA GPU (Compute Capability >= 7.0)",

    },

    "TensorRT INT8": {

        "speedup": "3-5x faster",

        "accuracy_loss": "1-2% mAP",

        "command": "yolo export model=yolov8m.pt format=engine int8=True data=coco.yaml",

        "requirement": "Calibration Dataset needed",

    },

    "ONNX Runtime": {

        "speedup": "1.5-2x faster (CPU)",

        "accuracy_loss": "0%",

        "command": "yolo export model=yolov8m.pt format=onnx simplify=True",

        "requirement": "onnxruntime / onnxruntime-gpu",

    },

    "OpenVINO": {

        "speedup": "2-3x faster (Intel CPU)",

        "accuracy_loss": "< 0.5%",

        "command": "yolo export model=yolov8m.pt format=openvino half=True",

        "requirement": "Intel CPU/iGPU",

    },

    "Image Resize": {

        "speedup": "640->320 = 2-4x faster",

        "accuracy_loss": "5-10% mAP",

        "command": "model.predict(source, imgsz=320)",

        "requirement": "ลด Input Resolution",

    },

    "Batch Inference": {

        "speedup": "2-4x throughput",

        "accuracy_loss": "0%",

        "command": "model.predict(sources, batch=16)",

        "requirement": "GPU Memory เพียงพอ",

    },

}



print("YOLO Performance Optimizations:")

for name, info in optimizations.items():

    print(f"\n  [{name}]")

    print(f"    Speedup: {info['speedup']}")

    print(f"    Accuracy Loss: {info['accuracy_loss']}")

    print(f"    Command: {info['command']}")

    print(f"    Requirement: {info['requirement']}")



# GPU Comparison

gpus = {

    "Jetson Nano": {"VRAM": "4GB", "YOLOv8n": "15 FPS", "cost": "$200"},

    "Jetson Orin": {"VRAM": "8-32GB", "YOLOv8n": "60 FPS", "cost": "$500-2000"},

    "T4": {"VRAM": "16GB", "YOLOv8m": "80 FPS", "cost": "$0.5/hr (Cloud)"},

    "A10G": {"VRAM": "24GB", "YOLOv8m": "150 FPS", "cost": "$1/hr (Cloud)"},

    "RTX 4090": {"VRAM": "24GB", "YOLOv8m": "200 FPS", "cost": "$1,599"},

    "A100": {"VRAM": "80GB", "YOLOv8l": "250 FPS", "cost": "$3/hr (Cloud)"},

}



print(f"\n\nGPU Comparison for YOLO:")

for gpu, info in gpus.items():

    print(f"  {gpu:<14} VRAM: {info['VRAM']:<8} Speed: {info.get('YOLOv8m', info.get('YOLOv8n', info.get('YOLOv8l', 'N/A'))):<10} Cost: {info['cost']}")

เคล็ดลับ

  • TensorRT: Export YOLO เป็น TensorRT FP16 เร็วขึ้น 2-3 เท่า
  • Model Size: เลือกขนาดตามงาน Nano สำหรับ Edge Large สำหรับ Server
  • Batch: ใช้ Batch Inference เพิ่ม Throughput 2-4 เท่า
  • Queue: ใช้ Redis/Kafka Buffer Requests ป้องกัน Overload
  • HPA: ใช้ Kubernetes HPA Scale Pods ตาม GPU Utilization
  • Monitor: ติดตาม FPS Latency GPU Memory ด้วย Prometheus

YOLO คืออะไร

You Only Look Once Real-time Object Detection ตรวจจับวัตถุครั้งเดียว YOLOv8 Ultralytics Detection Segmentation Pose CCTV Autonomous Driving Quality Inspection

XM Legend · เทรดเดอร์ & ผู้สอน Forex 13 ปี

ผู้ก่อตั้ง SiamCafe ตั้งแต่ปี 1997 · เทรดเดอร์สาย Forex มากกว่า 13 ปี ได้รับการยกย่องเป็น XM Legend · แบ่งปันความรู้ Forex, ไอที, AI และการเทรด จากประสบการณ์จริงในตลาดจริง