it
Computer Vision YOLO Scaling Strategy — วิธี

YOLO Object Detection

YOLO You Only Look Once Real-time Object Detection ตรวจจับวัตถุครั้งเดียว YOLOv8 Ultralytics Detection Segmentation Pose Estimation CCTV Autonomous Driving
เนื้อหาเกี่ยวข้อง — ดูเพิ่มเติมเรื่อง Apache Kafka Streams Observability Stack — คู่มือฉบับสมบูรณ์ 2026
Scale ได้หลายระดับ Model Nano Small Medium Large GPU TensorRT Kubernetes Batch Processing Edge Device Jetson Raspberry Pi
เนื้อหาเกี่ยวข้อง — บทความที่เกี่ยวข้อง: Certificate Manager DevSecOps Integration
| Model | Parameters | mAP | Speed (ms) | เหมาะกับ |
|---|---|---|---|---|
| YOLOv8n | 3.2M | 37.3 | 1.2 | Edge / Mobile |
| YOLOv8s | 11.2M | 44.9 | 2.1 | Edge / Light Server |
| YOLOv8m | 25.9M | 50.2 | 4.7 | Server |
| YOLOv8l | 43.7M | 52.9 | 7.1 | Server GPU |
| YOLOv8x | 68.2M | 53.9 | 10.8 | High Accuracy |

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 Signal
เนื้อหาเกี่ยวข้อง — ทำความเข้าใจ Grafana Mimir Metrics MLOps Workflow





