ã¢ãã«ã»ãšã¯ã¹ããŒãUltralytics YOLO
ã¯ããã«
ã¢ãã«ããã¬ãŒãã³ã°ããæçµçãªç®æšã¯ãå®äžçã®ã¢ããªã±ãŒã·ã§ã³ã«ã¢ãã«ãå°å ¥ããããšã§ããUltralytics YOLO11 ã®ãšã¯ã¹ããŒãã¢ãŒãã§ã¯ããã¬ãŒãã³ã°ããã¢ãã«ãããŸããŸãªãã©ãŒãããã«ãšã¯ã¹ããŒãããããã®å€åœ©ãªãªãã·ã§ã³ãæäŸããããŸããŸãªãã©ãããã©ãŒã ãããã€ã¹ã«å±éã§ããããã«ããŸãããã®å æ¬çãªã¬ã€ãã¯ãã¢ãã«ã®ãšã¯ã¹ããŒãã®ãã¥ã¢ã³ã¹ã説æããæ倧ã®äºææ§ãšããã©ãŒãã³ã¹ãéæããæ¹æ³ã玹ä»ããããšãç®çãšããŠããŸãã
èŠããã ïŒ ã«ã¹ã¿ã åŠç¿Ultralytics YOLO ã¢ãã«ããšã¯ã¹ããŒããããŠã§ãã«ã¡ã©äžã§ã©ã€ãæšè«ãå®è¡ããæ¹æ³ã
ãªãYOLO11 ã®ãšã¯ã¹ããŒãã»ã¢ãŒããéžã¶ã®ãïŒ
- æ±çšæ§ïŒ ONNX,TensorRT,CoreML, ãªã©ãå«ãè€æ°ã®ãã©ãŒãããã«ãšã¯ã¹ããŒãã
- ããã©ãŒãã³ã¹ïŒ TensorRT ã§GPU ãæ倧 5 åãONNX ãŸãã¯OpenVINO ã§CPU ãæ倧 3 åé«éåã
- äºææ§ïŒå€æ°ã®ããŒããŠã§ã¢ããã³ãœãããŠã§ã¢ç°å¢ã«ãããŠãã¢ãã«ãæ®éçã«å±éã§ããããã«ããŸãã
- 䜿ããããïŒã·ã³ãã«ãªCLI ãPython APIã«ãããçŽ æ©ãç°¡åã«ã¢ãã«ããšã¯ã¹ããŒãã§ããŸãã
ãšã¯ã¹ããŒãã»ã¢ãŒãã®äž»ãªç¹åŸŽ
ããã§ã¯ãç®ç«ã£ãæ©èœãããã€ã玹ä»ãããïŒ
- ã¯ã³ã¯ãªãã¯ãšã¯ã¹ããŒãïŒç°¡åãªã³ãã³ãã§æ§ã ãªãã©ãŒãããã«ãšã¯ã¹ããŒãã§ããŸãã
- ããããšã¯ã¹ããŒãïŒãããæšè«å¯èœãªã¢ãã«ããšã¯ã¹ããŒãããŸãã
- æé©åãããæšè«ïŒãšã¯ã¹ããŒããããã¢ãã«ã¯ãæšè«æéãççž®ããããã«æé©åãããŠããŸãã
- ãã¥ãŒããªã¢ã«ãããªïŒã¹ã ãŒãºãªæžãåºãã®ããã®è©³çŽ°ãªã¬ã€ããšãã¥ãŒããªã¢ã«ã
ããã
䜿çšäŸ
YOLO11n ã¢ãã«ãONNX ãTensorRT ã®ãããªå¥ã®ãã©ãŒãããã«ãšã¯ã¹ããŒãããŸãã ãšã¯ã¹ããŒãåŒæ°ã®å®å šãªãªã¹ãã«ã€ããŠã¯ã以äžã®åŒæ°ã®ã»ã¯ã·ã§ã³ãåç §ããŠãã ããã
äŸ
è°è«
ãã®è¡šã¯ãYOLO ã®ã¢ãã«ãããŸããŸãªãã©ãŒãããã«ãšã¯ã¹ããŒãããéã«å©çšã§ããèšå®ãšãªãã·ã§ã³ã®è©³çŽ°ã瀺ããŠããŸãããããã®èšå®ã¯ããšã¯ã¹ããŒããããã¢ãã«ã®ããã©ãŒãã³ã¹ããµã€ãºãããŸããŸãªãã©ãããã©ãŒã ãç°å¢ã§ã®äºææ§ãæé©åããããã«éèŠã§ããé©åãªèšå®ãè¡ãããšã§ãã¢ãã«ãæé©ãªå¹çã§ç®çã®ã¢ããªã±ãŒã·ã§ã³ã«å±éã§ããããã«ãªããŸãã
è°è« | ã¿ã€ã | ããã©ã«ã | 説æ |
---|---|---|---|
format |
str |
'torchscript' |
ãšã¯ã¹ããŒããããã¢ãã«ã®ã¿ãŒã²ãããã©ãŒãããã 'onnx' , 'torchscript' , 'tensorflow' ãªã©ãããŸããŸãªå±éç°å¢ãšã®äºææ§ãå®çŸ©ããŠããã |
imgsz |
int ãŸã㯠tuple |
640 |
ã¢ãã«å
¥åã«å¿
èŠãªç»åãµã€ãºãæ£æ¹åœ¢ç»åã®å Žåã¯æŽæ°ïŒæ£æ¹åœ¢ç»åã®å Žåã¯ã¿ãã«ã«ãªããŸãïŒ (height, width) å
·äœçãªå¯žæ³ã«ã€ããŠã¯ |
keras |
bool |
False |
ã®Kerasãã©ãŒããããžã®ãšã¯ã¹ããŒããå¯èœã«ããã TensorFlowSavedModel TensorFlow ãµãŒãã³ã°ãš API ãšã®äºææ§ãæäŸããŸãã |
optimize |
bool |
False |
TorchScript ãžã®ãšã¯ã¹ããŒãæã«ã¢ãã€ã«ããã€ã¹åãã®æé©åãé©çšããã¢ãã«ãµã€ãºãçž®å°ããŠããã©ãŒãã³ã¹ãåäžãããå¯èœæ§ããããŸãã |
half |
bool |
False |
FP16ïŒå粟床ïŒéååãæå¹ã«ããã¢ãã«ãµã€ãºãçž®å°ãããµããŒããããŠããããŒããŠã§ã¢ã§ã®æšè«ãé«éåããå¯èœæ§ããããŸãã |
int8 |
bool |
False |
INT8éååãæå¹ã«ããã¢ãã«ãããã«å§çž®ããäž»ã«ãšããžããã€ã¹ã®ããã«ãæå°éã®ç²ŸåºŠæ倱ã§æšè«ãé«éåããã |
dynamic |
bool |
False |
ONNX ãTensorRT ãOpenVINO ãšã¯ã¹ããŒãã®ããã®åçãªå ¥åãµã€ãºãå¯èœã«ããããŸããŸãªç»å寞æ³ãæ±ãæè»æ§ãé«ããŸãã |
simplify |
bool |
True |
ã§ã®ONNX ãšã¯ã¹ããŒãã®ã¢ãã«ã°ã©ããç°¡çŽ åããã onnxslim ããã©ãŒãã³ã¹ãšäºææ§ãåäžãããå¯èœæ§ãããã |
opset |
int |
None |
ç°ãªãONNX ããŒãµãŒãã©ã³ã¿ã€ã ãšã®äºææ§ã®ããã«ãONNX ã®ãªãã»ããã®ããŒãžã§ã³ãæå®ããŸããèšå®ãããŠããªãå Žåã¯ããµããŒããããŠããææ°ã®ããŒãžã§ã³ã䜿çšããŸãã |
workspace |
float |
4.0 |
TensorRT ãã¡ã¢ãªäœ¿çšéãšããã©ãŒãã³ã¹ã®ãã©ã³ã¹ããšããªããæé©åããããã«ãã¯ãŒã¯ã¹ããŒã¹ã®æ倧ãµã€ãºãGiBåäœã§èšå®ããŸãã |
nms |
bool |
False |
æ£ç¢ºã§å¹ççãªæ€åºã®åŸåŠçã«äžå¯æ¬ ãªéæ倧æå¶ïŒNMSïŒãCoreML ãšã¯ã¹ããŒãã«è¿œå ããŸãã |
batch |
int |
1 |
ãšã¯ã¹ããŒãã¢ãã«ã®ãããæšè«ãµã€ãºããŸãã¯ãšã¯ã¹ããŒããããã¢ãã«ãåæã«åŠçããç»åã®æ倧æ°ãæå®ããŸãã predict ã¢ãŒãã ã |
device |
str |
None |
ãšã¯ã¹ããŒãããããã€ã¹ãæå®ïŒGPU (device=0 )ãCPU (device=cpu )ãã¢ããã«ã»ã·ãªã³ã³çšMPS (device=mps )ãŸãã¯DLA forNVIDIA Jetson (device=dla:0 ãŸã㯠device=dla:1 ). |
ãããã®ãã©ã¡ãŒã¿ã調æŽããããšã§ãå±éç°å¢ãããŒããŠã§ã¢ã®å¶çŽãããã©ãŒãã³ã¹ç®æšãªã©ãç¹å®ã®èŠä»¶ã«åãããŠãšã¯ã¹ããŒãããã»ã¹ãã«ã¹ã¿ãã€ãºããããšãã§ããŸããé©åãªãã©ãŒããããšèšå®ãéžæããããšã¯ãã¢ãã«ãµã€ãºãã¹ããŒãã粟床ã®æé©ãªãã©ã³ã¹ãå®çŸããããã«äžå¯æ¬ ã§ãã
茞åºãã©ãŒããã
å©çšå¯èœãªYOLO11 ãšã¯ã¹ããŒã圢åŒã¯ä»¥äžã®è¡šã®éãã§ããã©ã®ãã©ãŒãããã§ã format
åŒæ°ãããªãã¡ format='onnx'
ãŸã㯠format='engine'
.ãšã¯ã¹ããŒããããã¢ãã«ãçŽæ¥äºæž¬ãŸãã¯æ€èšŒããããšãã§ããŸãã yolo predict model=yolo11n.onnx
.䜿çšäŸã¯ããšã¯ã¹ããŒãå®äºåŸã«è¡šç€ºãããŸãã
ãã©ãŒããã | format è°è« |
ã¢ãã« | ã¡ã¿ããŒã¿ | è°è« |
---|---|---|---|---|
PyTorch | - | yolo11n.pt |
â | - |
TorchScript | torchscript |
yolo11n.torchscript |
â | imgsz , optimize , batch |
ONNX | onnx |
yolo11n.onnx |
â | imgsz , half , dynamic , simplify , opset , batch |
OpenVINO | openvino |
yolo11n_openvino_model/ |
â | imgsz , half , int8 , batch |
TensorRT | engine |
yolo11n.engine |
â | imgsz , half , dynamic , simplify , workspace , int8 , batch |
CoreML | coreml |
yolo11n.mlpackage |
â | imgsz , half , int8 , nms , batch |
TF SavedModel | saved_model |
yolo11n_saved_model/ |
â | imgsz , keras , int8 , batch |
TF GraphDef | pb |
yolo11n.pb |
â | imgsz , batch |
TF ã©ã€ã | tflite |
yolo11n.tflite |
â | imgsz , half , int8 , batch |
TF ãšããžTPU | edgetpu |
yolo11n_edgetpu.tflite |
â | imgsz |
TF.js | tfjs |
yolo11n_web_model/ |
â | imgsz , half , int8 , batch |
PaddlePaddle | paddle |
yolo11n_paddle_model/ |
â | imgsz , batch |
MNN | mnn |
yolo11n.mnn |
â | imgsz , batch , int8 , half |
NCNN | ncnn |
yolo11n_ncnn_model/ |
â | imgsz , half , batch |
IMX500 | imx |
yolov8n_imx_model/ |
â | imgsz , int8 |
ããããã質å
YOLO11 ã¢ãã«ãONNX ãã©ãŒãããã«ãšã¯ã¹ããŒãããæ¹æ³ãæããŠãã ããã
Ultralytics ã䜿ãã°ãYOLO11 ã®ã¢ãã«ãONNX ãã©ãŒãããã«ç°¡åã«ãšã¯ã¹ããŒãããããšãã§ããŸããã¢ãã«ããšã¯ã¹ããŒãããããã«ãPython ãšCLI ã®äž¡æ¹ã®ã¡ãœãããçšæãããŠããŸãã
äŸ
ç°ãªãå ¥åãµã€ãºãžã®å¯Ÿå¿ãªã©ãé«åºŠãªãªãã·ã§ã³ãå«ãããã»ã¹ã®è©³çŽ°ã«ã€ããŠã¯ãONNX ã®ã»ã¯ã·ã§ã³ãåç §ããŠãã ããã
ã¢ãã«ã®ãšã¯ã¹ããŒãã«TensorRT ã䜿çšããå©ç¹ã¯äœã§ããïŒ
ã¢ãã«ã®ãšã¯ã¹ããŒãã«TensorRT ã䜿çšãããšãããã©ãŒãã³ã¹ãå€§å¹ ã«åäžããŸããTensorRT ã«ãšã¯ã¹ããŒããããYOLO11 ã¢ãã«ã¯ãGPU æ倧5åã®ã¹ããŒãã¢ãããéæã§ãããªã¢ã«ã¿ã€ã æšè«ã¢ããªã±ãŒã·ã§ã³ã«æé©ã§ãã
- æ±çšæ§ïŒç¹å®ã®ããŒããŠã§ã¢ã»ããã¢ããã«ã¢ãã«ãæé©åããŸãã
- ã¹ããŒãïŒé«åºŠãªæé©åã«ãããããé«éãªæšè«ãå®çŸã
- äºææ§ïŒ NVIDIA ããŒããŠã§ã¢ãšã¹ã ãŒãºã«çµ±åã
TensorRT ã®çµ±åã®è©³çŽ°ã«ã€ããŠã¯ãTensorRT çµ±åã¬ã€ããåç §ããŠãã ããã
YOLO11 ã¢ãã«ããšã¯ã¹ããŒãããéãINT8éååãæå¹ã«ããã«ã¯ã©ãããã°ããã§ããïŒ
INT8éååã¯ãç¹ã«ãšããžããã€ã¹ã«ãããŠãã¢ãã«ãå§çž®ããæšè«ãé«éåããåªããæ¹æ³ã§ããããã§ã¯ãINT8éååãæå¹ã«ããæ¹æ³ã説æããŸãïŒ
äŸ
INT8 éååã¯ãTensorRT ãCoreML ãªã©ãããŸããŸãªãã©ãŒãããã«é©çšã§ããŸãã詳现ã¯ãšã¯ã¹ããŒãã®ã»ã¯ã·ã§ã³ã«ãããŸãã
ã¢ãã«ããšã¯ã¹ããŒãããéã«ããªãåçå ¥åãµã€ãºãéèŠãªã®ã§ããïŒ
åçå ¥åãµã€ãºã¯ããšã¯ã¹ããŒããããã¢ãã«ãæ§ã ãªç»å寞æ³ãæ±ãããšãå¯èœã«ããæè»æ§ãæäŸããæ§ã ãªãŠãŒã¹ã±ãŒã¹ã«å¯ŸããŠåŠçå¹çãæé©åããŸããONNX ãTensorRT ã®ãããªåœ¢åŒã«ãšã¯ã¹ããŒãããå Žåããã€ãããã¯å ¥åãµã€ãºãæå¹ã«ããããšã§ãã¢ãã«ãç°ãªãå ¥å圢ç¶ã«ã·ãŒã ã¬ã¹ã«é©å¿ã§ããããã«ãªããŸãã
ãã®æ©èœãæå¹ã«ããã«ã¯ dynamic=True
ãã©ã°ãç«ãŠãïŒ
äŸ
詳ããã¯ããã€ãããã¯ã»ã€ã³ãããã»ãµã€ãºã®ã³ã³ãã£ã®ã¥ã¬ãŒã·ã§ã³ãåç §ã®ããšã
ã¢ãã«ã®ããã©ãŒãã³ã¹ãæé©åããããã«èæ ®ãã¹ãéèŠãªèŒžåºè«æ ãšã¯ïŒ
ãšã¯ã¹ããŒãã®åŒæ°ãç解ãèšå®ããããšã¯ãã¢ãã«ã®ããã©ãŒãã³ã¹ãæé©åããããã«éåžžã«éèŠã§ãïŒ
format:
ãšã¯ã¹ããŒããããã¢ãã«ã®ã¿ãŒã²ãããã©ãŒãããïŒäŸïŒonnx
,torchscript
,tensorflow
).imgsz:
ã¢ãã«å ¥åã«å¿ èŠãªç»åãµã€ãºïŒäŸïŒ640
ãŸãã¯(height, width)
).half:
FP16éååãå¯èœã«ãªããã¢ãã«ãµã€ãºãå°ãããªããæšè«ãé«éåãããå¯èœæ§ããããoptimize:
ã¢ãã€ã«ç°å¢ãå¶çŽã®ããç°å¢åãã«ãç¹å®ã®æé©åãé©çšãããint8:
INT8éååãå¯èœã«ãããšããžå±éã«éåžžã«æå¹ã
ãã¹ãŠã®ãšã¯ã¹ããŒãåŒæ°ã®è©³çŽ°ãªãªã¹ããšèª¬æã«ã€ããŠã¯ããšã¯ã¹ããŒãåŒæ°ã®ã»ã¯ã·ã§ã³ãã芧ãã ããã