YOLO11 AzureMLäžã®ðã
ã¢ãžã¥ãŒã«ãšã¯ïŒ
Azureã¯Microsoft ã®ã¯ã©ãŠãã»ã³ã³ãã¥ãŒãã£ã³ã°ã»ãã©ãããã©ãŒã ã§ãäŒæ¥ãã¯ãŒã¯ããŒãããªã³ãã¬ãã¹ã®ããŒã¿ã»ã³ã¿ãŒããã¯ã©ãŠãã«ç§»è¡ããã®ãæ¯æŽããããã«èšèšãããŠãããã³ã³ãã¥ãŒãã£ã³ã°ãããŒã¿ããŒã¹ãã¢ããªãã£ã¯ã¹ãæ©æ¢°åŠç¿ããããã¯ãŒãã³ã°ãªã©ãããããã¯ã©ãŠããµãŒãã¹ãæã£ãŠããããŠãŒã¶ãŒã¯ãããã®ãµãŒãã¹ãã奜ããªãã®ãéžãã§ããããªãã¯ã¯ã©ãŠãäžã§æ°ããã¢ããªã±ãŒã·ã§ã³ãéçºã»æ¡åŒµããããæ¢åã®ã¢ããªã±ãŒã·ã§ã³ãå®è¡ãããããããšãã§ããã
Azure Machine LearningïŒAzureMLïŒãšã¯ïŒ
Azure Machine LearningïŒé称AzureMLïŒã¯ãããŒã¿ãµã€ãšã³ãã£ã¹ããéçºè ãã¢ããªã±ãŒã·ã§ã³ã«äºæž¬åæãå¹ççã«çµã¿èŸŒãããšãå¯èœã«ãããã«ãããŒãžãã¯ã©ãŠããµãŒãã¹ã§ãçµç¹ãèšå€§ãªããŒã¿ã»ãããå©çšããæ©æ¢°åŠç¿ã«ã¯ã©ãŠãã®ããããã¡ãªãããããããããšãæ¯æŽããŸããAzureMLã¯ãæ©æ¢°åŠç¿ãå©çšããããã䜿ãããããã¹ã±ãŒã©ãã«ã«ããããšãç®çãšããããŸããŸãªãµãŒãã¹ãšæ©èœãæäŸãããAzureMLã¯ãèªåæ©æ¢°åŠç¿ããã©ãã°ã»ã¢ã³ãã»ããããã«ããã¢ãã«ãã¬ãŒãã³ã°ãå ç¢ãªPython SDKãªã©ã®æ©èœãæäŸããéçºè ãæ©æ¢°åŠç¿ã¢ãã«ãæ倧éã«æŽ»çšã§ããããã«ããŸãã
AzureML ã¯YOLO ãŠãŒã¶ãŒã«ã©ã®ãããªã¡ãªãããããããã®ãïŒ
YOLO (You Only Look Once)ã®ãŠãŒã¶ãŒã«ãšã£ãŠãAzureMLã¯æ©æ¢°åŠç¿ã¢ãã«ã®ãã¬ãŒãã³ã°ãšãããã€ã®äž¡æ¹ã«ãå ç¢ã§ã¹ã±ãŒã©ãã«ãã€å¹ççãªãã©ãããã©ãŒã ãæäŸããŸããAzureMLã®æè»ã§ãŠãŒã¶ãŒãã¬ã³ããªãŒãªç°å¢ã¯ãè¿ éãªãããã¿ã€ãã®å®è¡ãããããåºç¯ãªããŒã¿ãæ±ãããã®ã¹ã±ãŒã«ã¢ãããŸã§ãããŒãºã«åãããŠããŸããŸãªããŒã«ããµãŒãã¹ãæäŸããŸããAzureMLã掻çšããããšã§ã次ã®ããšãå¯èœã«ãªããŸãïŒ
- ãã¬ãŒãã³ã°ã®ããã®å€§èŠæš¡ãªããŒã¿ã»ãããšèšç®ãªãœãŒã¹ãç°¡åã«ç®¡çã§ããŸãã
- ããŒã¿ååŠçãç¹åŸŽéžæãã¢ãã«ãã¬ãŒãã³ã°ã®ããã®çµã¿èŸŒã¿ããŒã«ã掻çšã
- ã¢ãã«ãããŒã¿ã®ã¢ãã¿ãªã³ã°ãç£æ»ãããŒãžã§ã³ç®¡çãªã©ãMLOpsïŒæ©æ¢°åŠç¿ãªãã¬ãŒã·ã§ã³ïŒã®æ©èœã«ãããããå¹ççãªã³ã©ãã¬ãŒã·ã§ã³ãå®çŸã
ãã®åŸã®ã»ã¯ã·ã§ã³ã§ã¯ãAzureML ã䜿ã£ãŠYOLO11 ãªããžã§ã¯ãæ€åºã¢ãã«ãå®è¡ããæ¹æ³ããã³ã³ãã¥ãŒãã¿ãŒããã«ãŸãã¯ããŒãããã¯ããã®ã¯ã€ãã¯ã¹ã¿ãŒãã¬ã€ãã§è©³ãã説æããŸãã
åææ¡ä»¶
å§ããåã«ãAzureML ã¯ãŒã¯ã¹ããŒã¹ã«ã¢ã¯ã»ã¹ã§ããããšã確èªããŠãã ããããæã¡ã§ãªãå Žåã¯ãAzure ã®å ¬åŒããã¥ã¡ã³ãã«åŸã£ãŠãæ°ããAzureML ã¯ãŒã¯ã¹ããŒã¹ãäœæã§ããŸãããã®ã¯ãŒã¯ã¹ããŒã¹ã¯ããã¹ãŠã®AzureMLãªãœãŒã¹ãäžå 管çããå ŽæãšããŠæ©èœããŸãã
ã³ã³ãã¥ãŒãã»ã€ã³ã¹ã¿ã³ã¹ã®äœæ
AzureMLã¯ãŒã¯ã¹ããŒã¹ãããCompute > Compute instances > Newãéžæããå¿ èŠãªãªãœãŒã¹ãæã€ã€ã³ã¹ã¿ã³ã¹ãéžæããŸãã
ã¿ãŒããã«ããã®ã¯ã€ãã¯ã¹ã¿ãŒã
ã³ã³ãã¥ãŒã¿ãèµ·åããã¿ãŒããã«ãéãïŒ
ä»®æ³envã®äœæ
condaã®virtualenvãäœæããããã«pipãã€ã³ã¹ããŒã«ããïŒ
å¿ èŠãªäŸåé¢ä¿ãã€ã³ã¹ããŒã«ããŸãïŒ
YOLO11 ã¿ã¹ã¯ã®å®è¡
äºæ³ããïŒ
æ€åºã¢ãã«ãåæåŠç¿é床0.01ã§10ãšããã¯åŠç¿ãããïŒ
Ultralytics CLI ã®è©³ãã䜿ãæ¹ã¯ãã¡ããã芧ãã ããã
ããŒãããã¯ããã®ã¯ã€ãã¯ã¹ã¿ãŒã
æ°ããIPythonã«ãŒãã«ãäœã
ã³ã³ãã¥ãŒãã¿ãŒããã«ãéããŸãã
èšç®ã¿ãŒããã«ãããäŸåé¢ä¿ã管çããããã«ããŒãããã¯ã§äœ¿çšããæ°ããipykernelãäœæããå¿ èŠããããŸãïŒ
conda create --name yolo11env -y
conda activate yolo11env
conda install pip -y
conda install ipykernel -y
python -m ipykernel install --user --name yolo11env --display-name "yolo11env"
ã¿ãŒããã«ãéããæ°ããããŒãããã¯ãäœæããŸããããŒãããã¯ããæ°ããã«ãŒãã«ãéžæã§ããŸãã
ããããããŒãããã¯ã®ã»ã«ãéããå¿ èŠãªäŸåé¢ä¿ãã€ã³ã¹ããŒã«ããããšãã§ããïŒ
%%bash
source activate yolo11env
cd ultralytics
pip install -r requirements.txt
pip install ultralytics
pip install onnx>=1.12.0
ã䜿çšããå¿
èŠãããããšã«æ³šæããŠãã ããã source activate yolo11env
bashã»ã«ãç§ãã¡ã®æãç°å¢ã䜿ãããã«ããããã§ãã
ã䜿ã£ãŠããã€ãã®äºæž¬ãå®è¡ããã Ultralytics CLI:
%%bash
source activate yolo11env
yolo predict model=yolo11n.pt source='https://ultralytics.com/images/bus.jpg'
ãããã¯ãUltralytics Python ã€ã³ã¿ãŒãã§ã€ã¹ã䜿ã£ãŠãäŸãã°ã¢ãã«ããã¬ãŒãã³ã°ããïŒ
from ultralytics import YOLO
# Load a model
model = YOLO("yolo11n.pt") # load an official YOLO11n model
# Use the model
model.train(data="coco8.yaml", epochs=3) # train the model
metrics = model.val() # evaluate model performance on the validation set
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
path = model.export(format="onnx") # export the model to ONNX format
YOLO11 ã¿ã¹ã¯ã®å®è¡ã«ã¯ãäžèšã®ã¿ãŒããã«ã®ã»ã¯ã·ã§ã³ã§èª¬æããããã«ãUltralytics CLI ãŸãã¯Python ã€ã³ã¿ãŒãã§ã€ã¹ã®ããããã䜿çšããããšãã§ããŸãã
ãããã®ã¹ãããã«åŸãããšã§ãYOLO11 ã AzureML äžã§çŽ æ©ãåäœãããããšãã§ããããã«ãªããŸããããé«åºŠãªäœ¿ãæ¹ã«ã€ããŠã¯ããã®ã¬ã€ãã®åé ã«ãªã³ã¯ãããŠãã AzureML ã®å®å šãªããã¥ã¡ã³ããåç §ããŠãã ããã
AzureMLã§ãã£ãšèª¿ã¹ã
ãã®ã¬ã€ãã¯ãYOLO11 on AzureML ã䜿ãå§ããããã®å ¥éæžã§ããããããAzureML ãæäŸã§ããããšã®è¡šé¢ããªãã£ãã ãã§ããããæ·±ãæãäžããæ©æ¢°åŠç¿ãããžã§ã¯ãã®ããã«AzureMLã®å¯èœæ§ããã«ã«åŒãåºãã«ã¯ã以äžã®ãªãœãŒã¹ã調ã¹ãããšãæ€èšããŠãã ããïŒ
- ããŒã¿ã¢ã»ããã®äœæïŒAzureMLç°å¢å ã§ããŒã¿ã¢ã»ãããå¹æçã«ã»ããã¢ãããã管çããæ¹æ³ãåŠã³ãŸãã
- AzureMLãžã§ããéå§ããŸãïŒAzureMLã§æ©æ¢°åŠç¿ãã¬ãŒãã³ã°ã®ãžã§ããéå§ããæ¹æ³ãå æ¬çã«ç解ããŸãããã
- ã¢ãã«ãç»é²ããç»é²ãããŒãžã§ãã³ã°ããããã€ã¡ã³ããå«ãã¢ãã«ç®¡çã®ãã©ã¯ãã£ã¹ã«æ £ããã
- AzureMLPython SDKã§YOLO11 ïŒAzureMLPython SDK ã䜿çšããŠYOLO11 ã¢ãã«ããã¬ãŒãã³ã°ããããã®ã¹ããããã€ã¹ãããã¬ã€ããã芧ãã ããã
- TrainYOLO11 with AzureMLCLI: AzureMLäžã®YOLO11 ã¢ãã«ã®ãã¬ãŒãã³ã°ãšç®¡çãå¹çåããã³ãã³ãã©ã€ã³ã€ã³ã¿ãŒãã§ã€ã¹ã®æŽ»çšæ¹æ³ãã玹ä»ããŸãã
ããããã質å
ã¢ãã«ãã¬ãŒãã³ã°ã®ããã«AzureMLäžã§YOLO11 ã
ã¢ãã«ãã¬ãŒãã³ã°ã®ããã«AzureMLäžã§YOLO11 ïŒ
-
ã³ã³ãã¥ãŒãã€ã³ã¹ã¿ã³ã¹ãäœæããŸãïŒAzureMLã¯ãŒã¯ã¹ããŒã¹ãããCompute > Compute instances > Newã«ç§»åããå¿ èŠãªã€ã³ã¹ã¿ã³ã¹ãéžæããŸãã
-
ç°å¢ãã»ããã¢ããããïŒã³ã³ãã¥ãŒãã€ã³ã¹ã¿ã³ã¹ãèµ·åããã¿ãŒããã«ãéããcondaç°å¢ãäœæããïŒ
-
YOLO11 ã¿ã¹ã¯ãå®è¡ããïŒUltralytics CLI ã䜿ã£ãŠã¢ãã«ããã¬ãŒãã³ã°ããïŒ
詳ããã¯ã Ultralytics CLI 㮠䜿ãæ¹ããåç §ãã ããã
YOLO11 ãã¬ãŒãã³ã°ã«AzureMLã䜿ãã¡ãªããã¯äœã§ããïŒ
AzureMLã¯ãYOLO11 ã¢ãã«ããã¬ãŒãã³ã°ããããã®å ç¢ã§å¹ççãªãšã³ã·ã¹ãã ãæäŸããŸãïŒ
- ã¹ã±ãŒã©ããªãã£ïŒããŒã¿ãã¢ãã«ã®è€éãã«å¿ããŠãã³ã³ãã¥ãŒããªãœãŒã¹ãç°¡åã«æ¡åŒµã§ããŸãã
- MLOpsã®çµ±åïŒããŒãžã§ã³ç®¡çãã¢ãã¿ãªã³ã°ãç£æ»ãªã©ã®æ©èœã掻çšããMLã®éçšãå¹çåããã
- ã³ã©ãã¬ãŒã·ã§ã³ïŒããŒã å ã§ãªãœãŒã¹ãå ±æã»ç®¡çããã³ã©ãã¬ãŒã·ã§ã³ã¯ãŒã¯ãããŒã匷åããŸãã
ãããã®å©ç¹ã«ãããAzureMLã¯è¿ éãªãããã¿ã€ããã倧èŠæš¡ãªãããã€ã¡ã³ããŸã§ãããŸããŸãªãããžã§ã¯ãã«çæ³çãªãã©ãããã©ãŒã ãšãªã£ãŠããŸãã詳现ã«ã€ããŠã¯ãAzureML Jobsãã芧ãã ããã
AzureMLã§YOLO11 ãããããåé¡ã®ãã©ãã«ã·ã¥ãŒãã£ã³ã°ã¯ã©ãããã°ããã®ã§ããããïŒ
AzureMLã®YOLO11 ãããããåé¡ã®ãã©ãã«ã·ã¥ãŒãã£ã³ã°ã¯ä»¥äžã®æé ã§è¡ããŸãïŒ
- äŸåã®åé¡:å¿
èŠãªããã±ãŒãžããã¹ãŠã€ã³ã¹ããŒã«ãããŠããããšã確èªããŠãã ãããå¿
èŠãªããã±ãŒãžã¯
requirements.txt
ãã¡ã€ã«ã«äŸåããã - ç°å¢ã®ã»ããã¢ããïŒã³ãã³ããå®è¡ããåã«ãcondaç°å¢ãæ£ããèµ·åããŠããããšã確èªããã
- ãªãœãŒã¹ã®å²ãåœãŠïŒãã¬ãŒãã³ã°ã®ã¯ãŒã¯ããŒããåŠçããã®ã«ååãªãªãœãŒã¹ãã³ã³ãã¥ãŒãã€ã³ã¹ã¿ã³ã¹ãæã£ãŠããããšã確èªããŸãã
ãã®ä»ã®ã¬ã€ãã³ã¹ã«ã€ããŠã¯ãYOLO Common Issuesã®ããã¥ã¡ã³ããã芧ãã ããã
AzureML ã§Ultralytics CLI ãšPython ã®äž¡æ¹ã®ã€ã³ã¿ãŒãã§ã€ã¹ã䜿ãããšã¯ã§ããŸããïŒ
ã¯ããAzureML ã§ã¯Ultralytics CLI ãšPython ã®äž¡æ¹ã®ã€ã³ã¿ãŒãã§ã€ã¹ãã·ãŒã ã¬ã¹ã«äœ¿çšã§ããŸãïŒ
-
CLI:ã¯ã€ãã¯ã¿ã¹ã¯ãæšæºã¹ã¯ãªãããã¿ãŒããã«ããçŽæ¥å®è¡ããã®ã«çæ³çã
-
Python ã€ã³ã¿ãŒãã§ãŒã¹ïŒã«ã¹ã¿ã ã³ãŒãã£ã³ã°ãããŒãããã¯å ã§ã®çµ±åãå¿ èŠãšãããããè€éãªã¿ã¹ã¯ã«äŸ¿å©ã§ãã
ãã詳现ãªæé ã«ã€ããŠã¯ããã¡ããš ãã¡ãã®ã¯ã€ãã¯ã¹ã¿ãŒãã¬ã€ãããåç §ãã ããã
Ultralytics YOLO11 ã䜿ãå©ç¹ã¯ïŒ
Ultralytics YOLO11 ã¯ã競åããç©äœæ€åºã¢ãã«ã«å¯ŸããŠããã€ãã®ãŠããŒã¯ãªå©ç¹ãæäŸããïŒ
- ã¹ããŒãïŒFaster R-CNNãSSDã®ãããªã¢ãã«ãšæ¯èŒããŠãæšè«ãšåŠç¿æéãéãã
- 粟床:ã¢ã³ã«ãŒããªãŒèšèšã匷åããããªãŒã°ã¡ã³ããŒã·ã§ã³æŠç¥ãªã©ã®ç¹åŸŽã«ãããæ€åºã¿ã¹ã¯ã®ç²ŸåºŠãé«ãã
- 䜿ããããïŒçŽæçãªAPIãšCLI ãè¿ éãªã»ããã¢ãããå¯èœãªãããåå¿è ã«ãçç·Žè ã«ãå©çšããããã
YOLO11 ã®æ©èœã«ã€ããŠè©³ããç¥ãããæ¹ã¯ã以äžã®ããŒãžãã芧ãã ããã Ultralytics YOLOããŒãžãã芧ãã ããã