姿å¢æšå®ããŒã¿ã»ããã®æŠèŠ
ãµããŒããããããŒã¿ã»ãã圢åŒ
Ultralytics YOLO ãã©ãŒããã
YOLO ããŒãºã¢ãã«ã®åŠç¿ã«äœ¿çšããããŒã¿ã»ããã®ã©ãã«åœ¢åŒã¯ä»¥äžã®éãïŒ
- ç»å1æã«ã€ãããã¹ããã¡ã€ã«1ã€ïŒããŒã¿ã»ããã®åç»åã«ã¯ãç»åãã¡ã€ã«ãšåãååã§æ¡åŒµåã".txt "ã®å¯Ÿå¿ããããã¹ããã¡ã€ã«ãããã
- 1ãªããžã§ã¯ãã«ã€ã1è¡ïŒããã¹ããã¡ã€ã«ã®åè¡ã¯ãç»åå ã®1ã€ã®ãªããžã§ã¯ãã€ã³ã¹ã¿ã³ã¹ã«å¯Ÿå¿ããŸãã
- è¡ããšã®ãªããžã§ã¯ãæ
å ±ïŒåè¡ã«ã¯ããªããžã§ã¯ãã»ã€ã³ã¹ã¿ã³ã¹ã«é¢ãã以äžã®æ
å ±ãå«ãŸããïŒ
- ãªããžã§ã¯ãã»ã¯ã©ã¹ã»ã€ã³ããã¯ã¹ïŒãªããžã§ã¯ãã®ã¯ã©ã¹ãè¡šãæŽæ°ïŒäŸãã°ã0ã¯äººã1ã¯è»ãªã©ïŒã
- ãªããžã§ã¯ãã®äžå¿åº§æšïŒãªããžã§ã¯ãã®äžå¿ã® x 座æšãš y 座æšã§ã0 ãã 1 ã®éã§æ£èŠåãããã
- ãªããžã§ã¯ãã®å¹ ãšé«ãïŒãªããžã§ã¯ãã®å¹ ãšé«ãã0ãã1ã®éã§æ£èŠåãããã
- ãªããžã§ã¯ãã®ããŒãã€ã³ã座æšïŒãªããžã§ã¯ãã®ããŒãã€ã³ãã§ã0ãã1ã®éã§æ£èŠåãããã
以äžã¯ã姿å¢æšå®ã¿ã¹ã¯ã®ã©ãã«ãã©ãŒãããã®äŸã§ããïŒ
Dim = 2ã®ãã©ãŒããã
Dim = 3 ã®ãã©ãŒããã
<class-index> <x> <y> <width> <height> <px1> <py1> <p1-visibility> <px2> <py2> <p2-visibility> <pxn> <pyn> <p2-visibility>
ãã®ãã©ãŒãããã§ã¯ <class-index>
ã¯ãªããžã§ã¯ãã®ã¯ã©ã¹ã®ã€ã³ããã¯ã¹ã§ãã<x> <y> <width> <height>
ã®åº§æšã§ããã ããŠã³ãã£ã³ã°ããã¯ã¹ãã㊠<px1> <py1> <px2> <py2> ... <pxn> <pyn>
ã¯ããŒãã€ã³ãã®ãã¯ã»ã«åº§æšã§ããã座æšã¯ã¹ããŒã¹ã§åºåãããã
ããŒã¿ã»ãã YAML 圢åŒ
Ultralytics ãã¬ãŒã ã¯ãŒã¯ã¯ãæ€åºã¢ãã«ããã¬ãŒãã³ã°ããããã®ããŒã¿ã»ãããšã¢ãã«æ§æãå®çŸ©ããããã«ãYAML ãã¡ã€ã«åœ¢åŒã䜿çšããŸããæ€åºããŒã¿ã»ããã®å®çŸ©ã«äœ¿çšãããYAMLãã©ãŒãããã®äŸã瀺ããŸãïŒ
# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: ../datasets/coco8-pose # dataset root dir
train: images/train # train images (relative to 'path') 4 images
val: images/val # val images (relative to 'path') 4 images
test: # test images (optional)
# Keypoints
kpt_shape: [17, 3] # number of keypoints, number of dims (2 for x,y or 3 for x,y,visible)
flip_idx: [0, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11, 14, 13, 16, 15]
# Classes dictionary
names:
0: person
ã«ã€ã㊠train
ãã㊠val
ãã£ãŒã«ãã¯ããããããã¬ãŒãã³ã°ç»åãšæ€èšŒç»åãå«ããã£ã¬ã¯ããªãžã®ãã¹ãæå®ããŸãã
names
ã¯ã¯ã©ã¹åã®èŸæžã§ãããååã®é åºã¯ãYOLO ããŒã¿ã»ããã»ãã¡ã€ã«å
ã®ãªããžã§ã¯ãã»ã¯ã©ã¹ã»ã€ã³ããã¯ã¹ã®é åºãšäžèŽããå¿
èŠããããŸãã
(ãªãã·ã§ã³) ãããã€ã³ããå·Šå³å¯Ÿç§°ã§ããã°ã人éãé¡ã®å·Šå³ã®ããã« flip_idx ãå¿ èŠã§ããäŸãã°ãé¡ã®ã©ã³ãããŒã¯ã®ããŒãã€ã³ãã5ã€ãããšããŸãïŒ[å ã®ã€ã³ããã¯ã¹ã [0, 1, 2, 3, 4] ã§ããå Žåãflip_idx 㯠[1, 0, 2, 4, 3] ãšãªããŸãïŒå·Šå³ã®ã€ã³ããã¯ã¹ãã€ãŸã 0-1 ãš 3-4 ã亀æããã ãã§ããã®äŸã§ã¯éŒ»ã®ãããªä»ã®ã€ã³ããã¯ã¹ã¯å€æŽããŸããïŒã
䜿çšæ¹æ³
äŸ
察å¿ããŒã¿ã»ãã
ãã®ã»ã¯ã·ã§ã³ã§ã¯ãUltralytics YOLO 圢åŒãšäºææ§ããããããŒãºæšå®ã¢ãã«ã®ãã¬ãŒãã³ã°ã«äœ¿çšã§ããããŒã¿ã»ããã®æŠèŠã説æããŸãïŒ
COCO-ããŒãº
- 説æCOCO-Poseã¯ã倧èŠæš¡ãªãªããžã§ã¯ãæ€åºãã»ã°ã¡ã³ããŒã·ã§ã³ãããã³ããŒãºæšå®ããŒã¿ã»ããã§ãã人æ°ã®é«ãCOCOããŒã¿ã»ããã®ãµãã»ããã§ã人éã®ããŒãºæšå®ã«ç¹åããŠãããCOCO-Poseã«ã¯ãå人ç©ã®ã€ã³ã¹ã¿ã³ã¹ã«å¯ŸããŠè€æ°ã®ããŒãã€ã³ããå«ãŸããŠããŸãã
- ã©ãã«ãã©ãŒãããïŒUltralytics YOLO äžèšã®ãã©ãŒããããšåãã§ã人ç©ã®ããŒãºãããŒãã€ã³ããšããã
- ã¯ã©ã¹ã®æ°ïŒ1ïŒäººéïŒã
- ããŒãã€ã³ã錻ãç®ãè³ãè©ãèãæéŠãè °ãèã足éŠãå«ã17ã®ããŒãã€ã³ãã
- 䜿çšæ¹æ³äººéã®ããŒãºæšå®ã¢ãã«ã®ãã¬ãŒãã³ã°ã«é©ããŠããŸãã
- è¿œèšããŒã¿ã»ããã¯è±å¯ã§å€æ§ã§ããã200k以äžã®ã©ãã«ä»ãç»åãå«ãã
- COCO-Poseã«ã€ããŠãã£ãšèªã
COCO8-ããŒãº
- 説æUltralyticsCOCO8-Poseã¯ãCOCO train 2017ã»ããã®æåã®8æïŒãã¬ãŒãã³ã°çš4æãæ€èšŒçš4æïŒã§æ§æããããå°ãããå€çšéãªããŒãºæ€åºããŒã¿ã»ããã§ããã
- ã©ãã«ãã©ãŒãããïŒUltralytics YOLO äžèšã®ãã©ãŒããããšåãã§ã人ç©ã®ããŒãºãããŒãã€ã³ããšããã
- ã¯ã©ã¹ã®æ°ïŒ1ïŒäººéïŒã
- ããŒãã€ã³ã錻ãç®ãè³ãè©ãèãæéŠãè °ãèã足éŠãå«ã17ã®ããŒãã€ã³ãã
- 䜿ãæ¹ç©äœæ€åºã¢ãã«ã®ãã¹ãããããã°ããŸãã¯æ°ããæ€åºã¢ãããŒãã®å®éšã«é©ããŠããŸãã
- ãã®ä»ã®æ³šæäºé COCO8-Poseã¯ãµããã£ã»ãã§ãã¯ãCIãã§ãã¯ã«æé©ã
- COCO8-ããŒãºã«ã€ããŠãã£ãšèªã
ã¿ã€ã¬ãŒã»ããŒãº
- 説æUltralyticsãã®åç©ããŒãºããŒã¿ã»ããã¯ãYouTubeåç»ããååŸãã263æã®ç»åããæ§æããã210æã®ç»åããã¬ãŒãã³ã°çšã«ã53æã®ç»åãæ€èšŒçšã«å²ãåœãŠãããŠããã
- ã©ãã«ãã©ãŒãããïŒUltralytics YOLO äžèšã®ãã©ãŒããããšåããåç©ã®ããŒãºãè¡šã12åã®ããŒãã€ã³ããããã寞æ³ã¯èŠããªãã
- ã¯ã©ã¹æ°ïŒ1ïŒã¿ã€ã¬ãŒïŒã
- ããŒãã€ã³ã12ã®ããŒãã€ã³ã
- 䜿ãæ¹åç©ã®ããŒãºã人é以å€ã®ããŒãºã«æé©ã
- ã¿ã€ã¬ãŒã»ããŒãºã«ã€ããŠãã£ãšèªã
ãã³ãã®ããŒãã€ã³ã
- 説æãã³ãããŒãã€ã³ãããŒãºããŒã¿ã»ããã¯çŽ26Kæã®ç»åããæ§æããã18776æã®ç»åããã¬ãŒãã³ã°çšã«ã7992æã®ç»åãæ€èšŒçšã«å²ãåœãŠãããŠããã
- ã©ãã«ãã©ãŒãããïŒUltralytics YOLO äžèšã®ãã©ãŒããããšåãã ãã人ã®æãšèŠãã寞æ³ã«21ã®ããŒãã€ã³ããããã
- ã¯ã©ã¹æ°1ïŒãã³ãïŒã
- ããŒãã€ã³ã21ã®ããŒãã€ã³ã
- 䜿çšæ¹æ³äººéã®æã®ããŒãºæšå®ã«æé©ã
- ãã³ãã®ããŒãã€ã³ã ã«ã€ããŠãã£ãšèªã
ç¬ã®ããŒãº
- 説æDog PoseããŒã¿ã»ããã«ã¯çŽ6,000æã®ç»åãåé²ãããŠãããç¬ã®ããŒãºæšå®ã¢ãã«ã®ãã¬ãŒãã³ã°ãæ€èšŒã®ããã®å€æ§ã§åºç¯ãªãªãœãŒã¹ãæäŸããã
- ã©ãã«ãã©ãŒãããïŒUltralytics YOLO ãã©ãŒãããã«åŸããç¬ã®è§£ååŠã«ç¹åããè€æ°ã®ããŒãã€ã³ãã«æ³šéãä»ãããŠããã
- ã¯ã©ã¹æ°1ïŒç¬ïŒã
- ããŒãã€ã³ãæ足ãé¢ç¯ãé ã®äœçœ®ãªã©ãç¬ã®ããŒãºã«åããã24ã®ããŒãã€ã³ããåé²ã
- çšéç 究ããå®äžçã§ã®å¿çšãŸã§ãæ§ã ãªå Žé¢ã§ç¬ã®ããŒãºãæšå®ããã¢ãã«ã®ãã¬ãŒãã³ã°ã«æé©ã
- ç¬ã®ããŒãº ã«ã€ããŠãã£ãšèªã
ç¬èªã®ããŒã¿ã»ãããè¿œå ãã
ç¬èªã®ããŒã¿ã»ããããæã¡ã§ãUltralytics YOLO 圢åŒã§ããŒãºæšå®ã¢ãã«ã®ãã¬ãŒãã³ã°ã«äœ¿çšãããå Žåã¯ãäžèšã®ãUltralytics YOLO 圢åŒãã§æå®ããã圢åŒã«åŸã£ãŠããããšã確èªããŠãã ãããã¢ãããŒã·ã§ã³ãå¿ èŠãªãã©ãŒãããã«å€æããYAMLèšå®ãã¡ã€ã«ã§ãã¹ãã¯ã©ã¹æ°ãã¯ã©ã¹åãæå®ããŸãã
å€æããŒã«
Ultralytics ã¯ãäžè¬çãªCOCOããŒã¿ã»ãã圢åŒããYOLO 圢åŒã«ã©ãã«ãå€æãã䟿å©ãªå€æããŒã«ãæäŸããŸãïŒ
äŸ
ãã®å€æããŒã«ã䜿ã£ãŠãCOCO ããŒã¿ã»ãããŸã㯠COCO ãã©ãŒãããã®ä»»æã®ããŒã¿ã»ãããUltralytics YOLO ãã©ãŒãããã«å€æããããšãã§ããããã® use_keypoints
ãã©ã¡ãŒã¿ã¯ãå€æåŸã®ã©ãã«ã«ïŒããŒãºæšå®ã®ããã®ïŒããŒãã€ã³ããå«ãããã©ãããæå®ããŸãã
ããããã質å
Ultralytics YOLO ãã©ãŒãããã¯äœã§ããïŒ
Ultralytics YOLO 圢åŒã«ãã姿å¢æšå®ããŒã¿ã»ããã§ã¯ãåç»åã«å¯Ÿå¿ããããã¹ããã¡ã€ã«ã®ã©ãã«ä»ããè¡ããŸããããã¹ããã¡ã€ã«ã®åè¡ã«ã¯ããªããžã§ã¯ãã®ã€ã³ã¹ã¿ã³ã¹ã«é¢ããæ å ±ãæ ŒçŽãããŠããŸãïŒ
- ãªããžã§ã¯ãã»ã¯ã©ã¹ã»ã€ã³ããã¯ã¹
- ãªããžã§ã¯ãã®äžå¿åº§æšïŒæ£èŠåãããxãšyïŒ
- ãªããžã§ã¯ãã®å¹ ãšé«ãïŒæ£èŠåïŒ
- ãªããžã§ã¯ãã®ããŒãã€ã³ã座æšïŒæ£èŠåãããpxnãšpynïŒ
2DããŒãºã®å ŽåãããŒãã€ã³ãã«ã¯ãã¯ã»ã«åº§æšãå«ãŸããã3Dã®å ŽåãåããŒãã€ã³ãã¯å¯èŠãã©ã°ãæã€ã詳ããã¯ãUltralytics YOLO ãã©ãŒããããã芧ãã ããã
COCO-Pose ããŒã¿ã»ãããUltralytics YOLO ã§äœ¿çšããã«ã¯ïŒ
COCO-Pose ããŒã¿ã»ãããUltralytics YOLO ã§äœ¿çšããïŒ
- ããŒã¿ã»ãããããŠã³ããŒãããYOLO 圢åŒã§ã©ãã«ãã¡ã€ã«ãæºåããŠãã ããã
- ãã¬ãŒãã³ã°ç»åãšæ€èšŒç»åã®ãã¹ãããŒãã€ã³ãã®åœ¢ç¶ãã¯ã©ã¹åãæå®ããYAMLèšå®ãã¡ã€ã«ãäœæããã
-
ãã¬ãŒãã³ã°ã«ã¯èšå®ãã¡ã€ã«ã䜿çšããïŒ
from ultralytics import YOLO model = YOLO("yolo11n-pose.pt") # load pretrained model results = model.train(data="coco-pose.yaml", epochs=100, imgsz=640)
詳ããã¯ãCOCO-Poseãš åè»ã®ã»ã¯ã·ã§ã³ãã芧ãã ããã
Ultralytics YOLO ã§ãããŒãºæšå®ã®ããã«ç¬èªã®ããŒã¿ã»ãããè¿œå ããã«ã¯ã©ãããã°ããã§ããïŒ
ããŒã¿ã»ãããè¿œå ãã
- 泚éãUltralytics YOLO ãã©ãŒãããã«å€æããŸãã
- ããŒã¿ã»ããã®ãã¹ãã¯ã©ã¹ã®æ°ãã¯ã©ã¹åãæå®ããYAMLèšå®ãã¡ã€ã«ãäœæããã
-
èšå®ãã¡ã€ã«ã䜿ã£ãŠã¢ãã«ããã¬ãŒãã³ã°ããïŒ
from ultralytics import YOLO model = YOLO("yolo11n-pose.pt") results = model.train(data="your-dataset.yaml", epochs=100, imgsz=640)
å®å šãªæé ã«ã€ããŠã¯ãç¬èªã®ããŒã¿ã»ãããè¿œå ããã»ã¯ã·ã§ã³ãåç §ããŠãã ããã
Ultralytics YOLO ã®ããŒã¿ã»ãã YAML ãã¡ã€ã«ã®ç®çã¯äœã§ããïŒ
Ultralytics YOLO ã®ããŒã¿ã»ããYAMLãã¡ã€ã«ã¯ããã¬ãŒãã³ã°çšã®ããŒã¿ã»ãããšã¢ãã«ã®èšå®ãå®çŸ©ããŸãããã¬ãŒãã³ã°ç»åãæ€èšŒç»åããã¹ãç»åãžã®ãã¹ãããŒãã€ã³ãã®åœ¢ç¶ãã¯ã©ã¹åããã®ä»ã®èšå®ãªãã·ã§ã³ãæå®ããŸãããã®æ§é åããããã©ãŒãããã¯ããŒã¿ã»ãã管çãšã¢ãã«ãã¬ãŒãã³ã°ã®å¹çåã«åœ¹ç«ã¡ãŸãã以äžã¯YAMLãã©ãŒãããã®äŸã§ãïŒ
ããŒã¿ã»ããYAMLãã©ãŒãããã§ã®YAMLèšå®ãã¡ã€ã«ã®äœæã«ã€ããŠã®è©³çŽ°ã¯ãã¡ããã芧ãã ããã
ããŒãºæšå®ã®ããã«ãCOCOããŒã¿ã»ããã®ã©ãã«ãUltralytics YOLO 圢åŒã«å€æããã«ã¯ã©ãããã°ããã§ããïŒ
Ultralytics ã¯ãCOCO ããŒã¿ã»ããã®ã©ãã«ããããŒãã€ã³ãæ å ±ãå«ãYOLO ãã©ãŒãããã«å€æããå€æããŒã«ãæäŸããŸãïŒ
from ultralytics.data.converter import convert_coco
convert_coco(labels_dir="path/to/coco/annotations/", use_keypoints=True)
ãã®ããŒã«ã¯ãCOCO ããŒã¿ã»ãããYOLO ãããžã§ã¯ãã«ã·ãŒã ã¬ã¹ã«çµ±åããã®ã«åœ¹ç«ã¡ãŸãã詳现ã«ã€ããŠã¯ãå€æããŒã«ã®ã»ã¯ã·ã§ã³ãåç §ããŠãã ããã