Ultralytics YOLO ã¢ãã«ã®ããã®OpenVINO æšè«ã®æé©åïŒå æ¬çã¬ã€ã
ã¯ããã«
ãã£ãŒãã©ãŒãã³ã°ã¢ãã«ãç¹ã«Ultralytics YOLO ã¢ãã«ã®ãããªç©äœæ€åºã®ããã®ã¢ãã«ãå±éããå Žåãæé©ãªããã©ãŒãã³ã¹ãéæããããšã¯éåžžã«éèŠã§ãããã®ã¬ã€ãã§ã¯ãIntel ã®OpenVINO ããŒã«ãããã掻çšããã¬ã€ãã³ã·ãšã¹ã«ãŒãããã«çŠç¹ãåœãŠãŠæšè«ãæé©åããæ¹æ³ã«ã€ããŠæãäžããŸããã³ã³ã·ã¥ãŒããŒã°ã¬ãŒãã®ã¢ããªã±ãŒã·ã§ã³ã§ããã倧èŠæš¡ãªãããã€ã¡ã³ãã§ããããããã®æé©åæŠç¥ãç解ããé©çšããããšã§ãããŸããŸãªããã€ã¹ã§ã¢ãã«ãå¹ççã«åäœããããã«ãªããŸãã
ã¬ã€ãã³ã·ãŒã®æé©å
åŸ ã¡æéã®æé©åã¯ãæ¶è²»è åãã·ããªãªã§å žåçãªã1ã€ã®å ¥åã«å¯ŸããŠ1ã€ã®ã¢ãã«ããå³åº§ã«å¿çããããšãå¿ èŠãšããã¢ããªã±ãŒã·ã§ã³ã«ãšã£ãŠäžå¯æ¬ ã§ãããç®æšã¯ãå ¥åãšæšè«çµæã®éã®é 延ãæå°åããããšã§ããããããäœé 延ãéæããããã«ã¯ãç¹ã«åææšè«ãå®è¡ããå Žåãè€æ°ã®ã¢ãã«ã管çããå Žåã«ã¯ãæ éãªæ€èšãå¿ èŠã§ãã
é 延æé©åã®ããã®äž»èŠæŠç¥ïŒ
- ããã€ã¹ããã1åã®æšè«ïŒäœã¬ã€ãã³ã·ãå®çŸããæãã·ã³ãã«ãªæ¹æ³ã¯ãããã€ã¹ããšã«äžåºŠã«1ã€ã®æšè«ã«å¶éããããšã§ãããåæ䞊è¡æ§ãé«ãããšãã¬ã€ãã³ã·ãå¢å€§ããããšãå€ãã
- ãµãããã€ã¹ã®æŽ»çšïŒãã«ããœã±ããCPUããã«ãã¿ã€ã«GPUã®ãããªããã€ã¹ã¯ãå éšã®ãµãããã€ã¹ã掻çšããããšã§ãã¬ã€ãã³ã·ã®å¢å ãæå°éã«æããªããè€æ°ã®ãªã¯ãšã¹ããå®è¡ããããšãã§ããã
- OpenVINO ããã©ãŒãã³ã¹ã®ãã³ã OpenVINO ã®æŽ»çš
ov::hint::PerformanceMode::LATENCY
ã®ããã«ov::hint::performance_mode
ããããã£ãã¢ãã«ã³ã³ãã€ã«æã«äœ¿çšããããšã§ãããã©ãŒãã³ã¹ãã¥ãŒãã³ã°ãç°¡çŽ åããããã€ã¹ã«ãšããããªãå°æ¥æ§ã®ããã¢ãããŒããæäŸããã
æåã®æšè«åŸ ã¡æéã®ç®¡çïŒ
- ã¢ãã«ãã£ãã·ã³ã°ïŒã¬ã€ãã³ã·ã«åœ±é¿ããã¢ãã«ã®ããŒãæéãšã³ã³ãã€ã«æéãççž®ããããã«ãå¯èœãªéãã¢ãã«ãã£ãã·ã³ã°ã䜿çšããŸãããã£ãã·ã³ã°ãå®è¡ã§ããªãã·ããªãªã§ã¯ãäžè¬çã«CPUãæãéãã¢ãã«ããŒãæéãæäŸããŸãã
- ã¢ãã«ãããã³ã°ãšãªãŒãã£ã³ã°ã®æ¯èŒïŒ ããŒãæéãççž®ãããããOpenVINO ãã¢ãã«ã®èªã¿èŸŒã¿ããããã³ã°ã«çœ®ãæããŸããããã ããã¢ãã«ããªã ãŒããã«ãã©ã€ãããããã¯ãŒã¯ãã©ã€ãäžã«ããå Žåã¯
ov::enable_mmap(false)
ãã¯ãªãã¯ããŠèªæžã«æ»ãã - èªåããã€ã¹éžæïŒãã®ã¢ãŒãã§ã¯ãCPU ã§æšè«ãéå§ããæºåãã§ã次第ã¢ã¯ã»ã©ã¬ãŒã¿ã«ç§»è¡ããããšã§ãæåã®æšè«ã®åŸ ã¡æéãã·ãŒã ã¬ã¹ã«ççž®ããã
ã¹ã«ãŒãããã®æé©å
ã¹ã«ãŒãããã®æé©åã¯ãå€æ°ã®æšè«ãªã¯ãšã¹ãã«åæã«å¯Ÿå¿ããã·ããªãªã«ãããŠãåã ã®ãªã¯ãšã¹ãã®ããã©ãŒãã³ã¹ãå€§å¹ ã«ç ç²ã«ããããšãªãããªãœãŒã¹ã®å©çšçãæ倧åããããã«æ¥µããŠéèŠã§ããã
ã¹ã«ãŒãããæé©åãžã®ã¢ãããŒãïŒ
-
OpenVINO ããã©ãŒãã³ã¹ã»ãã³ãïŒããã©ãŒãã³ã¹ã»ãã³ãã䜿çšããŠããã€ã¹éã®ã¹ã«ãŒããããåäžãããããã€ã¬ãã«ã§å°æ¥æ§ã®ããæ¹æ³ã
-
æ瀺çãããåŠçãšã¹ããªãŒã ïŒé«åºŠãªããã©ãŒãã³ã¹ã»ãã¥ãŒãã³ã°ã®ããã®æ瀺çãªãããåŠçãšã¹ããªãŒã ã®äœ¿çšãå«ãããããã现ããã¢ãããŒãã
ã¹ã«ãŒãããæåã¢ããªã±ãŒã·ã§ã³ã®èšèš
ã¹ã«ãŒããããæ倧åããããã«ãã¢ããªã±ãŒã·ã§ã³ã¯
- å ¥åã䞊è¡ããŠåŠçããè£ çœ®ã®èœåããã«ã«æŽ»çšããã
- ããŒã¿ãããŒã䞊åå®è¡ãããæšè«èŠæ±ã«å解ããã
- ã³ãŒã«ããã¯ã䜿ã£ãéåæAPIã掻çšããããšã§ãå¹çãç¶æããããã€ã¹ã®é£¢é€ç¶æ ãåé¿ããã
ãã«ãããã€ã¹å®è¡ïŒ
OpenVINOã®ãã«ãã»ããã€ã¹ã»ã¢ãŒãã¯ãã¢ããªã±ãŒã·ã§ã³ã»ã¬ãã«ã®ããã€ã¹ç®¡çãå¿ èŠãšããããšãªããããã€ã¹éã®æšè«èŠæ±ãèªåçã«ãã©ã³ã¹ãããããšã«ãããã¹ã«ãŒãããã®ã¹ã±ãŒãªã³ã°ãç°¡çŽ åããã
çµè«
Ultralytics YOLO ã¢ãã«ã®ã¬ã€ãã³ã·ãšã¹ã«ãŒããããOpenVINO ã§æé©åããããšã§ãã¢ããªã±ãŒã·ã§ã³ã®ããã©ãŒãã³ã¹ãå€§å¹ ã«åäžãããããšãã§ããŸãããã®ã¬ã€ãã«æŠèª¬ãããŠããæŠç¥ã泚ææ·±ãé©çšããããšã§ãéçºè ã¯ã¢ãã«ãå¹ççã«å®è¡ãããããŸããŸãªå±éã·ããªãªã®èŠæ±ãæºããããã«ããããšãã§ããŸããã¬ã€ãã³ã·ãšã¹ã«ãŒãããã®ã©ã¡ããæé©åãããã¯ãç¹å®ã®ã¢ããªã±ãŒã·ã§ã³ã®ããŒãºãšé åç°å¢ã®ç¹æ§ã«ãã£ãŠæ±ºãŸãããšãå¿ããªãã§ãã ããã
ãã詳现ãªæè¡æ å ±ãšææ°ã®ã¢ããããŒãã«ã€ããŠã¯ãOpenVINO ããã¥ã¡ã³ããš Ultralytics YOLO ãªããžããªãåç §ããŠãã ããããããã®ãªãœãŒã¹ã§ã¯ããã£ãŒãã©ãŒãã³ã°ã¢ãã«ãæ倧éã«æŽ»çšããããã®è©³çŽ°ãªã¬ã€ãããã¥ãŒããªã¢ã«ãã³ãã¥ããã£ãµããŒããæäŸããŠããŸãã
ã¢ãã«ãæé©ãªããã©ãŒãã³ã¹ãéæã§ããããã«ããããšã¯ãåã«èšå®ã埮調æŽããããšã§ã¯ãªããã¢ããªã±ãŒã·ã§ã³ã®ããŒãºãç解ããæ å ±ã«åºã¥ããææ決å®ãè¡ãããšã§ãããªã¢ã«ã¿ã€ã å¿çã®æé©åã§ããã倧èŠæš¡åŠçã®ã¹ã«ãŒãããã®æ倧åã§ãããUltralytics YOLO ã¢ãã«ãšOpenVINO ã®çµã¿åããã¯ãéçºè ãé«æ§èœAIãœãªã¥ãŒã·ã§ã³ãå±éããããã®åŒ·åãªããŒã«ããããæäŸããŸãã
ããããã質å
OpenVINO ã䜿ã£ãŠUltralytics YOLO ã®ã¢ãã«ãäœé 延ã«æé©åããã«ã¯ïŒ
Ultralytics YOLO ã¢ãã«ãäœé 延ã«æé©åããã«ã¯ãããã€ãã®éèŠãªæŠç¥ãããïŒ
- ããã€ã¹ããšã«1åã®æšè«ïŒé 延ãæå°åããããã«ãæšè«ãããã€ã¹ããšã«äžåºŠã«1ã€ã«å¶éããã
- ãµãããã€ã¹ã®æŽ»çšïŒãã«ããœã±ããCPUããã«ãã¿ã€ã«GPUãªã©ãè€æ°ã®ãªã¯ãšã¹ããæå°éã®ã¬ã€ãã³ã·å¢å ã§åŠçã§ããããã€ã¹ã掻çšããã
- OpenVINO ããã©ãŒãã³ã¹ã®ãã³ã OpenVINO ã䜿çšããã
ov::hint::PerformanceMode::LATENCY
ã¢ãã«ã®ã³ã³ãã€ã«æã«ãããã€ã¹ã«äŸåããªãã·ã³ãã«ãªãã¥ãŒãã³ã°ãå¯èœã§ãã
ã¬ã€ãã³ã·ãŒã®æé©åã«é¢ããããå®è·µçãªãã³ãã«ã€ããŠã¯ãæ¬ã¬ã€ãã®ã¬ã€ãã³ã·ãŒã®æé©åã»ã¯ã·ã§ã³ãã芧ãã ããã
Ultralytics YOLO ã¹ã«ãŒãããã®æé©åã®ããã«OpenVINO ã䜿ãã¹ãçç±ã¯ïŒ
OpenVINO ããã©ãŒãã³ã¹ãç ç²ã«ããããšãªãããã€ã¹ã®ãªãœãŒã¹å©çšãæ倧åããããšã§ãUltralytics YOLO ã¢ãã«ã®ã¹ã«ãŒããããåäžãããŸããäž»ãªå©ç¹ã¯ä»¥äžã®ãšããã§ãïŒ
- ããã©ãŒãã³ã¹ã®ãã³ãïŒããã€ã¹éã®ã·ã³ãã«ã§ãã€ã¬ãã«ãªããã©ãŒãã³ã¹ã»ãã¥ãŒãã³ã°ã
- æ瀺çãããåŠçãšã¹ããªãŒã ïŒé«åºŠãªããã©ãŒãã³ã¹ã®ããã®åŸ®èª¿æŽ
- ãã«ãããã€ã¹å®è¡ïŒæšè«ã®ããŒããã©ã³ã·ã³ã°ãèªååããã¢ããªã±ãŒã·ã§ã³ã¬ãã«ã®ç®¡çã容æã«ããŸãã
èšå®äŸïŒ
import openvino.properties.hint as hints
config = {hints.performance_mode: hints.PerformanceMode.THROUGHPUT}
compiled_model = core.compile_model(model, "GPU", config)
ã¹ã«ãŒãããã®æé©åã«ã€ããŠã¯ã詳现ã¬ã€ãã®ãã¹ã«ãŒãããã®æé©åãã»ã¯ã·ã§ã³ãã芧ãã ããã
OpenVINO ãå å¶ç¹ã®åŸ ã¡æéãççž®ããããã®ãã¹ããã©ã¯ãã£ã¹ãšã¯ïŒ
æåã®æšè«ã®ã¬ã€ãã³ã·ãæžããã«ã¯ã以äžã®ããšãèæ ®ããïŒ
- ã¢ãã«ã»ãã£ãã·ã¥:ããŒãæéãšã³ã³ãã€ã«æéãççž®ããããã«ã¢ãã«ã»ãã£ãã·ã¥ã䜿çšããŸãã
- ã¢ãã«ãããã³ã°ãšãªãŒãã£ã³ã°ã®æ¯èŒïŒ ãããã³ã°(
ov::enable_mmap(true)
)ã«åãæ¿ãããŸããov::enable_mmap(false)
ã¢ãã«ããªã ãŒããã«ãã©ã€ããŸãã¯ãããã¯ãŒã¯ãã©ã€ãäžã«ããå ŽåïŒã - AUTOããã€ã¹éžæïŒAUTOã¢ãŒããå©çšããŠãCPU æšè«ããå§ããã·ãŒã ã¬ã¹ã«ã¢ã¯ã»ã©ã¬ãŒã¿ãŒã«ç§»è¡ããã
第äžæšè«ã¬ã€ãã³ã·ã®ç®¡çã«é¢ãã詳现ãªæŠç¥ã«ã€ããŠã¯ãã第äžæšè«ã¬ã€ãã³ã·ã®ç®¡çãã®ã»ã¯ã·ã§ã³ãåç §ã®ããšã
ã¬ã€ãã³ã·ãŒãšã¹ã«ãŒãããã®æé©åãšãUltralytics YOLO ãOpenVINO ã®ãã©ã³ã¹ãåãã«ã¯ïŒ
ã¬ã€ãã³ã·ãŒãšã¹ã«ãŒãããã®æé©åã®ãã©ã³ã¹ãåãã«ã¯ãã¢ããªã±ãŒã·ã§ã³ã®ããŒãºãç解ããå¿ èŠããããŸãïŒ
- ã¬ã€ãã³ã·ãŒã®æé©åïŒå³æå¿çãå¿ èŠãªãªã¢ã«ã¿ã€ã ã»ã¢ããªã±ãŒã·ã§ã³ïŒã³ã³ã·ã¥ãŒããŒã»ã°ã¬ãŒãã®ã¢ããªã±ãŒã·ã§ã³ãªã©ïŒã«æé©ã
- ã¹ã«ãŒãããã®æé©åïŒåææšè«ãå€ãããªãœãŒã¹ãæ倧éã«äœ¿çšããã·ããªãªã«æé©ïŒäŸïŒå€§èŠæš¡å±éïŒã
OpenVINO ã®ãã€ã¬ãã«ãªããã©ãŒãã³ã¹ãã³ããšãã«ãããã€ã¹ã¢ãŒãã䜿çšããããšã§ãé©åãªãã©ã³ã¹ããšãããšãã§ããŸããOpenVINO ããã©ãŒãã³ã¹ã®ãã³ãã¯ãç¹å®ã®èŠä»¶ã«åºã¥ããŠé©åãªãã®ãéžæããŠãã ããã
OpenVINO 以å€ã®AIãã¬ãŒã ã¯ãŒã¯ã§ãUltralytics YOLO ã®ã¢ãã«ã䜿çšã§ããŸããïŒ
ã¯ããUltralytics YOLO ã¢ãã«ã¯æ±çšæ§ãé«ããæ§ã ãªAIãã¬ãŒã ã¯ãŒã¯ãšçµ±åããããšãã§ããŸãããªãã·ã§ã³ã«ã¯ä»¥äžãå«ãŸããŸãïŒ
- TensorRT: NVIDIA GPU ã®æé©åã«ã€ããŠã¯ãTensorRT çµ±åã¬ã€ãã«åŸã£ãŠãã ããã
- CoreML:ã¢ããã«ç€Ÿè£œããã€ã¹ã®å Žåã¯ãCoreML ã®ãšã¯ã¹ããŒãæé ãåç §ããŠãã ããã
- TensorFlow.jsã«å€æããŸãïŒWebããã³Node.jsã¢ããªã«ã€ããŠã¯ãTF.jså€æã¬ã€ããåç §ããŠãã ããã
Ultralytics ã€ã³ãã°ã¬ãŒã·ã§ã³ã®ããŒãžã§ãããå€ãã®ã€ã³ãã°ã¬ãŒã·ã§ã³ãã芧ãã ããã