CoreML YOLO11 ã¢ãã«ã®ãšã¯ã¹ããŒã
iPhoneãMacã®ãããªAppleããã€ã¹ã«ã³ã³ãã¥ãŒã¿ããžã§ã³ã¢ãã«ãå±éããã«ã¯ãã·ãŒã ã¬ã¹ãªããã©ãŒãã³ã¹ãä¿èšŒãããã©ãŒããããå¿ èŠã§ãã
CoreML ãšã¯ã¹ããŒããã©ãŒãããã«ãããã¢ãã«ãæé©åã§ããŸãã Ultralytics YOLO11iOS ã¢ãã«ãæé©åããããšãã§ããŸãããã®ã¬ã€ãã§ã¯ãã¢ãã«ãCoreML ãã©ãŒãããã«å€æããæé ã説æããApple ããã€ã¹ã§ã¢ãã«ãããç°¡åã«åäœããããã«ããŸãã
CoreML
CoreMLã¯ãAccelerateãBNNSãMetal Performance Shadersãåºç€ãšããAppleã®åºç€çãªæ©æ¢°åŠç¿ãã¬ãŒã ã¯ãŒã¯ã§ããiOS ã¢ããªã±ãŒã·ã§ã³ã«ã·ãŒã ã¬ã¹ã«çµ±åã§ããæ©æ¢°åŠç¿ã¢ãã«ãã©ãŒããããæäŸããç»å解æãèªç¶èšèªåŠçãé³å£°ããã¹ãå€æããµãŠã³ã解æãªã©ã®ã¿ã¹ã¯ããµããŒãããŸãã
Core MLãã¬ãŒã ã¯ãŒã¯ã¯ãªã³ããã€ã¹ã»ã³ã³ãã¥ãŒãã£ã³ã°ã§åäœãããããã¢ããªã±ãŒã·ã§ã³ã¯ãããã¯ãŒã¯æ¥ç¶ãAPIã³ãŒã«ãå¿ èŠãšããã«Core MLãå©çšã§ãããããã¯ãã¢ãã«ã®æšè«ããŠãŒã¶ãŒã®ããã€ã¹äžã§ããŒã«ã«ã«å®è¡ã§ããããšãæå³ããã
CoreML ã¢ãã«ã®äž»ãªç¹åŸŽ
Appleã®CoreML ãã¬ãŒã ã¯ãŒã¯ã¯ããªã³ããã€ã¹æ©æ¢°åŠç¿ã®ããã®å ç¢ãªæ©èœãæäŸãããããã§ã¯ãCoreML ãéçºè ã«ãšã£ãŠåŒ·åãªããŒã«ã«ããŠããäž»ãªæ©èœã玹ä»ããïŒ
- å æ¬çãªã¢ãã«ãµããŒãïŒTensorFlow ã PyTorchscikit-learnãXGBoostãLibSVM ãªã©ã®äžè¬çãªãã¬ãŒã ã¯ãŒã¯ããã¢ãã«ãå€æããŠå®è¡ããŸãã
-
ãªã³ããã€ã¹æ©æ¢°åŠç¿ïŒãããã¯ãŒã¯æ¥ç¶ã®å¿ èŠæ§ãæé€ãããŠãŒã¶ãŒã®ããã€ã¹äžã§çŽæ¥ã¢ãã«ãå®è¡ããããšã§ãããŒã¿ã®ãã©ã€ãã·ãŒãšè¿ éãªåŠçãä¿èšŒããŸãã
-
ããã©ãŒãã³ã¹ãšæé©åïŒããã€ã¹ã®CPU,GPU, Neural Engine ã䜿çšããæå°éã®é»åãšã¡ã¢ãªäœ¿çšã§æé©ãªããã©ãŒãã³ã¹ãå®çŸããŸãã粟床ãç¶æããªããã¢ãã«å§çž®ãšæé©åãè¡ãããŒã«ãæäŸã
-
çµ±åã®å®¹æãïŒæ§ã ãªã¢ãã«ã¿ã€ãã®ããã®çµ±äžãã©ãŒããããšãã¢ããªãžã®ã·ãŒã ã¬ã¹ãªçµ±åã®ããã®ãŠãŒã¶ãŒãã¬ã³ããªãŒãªAPIãæäŸããŸããããžã§ã³ãèªç¶èšèªãªã©ã®ãã¬ãŒã ã¯ãŒã¯ãéããŠããã¡ã€ã³åºæã®ã¿ã¹ã¯ããµããŒãããŸãã
-
é«åºŠãªæ©èœïŒããŒãœãã©ã€ãºãããäœéšã®ããã®ãªã³ããã€ã¹ã»ãã¬ãŒãã³ã°æ©èœãã€ã³ã¿ã©ã¯ãã£ããªMLäœéšã®ããã®éåæäºæž¬ãã¢ãã«æ€æ»ã»æ€èšŒããŒã«ãå«ãã
CoreML é åãªãã·ã§ã³
YOLO11 ã¢ãã«ãCoreML ãã©ãŒãããã«ãšã¯ã¹ããŒãããã³ãŒããèŠãåã«ãCoreML ã¢ãã«ãéåžžã©ãã§äœ¿ãããã®ããç解ãããã
CoreML ã¯ãæ©æ¢°åŠç¿ã¢ãã«ã®ããŸããŸãªå°å ¥ãªãã·ã§ã³ãæäŸããŠããïŒ
-
ãªã³ããã€ã¹ã»ãããã€ã¡ã³ãïŒãã®æ¹æ³ã§ã¯ãCoreML ã¢ãã«ãiOS ã¢ããªã«çŽæ¥çµ±åããŸããäœã¬ã€ãã³ã·ãŒããã©ã€ãã·ãŒã®åŒ·åïŒããŒã¿ãããã€ã¹ã«æ®ãããïŒããªãã©ã€ã³æ©èœã®ç¢ºä¿ã«ç¹ã«æå©ã§ãããããããã®æ¹æ³ã¯ãç¹ã«å€§ããè€éãªã¢ãã«ã®å Žåãããã€ã¹ã®ããŒããŠã§ã¢æ©èœã«ãã£ãŠå¶éãããå¯èœæ§ããããŸãããªã³ããã€ã¹ãããã€ã¡ã³ãã¯ã以äžã®2ã€ã®æ¹æ³ã§å®è¡ã§ããã
-
çµã¿èŸŒã¿ã¢ãã«ïŒãããã®ã¢ãã«ã¯ã¢ããªã®ãã³ãã«ã«å«ãŸããŠãããããã«ã¢ã¯ã»ã¹ã§ããŸããé »ç¹ãªã¢ããããŒããå¿ èŠãšããªãå°èŠæš¡ãªã¢ãã«ã«æé©ã§ãã
-
ããŠã³ããŒããããã¢ãã«ïŒãããã®ã¢ãã«ã¯ãå¿ èŠã«å¿ããŠãµãŒããŒããååŸãããŸãããã®æ¹æ³ã¯ã倧ããªã¢ãã«ãå®æçãªã¢ããããŒããå¿ èŠãªã¢ãã«ã«é©ããŠããŸããã¢ããªã®ãã³ãã«ãµã€ãºãå°ããä¿ã€ããšãã§ããŸãã
-
-
ã¯ã©ãŠãããŒã¹ã®ãããã€ã¡ã³ãïŒCoreML ã¢ãã«ã¯ãµãŒããŒäžã§ãã¹ããããAPI ãªã¯ãšã¹ããéããŠiOS ã¢ããªããã¢ã¯ã»ã¹ãããŸãããã®ã¹ã±ãŒã©ãã«ã§æè»ãªãªãã·ã§ã³ã¯ãã¢ããªãä¿®æ£ããããšãªãã¢ãã«ãç°¡åã«æŽæ°ã§ããŸããè€éãªã¢ãã«ãå®æçãªã¢ããããŒããå¿ èŠãªå€§èŠæš¡ã¢ããªã«æé©ã§ãããã ããã€ã³ã¿ãŒãããæ¥ç¶ãå¿ èŠã§ãããé 延ãã»ãã¥ãªãã£ã®åé¡ãçºçããå¯èœæ§ããããŸãã
YOLO11 ã¢ãã«ã®ãšã¯ã¹ããŒãCoreML
YOLO11 ãCoreML ã«ãšã¯ã¹ããŒãããããšã§ãã¢ããã«ã®ãšã³ã·ã¹ãã å ã§æé©åãããããã€ã¹äžã§ã®æ©æ¢°åŠç¿ããã©ãŒãã³ã¹ãå¯èœã«ãªããå¹çæ§ãã»ãã¥ãªãã£ãããã³iOS ãmacOSãwatchOSãtvOS ãã©ãããã©ãŒã ãšã®ã·ãŒã ã¬ã¹ãªçµ±åã®é¢ã§ã¡ãªããããããŸãã
ã€ã³ã¹ããŒã«
å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããã«ã¯ã以äžãå®è¡ããïŒ
ã€ã³ã¹ããŒã«ããã»ã¹ã«é¢ãã詳ãã説æãšãã¹ããã©ã¯ãã£ã¹ã«ã€ããŠã¯ãYOLO11 ã€ã³ã¹ããŒã«ã¬ã€ããã芧ãã ãããYOLO11 ã«å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããéã«ãäœããã®åé¡ãçºçããå Žåã¯ã解決çããã³ãã«ã€ããŠãããããåé¡ã¬ã€ããåç §ããŠãã ããã
䜿çšæ¹æ³
䜿ãæ¹ã®èª¬æã«å ¥ãåã«ã Ultralytics ãæäŸããYOLO11 ã¢ãã«ã®ã©ã€ã³ããããã確èªãã ãããããã¯ãããªãã®ãããžã§ã¯ãã®èŠä»¶ã«æãé©ããã¢ãã«ãéžæããã®ã«åœ¹ç«ã¡ãŸãã
䜿çšæ¹æ³
from ultralytics import YOLO
# Load the YOLO11 model
model = YOLO("yolo11n.pt")
# Export the model to CoreML format
model.export(format="coreml") # creates 'yolo11n.mlpackage'
# Load the exported CoreML model
coreml_model = YOLO("yolo11n.mlpackage")
# Run inference
results = coreml_model("https://ultralytics.com/images/bus.jpg")
ãšã¯ã¹ããŒãããã»ã¹ã®è©³çŽ°ã«ã€ããŠã¯ãUltralytics ããã¥ã¡ã³ãã®ãšã¯ã¹ããŒãã«é¢ããããŒãžãã芧ãã ããã
ãšã¯ã¹ããŒããããYOLO11 CoreML ã¢ãã«ã®å±é
Ultralytics YOLO11 ã¢ãã«ã®CoreML ãžã®ãšã¯ã¹ããŒãã«æåãããã次ã®éèŠãªæ®µéã¯ããããã®ã¢ãã«ãå¹æçã«é åããããšã§ããæ§ã ãªç°å¢ã«ãããCoreML ã¢ãã«ã®å±éã«é¢ãã詳现ãªã¬ã€ãã³ã¹ã«ã€ããŠã¯ã以äžã®ãªãœãŒã¹ãã芧ãã ããïŒ
-
CoreML ããŒã«:ãã®ã¬ã€ãã«ã¯ã以äžã®ã©ã€ãã©ãªããCore MLã«ã¢ãã«ãå€æããæé ãšäŸãå«ãŸããŠããŸãã TensorFlowãPyTorch ãªã©ã®ã©ã€ãã©ãªãã Core ML ãžã¢ãã«ãå€æããæé ãèšèŒãããŠããŸãã
-
MLãšããžã§ã³:CoreML ã¢ãã«ã®äœ¿çšãšå®è£ ã®æ§ã ãªåŽé¢ãã«ããŒããå æ¬çãªãããªã®ã³ã¬ã¯ã·ã§ã³ã
-
ã³ã¢MLã¢ãã«ãã¢ããªã«çµ±åãã:CoreML ã¢ãã«ãiOS ã¢ããªã±ãŒã·ã§ã³ã«çµ±åããããã®å æ¬çãªã¬ã€ãã§ãã¢ãã«ã®æºåããæ§ã ãªæ©èœã®ããã®ã¢ããªãžã®å®è£ ãŸã§ã®æé ã詳ãã説æããŠããŸãã
æŠèŠ
ãã®ã¬ã€ãã§ã¯ãUltralytics YOLO11 ã®ã¢ãã«ãCoreML 圢åŒã«ãšã¯ã¹ããŒãããæ¹æ³ã«ã€ããŠèª¬æããŸããããã®ã¬ã€ãã§èª¬æããæé ã«åŸãããšã§ãYOLO11 ã®ã¢ãã«ãCoreML ã«ãšã¯ã¹ããŒãããéã«ãæ倧éã®äºææ§ãšããã©ãŒãã³ã¹ã確ä¿ããããšãã§ããŸãã
䜿ãæ¹ã®è©³çŽ°ã«ã€ããŠã¯ãCoreML å ¬åŒããã¥ã¡ã³ããã芧ãã ããã
ãŸãããã®ä»ã®Ultralytics YOLO11 ã®çµ±åã«ã€ããŠè©³ãããç¥ãã«ãªãããå Žåã¯ãçµ±åã¬ã€ãã®ããŒãžãã芧ãã ãããããã«ã¯è²ŽéãªãªãœãŒã¹ãæŽå¯ããããããããŸãã
ããããã質å
YOLO11 ã¢ãã«ãCoreML ãã©ãŒãããã«ãšã¯ã¹ããŒãããã«ã¯ïŒ
ããšã¯ã¹ããŒãããã«ã¯ Ultralytics YOLO11 ã¢ãã«ãCoreML ãã©ãŒãããã«å€æããã«ã¯ãæåã« ultralytics
ããã±ãŒãžãã€ã³ã¹ããŒã«ãããŠããŸããã€ã³ã¹ããŒã«ã«ã¯
次ã«ã以äžã®Python ãŸãã¯CLI ã³ãã³ãã䜿ã£ãŠã¢ãã«ããšã¯ã¹ããŒãããŸãïŒ
䜿çšæ¹æ³
詳现ã«ã€ããŠã¯ãããã¥ã¡ã³ãã®ã YOLO11 Models toCoreML Exportingãã»ã¯ã·ã§ã³ãåç §ããŠãã ããã
YOLO11 ã¢ãã«ã®å±éã«CoreML ã䜿çšããã¡ãªããã¯äœã§ããïŒ
CoreML ã¯ãAppleããã€ã¹ã« Ultralytics YOLO11ã¢ãã«ãã¢ããã«ç€Ÿè£œããã€ã¹ã«å±éããéã«å€ãã®å©ç¹ããããŸãïŒ
- ãªã³ããã€ã¹åŠçïŒããã€ã¹äžã§ã®ããŒã«ã«ã¢ãã«æšè«ãå¯èœã«ããããŒã¿ãã©ã€ãã·ãŒã確ä¿ããåŸ ã¡æéãæå°éã«æããŸãã
- ããã©ãŒãã³ã¹ã®æé©åïŒããã€ã¹ã®CPU ãGPU ãNeural Engineã®å¯èœæ§ãæ倧éã«æŽ»çšããã¹ããŒããšå¹çã®äž¡æ¹ãæé©åããŸãã
- çµ±åã®å®¹æãïŒiOS ãmacOSãwatchOSãtvOSãå«ãAppleã®ãšã³ã·ã¹ãã ãšã®ã·ãŒã ã¬ã¹ãªçµ±åäœéšãæäŸããŸãã
- æ±çšæ§ïŒCoreML ãã¬ãŒã ã¯ãŒã¯ã䜿çšããŠãç»å解æãé³å£°åŠçãèªç¶èšèªåŠçãªã©ãå¹ åºãæ©æ¢°åŠç¿ã¿ã¹ã¯ããµããŒãã
CoreML ã¢ãã«ã®iOS ã¢ããªãžã®çµ±åã®è©³çŽ°ã«ã€ããŠã¯ãã³ã¢ ML ã¢ãã«ã®ã¢ããªãžã®çµ±åã«é¢ããã¬ã€ããã芧ãã ããã
CoreML ã«ãšã¯ã¹ããŒããããYOLO11 ã¢ãã«ã®ãããã€ãªãã·ã§ã³ã¯äœã§ããïŒ
YOLO11 ã¢ãã«ãCoreML ãã©ãŒãããã«ãšã¯ã¹ããŒããããšãè€æ°ã®å±éãªãã·ã§ã³ããããŸãïŒ
-
ãªã³ããã€ã¹ã§ã®å±éïŒCoreML ã¢ãã«ãã¢ããªã«çŽæ¥çµ±åãããã©ã€ãã·ãŒãšãªãã©ã€ã³æ©èœã匷åããŸããããã¯æ¬¡ã®ããã«è¡ãããšãã§ããŸãïŒ
- çµã¿èŸŒã¿ã¢ãã«ïŒã¢ããªã®ãã³ãã«ã«å«ãŸããããã«ã¢ã¯ã»ã¹ã§ããŸãã
- ããŠã³ããŒããããã¢ãã«ïŒå¿ èŠã«å¿ããŠãµãŒããŒããååŸããã¢ããªãã³ãã«ãµã€ãºãå°ããä¿ã¡ãŸãã
-
ã¯ã©ãŠãããŒã¹ã®å±éïŒCoreML ããµãŒããŒäžã§ã¢ãã«ããã¹ãããAPIãªã¯ãšã¹ããéããŠã¢ã¯ã»ã¹ããããã®ã¢ãããŒãã¯ãããç°¡åãªã¢ããããŒãããµããŒãããããè€éãªã¢ãã«ãæ±ãããšãã§ããŸãã
CoreML ã¢ãã«ã®å±éã«é¢ãã詳ããã¬ã€ãã³ã¹ã«ã€ããŠã¯ãCoreML å±éãªãã·ã§ã³ãåç §ããŠãã ããã
CoreML ã¯ãYOLO11 ã¢ãã«ã®ããã©ãŒãã³ã¹ãã©ã®ããã«æé©åããŠããã®ãïŒ
CoreML æ§ã ãªæé©åæè¡ãé§äœ¿ã㊠Ultralytics YOLO11æ§ã ãªæé©åæè¡ã掻çšããããšã§ãã¢ãã«ã®ããã©ãŒãã³ã¹ãæé©åããŸãïŒ
- ããŒããŠã§ã¢ã»ã¢ã¯ã»ã©ã¬ãŒã·ã§ã³ïŒããã€ã¹ã®CPU ãGPU ãããã³ãã¥ãŒã©ã«ã»ãšã³ãžã³ã䜿çšããŠå¹ççãªèšç®ãè¡ããŸãã
- ã¢ãã«ã®å§çž®ïŒç²ŸåºŠãæãªãããšãªãã¢ãã«ã®ãããããªã³ããçž®å°ããããã®å§çž®ããŒã«ãæäŸããŸãã
- é©å¿åæšè«ïŒããã€ã¹ã®èœåã«åºã¥ããŠæšè«ã調æŽããã¹ããŒããšããã©ãŒãã³ã¹ã®ãã©ã³ã¹ãä¿ã€ã
ããã©ãŒãã³ã¹æé©åã®è©³çŽ°ã«ã€ããŠã¯ãCoreML å ¬åŒããã¥ã¡ã³ããã芧ãã ããã
ãšã¯ã¹ããŒããããCoreML ã¢ãã«ã䜿ã£ãŠçŽæ¥æšè«ãå®è¡ã§ããŸããïŒ
ã¯ãããšã¯ã¹ããŒããããCoreML ã¢ãã«ã䜿ã£ãŠçŽæ¥æšè«ãå®è¡ããããšãã§ããŸãã以äžã¯ãPython ãšCLI ã®ã³ãã³ãã§ãïŒ
ã©ã³ãã³ã°æšè«
詳现ã«ã€ããŠã¯ãCoreML ãšã¯ã¹ããŒãã»ã¬ã€ãã®ã䜿çšæ³ããåç §ã