ã¢ãã«æ€èšŒUltralytics YOLO
ã¯ããã«
æ€èšŒã¯æ©æ¢°åŠç¿ãã€ãã©ã€ã³ã®éèŠãªã¹ãããã§ãããåŠç¿ããã¢ãã«ã®å質ãè©äŸ¡ããããšãã§ããŸããUltralytics YOLO11 ã® Val ã¢ãŒãã¯ããªããžã§ã¯ãæ€åºã¢ãã«ã®ããã©ãŒãã³ã¹ãè©äŸ¡ããããã®ãå ç¢ãªããŒã«ãšã¡ããªã¯ã¹ã®ã¹ã€ãŒããæäŸããŸãããã®ã¬ã€ãã¯ãã¢ãã«ãæ£ç¢ºã§ä¿¡é Œã§ããããšãä¿èšŒããããã«ãValã¢ãŒããå¹æçã«äœ¿çšããæ¹æ³ãç解ããããã®å®å šãªãªãœãŒã¹ãšãªããŸãã
èŠããã ïŒ Ultralytics ã¢ãŒãã®ãã¥ãŒããªã¢ã«ããªããŒã·ã§ã³
ãªãUltralytics YOLO ã§æ€èšŒããã®ãïŒ
YOLO11 ã®ãã«ã»ã¢ãŒããæå©ãªçç±ã¯ä»¥äžã®éãã ïŒ
- 粟床ïŒmAP50ãmAP75ãmAP50-95ã®ãããªæ£ç¢ºãªã¡ããªã¯ã¹ãååŸããã¢ãã«ãç·åçã«è©äŸ¡ããŸãã
- å©äŸ¿æ§ïŒãã¬ãŒãã³ã°èšå®ãèšæ¶ããå èµæ©èœã掻çšããæ€èšŒããã»ã¹ãç°¡çŽ åã
- æè»æ§ïŒåããŸãã¯ç°ãªãããŒã¿ã»ãããšç»åãµã€ãºã§ã¢ãã«ãæ€èšŒããŸãã
- ãã€ããŒãã©ã¡ãŒã¿ã®ãã¥ãŒãã³ã°ïŒæ€èšŒã¡ããªã¯ã¹ã䜿çšããŠãããè¯ãããã©ãŒãã³ã¹ãåŸãããã«ã¢ãã«ã埮調æŽããŸãã
ãã«ã»ã¢ãŒãã®äž»ãªç¹åŸŽ
ãããã¯ãYOLO11 ããŽã¡ã«ãã¢ãŒããæäŸããç¹çãã¹ãæ©èœã§ããïŒ
- èªåèšå®ïŒã¢ãã«ã¯ãã¬ãŒãã³ã°ã®èšå®ãèšæ¶ããæ€èšŒã容æã«ããŸãã
- ãã«ãã¡ããªãã¯ãµããŒãïŒããŸããŸãªç²ŸåºŠã¡ããªã¯ã¹ã«åºã¥ããŠã¢ãã«ãè©äŸ¡ããŸãã
- CLI ããã³Python APIã䜿çšããŠããŸãïŒã³ãã³ãã©ã€ã³ã€ã³ã¿ãŒãã§ã€ã¹ãŸãã¯Python APIãããæ€èšŒã®ã奜ã¿ã«å¿ããŠãéžã³ãã ããã
- ããŒã¿äºææ§ïŒãã¬ãŒãã³ã°æ®µéã§äœ¿çšãããããŒã¿ã»ããã ãã§ãªããã«ã¹ã¿ã ããŒã¿ã»ããã§ãã·ãŒã ã¬ã¹ã«åäœããŸãã
ããã
- YOLO11 ã¢ãã«ã¯èªåçã«ãã¬ãŒãã³ã°èšå®ãèšæ¶ããã®ã§ãåãç»åãµã€ãºãšå
ã®ããŒã¿ã»ããã§ã¢ãã«ãæ€èšŒããããšãã§ããŸãã
yolo val model=yolo11n.pt
ãŸãã¯model('yolo11n.pt').val()
䜿çšäŸ
åŠç¿æžã¿YOLO11nã¢ãã«ã®æ€èšŒ 粟床 ãCOCO8ããŒã¿ã»ããã«é©çšãããåŒæ°ã¯å¿
èŠãªãã model
ãã¬ãŒãã³ã° data
ãšåŒæ°ãã¢ãã«å±æ§ãšããŠäœ¿çšããŸãããšã¯ã¹ããŒãåŒæ°ã®å®å
šãªãªã¹ãã«ã€ããŠã¯ã以äžã®åŒæ°ã®ã»ã¯ã·ã§ã³ãåç
§ããŠãã ããã
äŸ
from ultralytics import YOLO
# Load a model
model = YOLO("yolo11n.pt") # load an official model
model = YOLO("path/to/best.pt") # load a custom model
# Validate the model
metrics = model.val() # no arguments needed, dataset and settings remembered
metrics.box.map # map50-95
metrics.box.map50 # map50
metrics.box.map75 # map75
metrics.box.maps # a list contains map50-95 of each category
YOLO ã¢ãã«æ€èšŒã®è«æ
YOLO ã¢ãã«ã®æ€èšŒã§ã¯ãããã€ãã®åŒæ°ã埮調æŽããŠè©äŸ¡ããã»ã¹ãæé©åããããšãã§ããŸãããããã®åŒæ°ã¯ãå ¥åç»åãµã€ãºããããåŠçãããã©ãŒãã³ã¹ãããå€ãªã©ã®åŽé¢ãå¶åŸ¡ããŸãã以äžã¯ãæ€èšŒèšå®ãå¹æçã«ã«ã¹ã¿ãã€ãºããããã®ãååŒæ°ã®è©³çŽ°ãªå èš³ã§ãã
è°è« | ã¿ã€ã | ããã©ã«ã | 説æ |
---|---|---|---|
data |
str |
None |
ããŒã¿ã»ããèšå®ãã¡ã€ã«ãžã®ãã¹ãæå®ããïŒäŸïŒ coco8.yaml ).ãã®ãã¡ã€ã«ã«ã¯ æ€èšŒããŒã¿ã¯ã©ã¹åãã¯ã©ã¹æ° |
imgsz |
int |
640 |
å ¥åç»åã®ãµã€ãºãå®çŸ©ããŸãããã¹ãŠã®ç»åã¯ãåŠçåã«ãã®å¯žæ³ã«ãªãµã€ãºãããŸãã |
batch |
int |
16 |
ããããããã®ç»åæ°ãèšå®ããŸãã䜿çšæ¹æ³ -1 ãªãŒããããã¯ãGPU ã¡ã¢ãªã®å¯çšæ§ã«åºã¥ããŠèªåçã«èª¿æŽãããŸãã |
save_json |
bool |
False |
ãã True ããã«åæããããä»ã®ããŒã«ãšçµ±åãããããããã«ãçµæãJSONãã¡ã€ã«ã«ä¿åããŸãã |
save_hybrid |
bool |
False |
ãã True ã©ãã«ã®ãã€ããªããããŒãžã§ã³ã¯ãå
ã®ã¢ãããŒã·ã§ã³ãšè¿œå ã¢ãã«ã®äºæž¬ãçµã¿åãããŠä¿åããŸãã |
conf |
float |
0.001 |
æ€åºã®æå°ä¿¡é ŒåºŠéŸå€ãèšå®ããããã®éŸå€ä»¥äžã®ä¿¡é ŒåºŠã®æ€åºã¯ç Žæ£ãããã |
iou |
float |
0.6 |
Non-Maximum SuppressionïŒNMSïŒã®Intersection Over UnionïŒIoUïŒãããå€ãèšå®ããŸããéè€æ€åºã®äœæžã«åœ¹ç«ã¡ãŸãã |
max_det |
int |
300 |
ç»åãããã®æ倧æ€åºæ°ãå¶éããŸããå¯ãªã·ãŒã³ã§éå°ãªæ€åºãé²ãã®ã«äŸ¿å©ã§ãã |
half |
bool |
True |
å粟床(FP16)èšç®ãå¯èœã«ãªããã¡ã¢ãªäœ¿çšéãåæžããã粟床ãžã®åœ±é¿ãæå°éã«æããªããé床ãåäžããå¯èœæ§ããããŸãã |
device |
str |
None |
æ€èšŒçšããã€ã¹ãæå®ãã (cpu , cuda:0 ãªã©ïŒãCPU ãŸãã¯GPU ã®ãªãœãŒã¹ãæè»ã«å©çšã§ããã |
dnn |
bool |
False |
ãã True ã䜿çšããŠããã ãªãŒãã³CV ONNX ã¢ãã«æšè«ã®ããã®DNNã¢ãžã¥ãŒã«ã PyTorch æšè«æ¹æ³ã |
plots |
bool |
False |
ã«èšå®ããå Žå True ãŸããã¢ãã«ã®æ§èœãèŠèŠçã«è©äŸ¡ããããã«ãäºæž¬å€ãšã°ã©ã³ããã¥ã«ãŒã¹ã®ãããããçæããä¿åããŸãã |
rect |
bool |
True |
ãã True ç©åœ¢æšè«ããããã³ã°ã«äœ¿çšããããšã§ãããã£ã³ã°ãæžãããã¹ããŒããšå¹çãåäžãããå¯èœæ§ãããã |
split |
str |
val |
æ€èšŒã«äœ¿ãããŒã¿ã»ããã®åå²ã決å®ãã (val , test ããã㯠train ).æ§èœè©äŸ¡çšã®ããŒã¿ã»ã°ã¡ã³ããæè»ã«éžæã§ããã |
project |
str |
None |
æ€èšŒåºåãä¿åããããããžã§ã¯ãã»ãã£ã¬ã¯ããªã®ååã |
name |
str |
None |
æ€èšŒå®è¡ã®ååããããžã§ã¯ããã©ã«ãå ã«ãµããã£ã¬ã¯ããªãäœæããããã«æ€èšŒãã°ãšåºåãä¿åããŸãã |
ãããã®åèšå®ã¯ãæ€èšŒããã»ã¹ã«ãããŠéèŠãªåœ¹å²ãæãããYOLO ã¢ãã«ã®ã«ã¹ã¿ãã€ãºå¯èœã§å¹ççãªè©äŸ¡ãå¯èœã«ããŸããç¹å®ã®ããŒãºããªãœãŒã¹ã«å¿ããŠãããã®ãã©ã¡ãŒã¿ã調æŽããããšã§ã粟床ãšæ§èœã®æé©ãªãã©ã³ã¹ãéæããããšãã§ããŸãã
åŒæ°ã«ããããªããŒã·ã§ã³ã®äŸ
以äžã®äŸã§ã¯ãPython ãšCLI ã®ã«ã¹ã¿ã åŒæ°ã䜿çšããYOLO ã¢ãã«ã®æ€èšŒã玹ä»ããŸãã
äŸ
ããããã質å
Ultralytics ã䜿ã£ãŠYOLO11 ã¢ãã«ãæ€èšŒããã«ã¯ïŒ
YOLO11 ã¢ãã«ã®æ€èšŒã«ã¯ãUltralytics ãæäŸãã Val ã¢ãŒãã䜿çšããããšãã§ãããäŸãã°ãPython APIã䜿ã£ãŠãã¢ãã«ãããŒãããæ€èšŒãå®è¡ããããšãã§ããŸãïŒ
from ultralytics import YOLO
# Load a model
model = YOLO("yolo11n.pt")
# Validate the model
metrics = model.val()
print(metrics.box.map) # map50-95
ãŸããã³ãã³ãã©ã€ã³ã€ã³ã¿ãŒãã§ã€ã¹(CLI)ã䜿ãããšãã§ããŸãïŒ
ããã«ã«ã¹ã¿ãã€ãºããã«ã¯ã次ã®ãããªããŸããŸãªåŒæ°ã調æŽã§ããŸãã imgsz
, batch
ãã㊠conf
Python ãšCLI ã®äž¡æ¹ã®ã¢ãŒãã§ãããã§ãã¯ããã YOLO ã¢ãã«æ€èšŒã®è«æ ã»ã¯ã·ã§ã³ãåç
§ã®ããšã
YOLO11 ã¢ãã«æ€èšŒããã©ã®ãããªææšãåŸãããšãã§ããŸããïŒ
YOLO11 ã¢ãã«ã®æ€èšŒã¯ãã¢ãã«ã®æ§èœãè©äŸ¡ããããã®ããã€ãã®éèŠãªææšãæäŸããããããã«ã¯ä»¥äžãå«ãŸããïŒ
- mAP50ïŒIoUéŸå€0.5ã«ãããå¹³åå¹³å粟床ïŒ
- mAP75ïŒIoUéŸå€0.75ã«ãããå¹³åå¹³å粟床ïŒ
- mAP50-95ïŒ0.5ïœ0.95ã®è€æ°ã®IoUãããå€ã«ãããå¹³å粟床ïŒ
Python API ã䜿çšãããšã以äžã®ããã«ãããã®ã¡ããªã¯ã¹ã«ã¢ã¯ã»ã¹ã§ããŸãïŒ
metrics = model.val() # assumes `model` has been loaded
print(metrics.box.map) # mAP50-95
print(metrics.box.map50) # mAP50
print(metrics.box.map75) # mAP75
print(metrics.box.maps) # list of mAP50-95 for each category
å®å šãªããã©ãŒãã³ã¹è©äŸ¡ã®ããã«ã¯ããããã®ææšããã¹ãŠèŠçŽãããšã極ããŠéèŠã§ããã詳现ã«ã€ããŠã¯ãããã«ã»ã¢ãŒãã®äž»ãªç¹åŸŽããåç §ã
Ultralytics YOLO ãæ€èšŒã«äœ¿çšããå©ç¹ã¯äœã§ããïŒ
Ultralytics YOLO ãæ€èšŒã«äœ¿çšãããšãããã€ãã®å©ç¹ãããïŒ
- ç²ŸåºŠïŒ YOLO11 ã¯ãmAP50ãmAP75ãmAP50-95ãå«ãæ£ç¢ºãªæ§èœææšãæäŸããŸãã
- å©äŸ¿æ§ïŒã¢ãã«ã¯ãã¬ãŒãã³ã°èšå®ãèšæ¶ããŠããã®ã§ãæ€èšŒã¯ç°¡åã§ãã
- æè»æ§ïŒåäžãŸãã¯ç°ãªãããŒã¿ã»ãããç»åãµã€ãºã«å¯ŸããŠæ€èšŒã§ããŸãã
- ãã€ããŒãã©ã¡ãŒã¿ã®ãã¥ãŒãã³ã°ïŒæ€èšŒã¡ããªã¯ã¹ã¯ãããè¯ãããã©ãŒãã³ã¹ãåŸãããã«ã¢ãã«ã埮調æŽããã®ã«åœ¹ç«ã¡ãŸãã
ãããã®å©ç¹ã«ãããã¢ãã«ã培åºçã«è©äŸ¡ãããåªããçµæãåŸãããã«æé©åãããããšãä¿èšŒãããŸãããããã®å©ç¹ã«ã€ããŠã¯ã Ultralytics YOLO ã§æ€èšŒããçç±ãã芧ãã ããã
ã«ã¹ã¿ã ããŒã¿ã»ããã䜿ã£ãŠYOLO11 ã¢ãã«ãæ€èšŒã§ããŸããïŒ
ã¯ããYOLO11 ã®ã¢ãã«ãæ€èšŒããããšãã§ããŸãã ã«ã¹ã¿ã ããŒã¿ã»ãã.ãæå®ããã data
åŒæ°ã«ãããŒã¿ã»ããèšå®ãã¡ã€ã«ãžã®ãã¹ãæå®ããããã®ãã¡ã€ã«ã«ã¯ æ€èšŒããŒã¿ã¯ã©ã¹åããã®ä»é¢é£ãã詳现ã
Python ã®äŸïŒ
from ultralytics import YOLO
# Load a model
model = YOLO("yolo11n.pt")
# Validate with a custom dataset
metrics = model.val(data="path/to/your/custom_dataset.yaml")
print(metrics.box.map) # map50-95
CLI ã䜿ã£ãäŸïŒ
ããªããŒã·ã§ã³äžã®ã«ã¹ã¿ãã€ãºå¯èœãªãªãã·ã§ã³ã«ã€ããŠã¯ãåŒæ°ã䜿ã£ãããªããŒã·ã§ã³ã®äŸãåç §ããŠãã ããã
YOLO11 ãæ€èšŒçµæãJSONãã¡ã€ã«ã«ä¿åããã«ã¯ïŒ
æ€èšŒçµæãJSONãã¡ã€ã«ã«ä¿åããã«ã¯ save_json
åŒæ° True
ãå®è¡ãããããã¯Python API ãšCLI ã®äž¡æ¹ã§å®è¡ã§ããã
Python ã®äŸïŒ
from ultralytics import YOLO
# Load a model
model = YOLO("yolo11n.pt")
# Save validation results to JSON
metrics = model.val(save_json=True)
CLI ã䜿ã£ãäŸïŒ
ãã®æ©èœã¯ããããªãåæãä»ã®ããŒã«ãšã®çµ±åã«ç¹ã«åœ¹ç«ã¡ãŸãã詳现ã«ã€ããŠã¯ã YOLO ã¢ãã«æ€èšŒã®åŒæ°ããã§ãã¯ããŠãã ããã