YOLO
You only look once (YOLO) is a state-of-the-art, real-time object detection system. On a Titan X it processes images at 40-90 FPS and has a mAP on VOC 2007 of 78.6% and a mAP of 48.1% on COCO test-dev.
Categories
- YOLOX-L
- YOLOv8
- YOLOv6-L6
ONNX 변환 코드
(2026년 01월 19일 기준) Python 3.13.xx 까지 사용 가능.
패키지 설치:
- onnx>=1.20.1
- onnxruntime>=1.23.2
- onnxslim>=0.1.82
변환하는 Python 코드:
"""YOLO 모델을 ONNX 형식으로 변환하는 스크립트."""
from pathlib import Path
from ultralytics import YOLO
def export_to_onnx(weights_path: str, opset: int = 12, simplify: bool = True, dynamic: bool = True) -> str:
"""
YOLO 모델을 ONNX 형식으로 변환합니다.
Args:
weights_path: .pt 모델 파일 경로
opset: ONNX opset 버전 (기본값: 12)
simplify: onnx-simplifier 적용 여부 (기본값: True)
dynamic: dynamic batch size 지원 여부 (기본값: True)
Returns:
변환된 ONNX 파일 경로
"""
model = YOLO(weights_path)
export_path = model.export(format="onnx", opset=opset, simplify=simplify, dynamic=dynamic)
return export_path
def main():
weights_dir = Path(__file__).parent / "weights"
models = [
weights_dir / "sh_weld_defect-20251113.pt",
weights_dir / "sh_weld_zone-20251222.pt",
]
for model_path in models:
if not model_path.exists():
print(f"모델 파일을 찾을 수 없습니다: {model_path}")
continue
print(f"변환 중: {model_path.name}")
onnx_path = export_to_onnx(str(model_path))
print(f"완료: {onnx_path}")
if __name__ == "__main__":
main()
Documentation
- You Only Look Once: Unified, Real-Time Object Detection
- http://pjreddie.com/darknet/yolo/
- https://github.com/pjreddie/darknet
-
1506.02640v4.pdf
- YOLO9000 - Better, Faster, Stronger
- https://arxiv.org/abs/1612.08242v1
Projects
- PyLabel
- 컴퓨터 비전 라벨링 작업을 위한 Python 라이브러리. 핵심 기능은 서로 다른 형식(예: coco에서 yolo로) 간에 경계 상자 주석을 변환하는 것입니다.
- https://github.com/pylabel-project/pylabel
See also
- Deep learning
- R-CNN
- Single Shot MultiBox Detector (SSD)
- YOLOX - anchor-free yolo
- PicoDet
- RTMDet