YOLO11 é åã®ããã®TFLiteãžã®ã¢ãã«ãšã¯ã¹ããŒãã¬ã€ã
ã³ã³ãã¥ãŒã¿ããžã§ã³ã¢ãã«ããšããžããã€ã¹ãçµã¿èŸŒã¿ããã€ã¹ã«å±éããã«ã¯ãã·ãŒã ã¬ã¹ãªããã©ãŒãã³ã¹ãä¿èšŒã§ãããã©ãŒããããå¿ èŠã§ãã
TensorFlow LiteãŸãã¯TFLiteãšã¯ã¹ããŒããã©ãŒãããã«ããããšããžããã€ã¹ããŒã¹ã®ã¢ããªã±ãŒã·ã§ã³ã®ãããªã¿ã¹ã¯ã§ãã¢ãã«ãæé©åããããšãã§ããŸãã Ultralytics YOLO11ã¢ãã«ãæé©åããããšãã§ããŸãããã®ã¬ã€ãã§ã¯ãã¢ãã«ãTFLiteãã©ãŒãããã«å€æããæé ã説æããã¢ãã«ãããŸããŸãªãšããžããã€ã¹ã§ããç°¡åã«åªããããã©ãŒãã³ã¹ãçºæ®ã§ããããã«ããŸãã
ãªãTFLiteã«ãšã¯ã¹ããŒãããå¿ èŠãããã®ã§ããïŒ
TensorFlow frameworkã®äžéšãšããŠ2017幎5æã«Google ã«ãã£ãŠçºè¡šãããTensorFlow Liteãç¥ããŠTFLiteã¯ããšããžã³ã³ãã¥ãŒãã£ã³ã°ãšããŠãç¥ããããªã³ããã€ã¹æšè«çšã«èšèšããããªãŒãã³ãœãŒã¹ã®ãã£ãŒãã©ãŒãã³ã°ãã¬ãŒã ã¯ãŒã¯ã§ãããTFLiteã¯ãåŸæ¥ã®ã³ã³ãã¥ãŒã¿ã ãã§ãªããã¢ãã€ã«ãçµã¿èŸŒã¿ãIoTããã€ã¹äžã§åŠç¿æžã¿ã¢ãã«ãå®è¡ããããã«å¿ èŠãªããŒã«ãéçºè ã«æäŸããã
TensorFlow Liteã¯ãçµã¿èŸŒã¿LinuxãAndroid ãiOS ãMCUãå«ãå¹ åºããã©ãããã©ãŒã ãšäºææ§ããããŸããã¢ãã«ãTFLiteã«ãšã¯ã¹ããŒãããããšã§ãã¢ããªã±ãŒã·ã§ã³ãé«éåããä¿¡é Œæ§ãé«ãããªãã©ã€ã³ã§å®è¡ã§ããããã«ãªããŸãã
TFLiteã¢ãã«ã®äž»ãªç¹åŸŽ
TFLiteã¢ãã«ã¯ãéçºè ãã¢ãã€ã«ãçµã¿èŸŒã¿ããšããžããã€ã¹äžã§ã¢ãã«ãå®è¡ã§ããããã«ããããšã§ããªã³ããã€ã¹æ©æ¢°åŠç¿ãå¯èœã«ããåºç¯ãªäž»èŠæ©èœãæäŸããŸãïŒ
-
ãªã³ããã€ã¹æé©åïŒTFLiteã¯ãªã³ããã€ã¹MLã«æé©åããããŒã¿ãããŒã«ã«ã«åŠçããããšã§åŸ ã¡æéãççž®ããå人ããŒã¿ãéä¿¡ããªãããšã§ãã©ã€ãã·ãŒã匷åããã¢ãã«ãµã€ãºãæå°åããããšã§ã¹ããŒã¹ãç¯çŽããŸãã
-
ãã«ããã©ãããã©ãŒã ã®ãµããŒãïŒTFLiteã¯ãAndroid ãiOS ãçµã¿èŸŒã¿Linuxããã€ã¯ãã³ã³ãããŒã©ãŒããµããŒãããåºç¯ãªãã©ãããã©ãŒã äºææ§ãæäŸããŸãã
-
å€æ§ãªèšèªã«å¯Ÿå¿ïŒTFLiteã¯ãJavaãSwiftãObjective-CãC++ãPython ãªã©ãããŸããŸãªããã°ã©ãã³ã°èšèªã«å¯Ÿå¿ããŠããŸãã
-
é«æ§èœïŒããŒããŠã§ã¢ã¢ã¯ã»ã©ã¬ãŒã·ã§ã³ãšã¢ãã«ã®æé©åã«ãããåªããããã©ãŒãã³ã¹ãå®çŸã
TFLiteã®å±éãªãã·ã§ã³
YOLO11 ãTFLite圢åŒã«ã¢ãã«ããšã¯ã¹ããŒãããã³ãŒããèŠãåã«ãTFLiteã¢ãã«ãéåžžã©ã®ããã«äœ¿çšãããã®ããç解ãããã
TFLiteã¯ãæ©æ¢°åŠç¿ã¢ãã«ã®ããã®ããŸããŸãªãªã³ããã€ã¹å±éãªãã·ã§ã³ãæäŸããŠããïŒ
- Android ãiOS: TFLiteã®Android ãiOS ã¢ããªã±ãŒã·ã§ã³ã¯ããšããžããŒã¹ã®ã«ã¡ã©ãã£ãŒããã»ã³ãµãŒãåæãããªããžã§ã¯ããæ€åºãèå¥ããããšãã§ããŸããTFLiteã¯ãSwiftãš Objective-Cã§æžããããã€ãã£ãã®iOS ã©ã€ãã©ãªãæäŸããŠããã以äžã®ã¢ãŒããã¯ãã£å³ã¯ãTensorFlow Lite ã䜿çšããŠãAndroid ããã³iOS ãã©ãããã©ãŒã ã«åŠç¿æžã¿ã¢ãã«ããããã€ããããã»ã¹ã瀺ããŠããŸãã
-
Embedded Linuxã§ã®å®è£ ïŒUltralytics ã¬ã€ãã䜿çšããŠRaspberry Piäžã§æšè«ãå®è¡ããŠããŠãŒã¹ã±ãŒã¹ã®é床èŠä»¶ãæºãããªãå Žåã¯ããšã¯ã¹ããŒãããTFLiteã¢ãã«ã䜿çšããŠæšè«æéãé«éåããããšãã§ããŸããããã«ãCoral EdgeTPU ã
-
ãã€ã¯ãã³ã³ãããŒã©ã§ã®å±éïŒTFLiteã¢ãã«ã¯ãæ°ãããã€ãã®ã¡ã¢ãªããæããªããã€ã¯ãã³ã³ãããŒã©ããã®ä»ã®ããã€ã¹ã«ãå±éã§ããŸããã³ã¢ã®ã©ã³ã¿ã€ã ã¯Arm Cortex M3ã®16KBã«åãŸãã ãã§ãå€ãã®åºæ¬çãªã¢ãã«ãå®è¡ã§ããŸãããªãã¬ãŒãã£ã³ã°ã»ã·ã¹ãã ã®ãµããŒããæšæºçãªCãŸãã¯C++ã©ã€ãã©ãªãåçã¡ã¢ãªå²ãåœãŠãå¿ èŠãšããªãã
TFLiteãžã®ãšã¯ã¹ããŒãïŒYOLO11 ã¢ãã«ã®å€æ
TFLite圢åŒã«å€æããããšã§ãããã€ã¹äžã§ã®ã¢ãã«å®è¡å¹çãåäžãããããã©ãŒãã³ã¹ãæé©åããããšãã§ããŸãã
ã€ã³ã¹ããŒã«
å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããã«ã¯
ã€ã³ã¹ããŒã«ããã»ã¹ã«é¢ãã詳现ãªèª¬æãšãã¹ããã©ã¯ãã£ã¹ã«ã€ããŠã¯ãUltralytics ã€ã³ã¹ããŒã«ã¬ã€ããã芧ãã ãããYOLO11 ã«å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããéã«ãäœããã®åé¡ãçºçããå Žåã¯ã解決çããã³ãã«ã€ããŠãããããåé¡ã¬ã€ããåç §ããŠãã ããã
䜿çšæ¹æ³
䜿ãæ¹ã®èª¬æã«å ¥ãåã«ãUltralytics YOLO11 ã®å šã¢ãã«ããšã¯ã¹ããŒãã«å¯Ÿå¿ããŠããããšã確èªããŠãããŸããã ã
䜿çšæ¹æ³
from ultralytics import YOLO
# Load the YOLO11 model
model = YOLO("yolo11n.pt")
# Export the model to TFLite format
model.export(format="tflite") # creates 'yolo11n_float32.tflite'
# Load the exported TFLite model
tflite_model = YOLO("yolo11n_float32.tflite")
# Run inference
results = tflite_model("https://ultralytics.com/images/bus.jpg")
ãšã¯ã¹ããŒãããã»ã¹ã®è©³çŽ°ã«ã€ããŠã¯ãUltralytics ããã¥ã¡ã³ãã®ãšã¯ã¹ããŒãã«é¢ããããŒãžãã芧ãã ããã
ãšã¯ã¹ããŒããããYOLO11 TFLite ã¢ãã«ã®å±é
Ultralytics YOLO11 ã¢ãã«ã®TFLiteãã©ãŒããããžã®ãšã¯ã¹ããŒãã«æåãããããããããããã€ããããšãã§ããŸããTFLiteã¢ãã«ãå®è¡ããããã®æåã®ã¹ããããšããŠæšå¥šãããã®ã¯ãYOLO ïŒ"model.tflite"ïŒã¡ãœãããå©çšããããšã§ããããããä»ã®æ§ã ãªèšå®ã§ã®TFLiteã¢ãã«ã®ãããã€ã«é¢ãã詳现ãªèª¬æã¯ã以äžã®ãªãœãŒã¹ãã芧ãã ããïŒ
-
Android:Liteã ã¢ããªã±ãŒã·ã§ã³ã«çµ±åããããã®ã¯ã€ãã¯ã¹ã¿ãŒãã¬ã€ãã TensorFlowLiteãAndroid ã¢ããªã±ãŒã·ã§ã³ã«çµ±åããããã®ã¯ã€ãã¯ã¹ã¿ãŒãã¬ã€ããæ©æ¢°åŠç¿ã¢ãã«ãã»ããã¢ããããŠå®è¡ããããã®ç°¡åãªæé ãæäŸããã
-
iOS:iOS ã¢ããªã±ãŒã·ã§ã³ã«TensorFlow Lite ã¢ãã«ãçµ±åããŠå±éããããã®éçºè åã詳现ã¬ã€ããã芧ãã ããã
-
ãšã³ãããŒãšã³ãã®äŸ:ãã®ããŒãžã§ã¯ãTensorFlow Lite ã®æ§ã ãªäŸã®æŠèŠãæäŸããŸããéçºè ãã¢ãã€ã«ããšããžããã€ã¹äžã®æ©æ¢°åŠç¿ãããžã§ã¯ãã«TensorFlow Lite ãå®è£ ããã®ã«åœ¹ç«ã€ããã«èšèšããããå®çšçãªã¢ããªã±ãŒã·ã§ã³ããã¥ãŒããªã¢ã«ã玹ä»ããŠããŸãã
æŠèŠ
ãã®ã¬ã€ãã§ã¯ãTFLite ãã©ãŒãããã«ãšã¯ã¹ããŒãããæ¹æ³ã«çŠç¹ãåœãŠãŸãããUltralytics YOLO11 ã¢ãã«ãTFLiteã¢ãã«åœ¢åŒã«å€æããããšã§ãYOLO11 ã¢ãã«ã®å¹çãšé床ãåäžãããããå¹æçã§ãšããžã³ã³ãã¥ãŒãã£ã³ã°ç°å¢ã«é©ãããã®ã«ããããšãã§ããŸãã
䜿çšæ¹æ³ã®è©³çŽ°ã«ã€ããŠã¯ãTFLiteå ¬åŒããã¥ã¡ã³ããã芧ãã ããã
ãŸãããã®ä»ã®Ultralytics YOLO11 ã®çµ±åã«ã€ããŠãèå³ã®ããæ¹ã¯ãçµ±åã¬ã€ãããŒãžããã²ã芧ãã ããã圹ç«ã€æ å ±ãæŽå¯ãæºèŒã§ãã
ããããã質å
YOLO11 ã¢ãã«ã TFLite ãã©ãŒãããã«ãšã¯ã¹ããŒãããã«ã¯ïŒ
YOLO11 ã¢ãã«ã TFLite ãã©ãŒãããã«ãšã¯ã¹ããŒãããã«ã¯ãUltralytics ã©ã€ãã©ãªã䜿çšããŸãããŸããå¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããŠãã ããïŒ
次ã«ã以äžã®ã³ãŒãã»ã¹ããããã䜿ã£ãŠã¢ãã«ããšã¯ã¹ããŒãããŸãïŒ
from ultralytics import YOLO
# Load the YOLO11 model
model = YOLO("yolo11n.pt")
# Export the model to TFLite format
model.export(format="tflite") # creates 'yolo11n_float32.tflite'
CLI ïŒ
詳ããã¯ãUltralytics ãšã¯ã¹ããŒãã»ã¬ã€ããã芧ãã ããã
YOLO11 ã¢ãã«ã®å±éã« TensorFlow Lite ã䜿çšããã¡ãªããã¯äœã§ããïŒ
TensorFlow LiteïŒTFLiteïŒã¯ããªã³ããã€ã¹æšè«çšã«èšèšããããªãŒãã³ãœãŒã¹ã®ãã£ãŒãã©ãŒãã³ã°ãã¬ãŒã ã¯ãŒã¯ã§ãã¢ãã€ã«ãçµã¿èŸŒã¿ãIoTããã€ã¹ãžã®YOLO11 ã¢ãã«ã®å±éã«æé©ã§ããäž»ãªå©ç¹ã¯ä»¥äžã®éãïŒ
- ããã€ã¹äžã§ã®æé©åïŒããŒã«ã«ã§ããŒã¿ãåŠçããããšã§ãåŸ ã¡æéãæå°éã«æãããã©ã€ãã·ãŒã匷åããŸãã
- ãã©ãããã©ãŒã äºææ§ïŒAndroid,iOS, çµã¿èŸŒã¿Linux, MCUããµããŒãã
- ããã©ãŒãã³ã¹ããŒããŠã§ã¢ã¢ã¯ã»ã©ã¬ãŒã·ã§ã³ã掻çšããã¢ãã«ã®é床ãšå¹çãæé©åã
詳ããã¯ãTFLiteã¬ã€ããã芧ãã ããã
YOLO11 TFLiteã¢ãã«ãRaspberry Piã§åããããšã¯å¯èœã§ããïŒ
ã¯ããYOLO11 TFLiteã¢ãã«ãRaspberry Piäžã§å®è¡ããããšã§ãæšè«é床ãåäžãããããšãã§ããŸãããŸããããã§èª¬æãããŠããããã«ãã¢ãã«ãTFLiteãã©ãŒãããã«ãšã¯ã¹ããŒãããŸãã次ã«ãTensorFlow Lite Interpreterã®ãããªããŒã«ã䜿ã£ãŠãRaspberry Piäžã§ã¢ãã«ãå®è¡ããŸãã
ãããªãæé©åã®ããã«ã¯ãCoral EdgeTPU ã®äœ¿çšãæ€èšãããšããã§ãããã詳现ãªæé ã«ã€ããŠã¯ãRaspberry Piãããã€ã¡ã³ãã¬ã€ããåç §ããŠãã ããã
YOLO11 ããã€ã¯ãã³ã³ãããŒã©äžã§TFLiteã¢ãã«ã䜿çšã§ããŸããïŒ
ã¯ããTFLiteã¯éããããªãœãŒã¹ã®ãã€ã¯ãã³ã³ãããŒã©ãžã®å±éããµããŒãããŠããŸããTFLiteã®ã³ã¢ã©ã³ã¿ã€ã ã¯ãArm Cortex M3äžã§ããã16KBã®ã¡ã¢ãªããå¿ èŠãšãããåºæ¬çãªYOLO11 ã¢ãã«ãå®è¡ã§ããŸãããã®ãããèšç®èœåãšã¡ã¢ãªãæå°éã®ããã€ã¹ãžã®å±éã«é©ããŠããŸãã
ãŸãã¯ãTFLite Micro for Microcontrollersã¬ã€ããã芧ãã ããã
TFLiteYOLO11 ã«ãšã¯ã¹ããŒããããã¢ãã«ãšäºææ§ã®ãããã©ãããã©ãŒã ã¯ïŒ
TensorFlow Liteã¯åºç¯ãªãã©ãããã©ãŒã ãšã®äºææ§ãæäŸããYOLO11 ã®ã¢ãã«ã以äžã®ãããªå¹ åºãããã€ã¹ã«å±éããããšãã§ããŸãïŒ
- Android ããã³iOS: TFLiteAndroid ããã³iOS ã©ã€ãã©ãªã«ãããã€ãã£ããµããŒãã
- çµã¿èŸŒã¿LinuxïŒRaspberry Piãªã©ã®ã·ã³ã°ã«ããŒãã³ã³ãã¥ãŒã¿ã«æé©ã
- ãã€ã¯ãã³ã³ãããŒã©ãŒïŒãªãœãŒã¹ã«å¶çŽã®ããMCUã«é©ããŠããŸãã
å±éãªãã·ã§ã³ã®è©³çŽ°ã«ã€ããŠã¯ã詳现ãªå±éã¬ã€ããåç §ããŠãã ããã
YOLO11 ã¢ãã«ãTFLiteã«ãšã¯ã¹ããŒãããéã«ããããåé¡ã®ãã©ãã«ã·ã¥ãŒãã£ã³ã°æ¹æ³ãæããŠãã ããã
YOLO11 ã¢ãã«ãTFLiteã«ãšã¯ã¹ããŒãããéã«ãšã©ãŒãçºçããå Žåãäžè¬çãªè§£æ±ºæ¹æ³ã¯ä»¥äžã®éãã§ãïŒ
- ããã±ãŒãžã®äºææ§ããã§ãã¯ããïŒäºææ§ã®ããããŒãžã§ã³ã®Ultralytics ãšTensorFlow ã䜿çšããŠããããšã確èªããŠãã ãããã€ã³ã¹ããŒã«ã¬ã€ããåç §ããŠãã ããã
- ã¢ãã«ã®ãµããŒãïŒç¹å®ã®YOLO11 ã¢ãã«ã TFLite ãšã¯ã¹ããŒãããµããŒãããŠãããã©ããã確èªããŸãã
ãã®ä»ã®ãã©ãã«ã·ã¥ãŒãã£ã³ã°ã®ãã³ãã«ã€ããŠã¯ããããããåé¡ãã¬ã€ããã芧ãã ããã