YOLOv8 å®éšã®è¿œè·¡ãšå¯èŠåã®åŒ·åWeights & Biases
ã®ãããªç©äœæ€åºã¢ãã«ã¯ Ultralytics YOLOv8ã¯ãå€ãã®ã³ã³ãã¥ãŒã¿ã»ããžã§ã³ã»ã¢ããªã±ãŒã·ã§ã³ã«äžå¯æ¬ ãªãã®ãšãªã£ãŠããããããããã®ãããªè€éãªã¢ãã«ã®ãã¬ãŒãã³ã°ãè©äŸ¡ãå°å ¥ã«ã¯ããã€ãã®èª²é¡ããããŸããäž»èŠãªãã¬ãŒãã³ã°ã¡ããªã¯ã¹ã®è¿œè·¡ãã¢ãã«ããªã¢ã³ãã®æ¯èŒãã¢ãã«åäœã®åæãåé¡ã®æ€åºã«ã¯ã倧èŠæš¡ãªèšæž¬ãšå®éšç®¡çãå¿ èŠã§ãã
èŠããã ïŒ Ultralytics YOLOv8 ã®äœ¿ãæ¹Weights and Biases
ãã®ã¬ã€ãã§ã¯ã次ã®å 容ã玹ä»ããŸãã Ultralytics YOLOv8 ãšã®çµ±å Weights & Biases' ã䜿çšããŠãå®éšã®è¿œè·¡ãã¢ãã«ã®ãã§ãã¯ãã€ã³ãèšå®ãããã³ã¢ãã«ã®ããã©ãŒãã³ã¹ã®èŠèŠåã匷åããŸãããŸããçµ±åã®èšå®ããã¬ãŒãã³ã°ã埮調æŽãããã³çµæã®èŠèŠåã®æé ãå«ãŸããŠããŸãã Weights & Biases' ã€ã³ã¿ã©ã¯ãã£ãæ©èœã
Weights & Biases
Weights & Biasesã¯ãæ©æ¢°åŠç¿å®éšã®è¿œè·¡ãå¯èŠåã管çã®ããã«èšèšãããæå 端ã®MLOpsãã©ãããã©ãŒã ã§ããå®éšã®å®å šãªåçŸæ§ãå®çŸãããã¬ãŒãã³ã°ã¡ããªã¯ã¹ã®èªåãã®ã³ã°ãåçåãããããŒã¿åæã®ããã®ã€ã³ã¿ã©ã¯ãã£ããªUIãæ§ã ãªç°å¢ã«ãããã€ããããã®å¹ççãªã¢ãã«ç®¡çããŒã«ãåããŠããŸãã
YOLOv8 ãã¬ãŒãã³ã°Weights & Biases
YOLOv8 ãã¬ãŒãã³ã°ã»ããã»ã¹ã®å¹çåãšèªååã®ããã«ãWeights & Biases ã
ã€ã³ã¹ããŒã«
å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããã«ã¯
ã€ã³ã¹ããŒã«
ã€ã³ã¹ããŒã«ããã»ã¹ã«é¢ãã詳现ãªèª¬æãšãã¹ããã©ã¯ãã£ã¹ã«ã€ããŠã¯ãYOLOv8 ã€ã³ã¹ããŒã«ã¬ã€ããã芧ãã ãããYOLOv8 ã«å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããéãäœããã®åé¡ãçºçããå Žåã¯ã解決çããã³ãã«ã€ããŠãããããåé¡ãã¬ã€ããåç §ããŠãã ããã
èšå®Weights & Biases
å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ãããã次ã®ã¹ãããã¯Weights & Biases ç°å¢ã®ã»ããã¢ããã§ããããã«ã¯Weights & Biases ã¢ã«ãŠã³ãã®äœæãšãéçºç°å¢ãš W&B ãã©ãããã©ãŒã ãã¹ã ãŒãºã«æ¥ç¶ããããã«å¿ èŠãª API ããŒã®ååŸãå«ãŸããŸãã
ãŸããã¯ãŒã¯ã¹ããŒã¹ã®Weights & Biases ç°å¢ãåæåããŸãã以äžã®ã³ãã³ããå®è¡ããããã³ããã®æ瀺ã«åŸã£ãŠãã ããã
SDKã®åæã»ããã¢ãã
Weights & Biases èªèšŒããŒãžã«ç§»åããAPI ããŒãäœæããŠååŸããŸãããã®ããŒã䜿çšããŠãW&B ã§ã客æ§ã®ç°å¢ãèªèšŒããŸãã
䜿ãæ¹ãã¬ãŒãã³ã°YOLOv8 Weights & Biases
Weights & Biases ã䜿ã£ãYOLOv8 ã¢ãã«ã»ãã¬ãŒãã³ã°ã®äœ¿ãæ¹ã®èª¬æã«å ¥ãåã«ã Ultralytics ãæäŸããYOLOv8 ã¢ãã«ã®æ°ã ãå¿ ããã§ãã¯ããŠãã ãããããã¯ãããªãã®ãããžã§ã¯ãã®èŠä»¶ã«æãé©åãªã¢ãã«ãéžæããã®ã«åœ¹ç«ã¡ãŸãã
䜿ãæ¹ãã¬ãŒãã³ã°YOLOv8 Weights & Biases
import wandb
from wandb.integration.ultralytics import add_wandb_callback
from ultralytics import YOLO
# Initialize a Weights & Biases run
wandb.init(project="ultralytics", job_type="training")
# Load a YOLO model
model = YOLO("yolov8n.pt")
# Add W&B Callback for Ultralytics
add_wandb_callback(model, enable_model_checkpointing=True)
# Train and Fine-Tune the Model
model.train(project="ultralytics", data="coco8.yaml", epochs=5, imgsz=640)
# Validate the Model
model.val()
# Perform Inference and Log Results
model(["path/to/image1", "path/to/image2"])
# Finalize the W&B Run
wandb.finish()
ã³ãŒããç解ãã
äžèšã®äœ¿çšã³ãŒãã¹ããããã§çŽ¹ä»ãããŠããæé ãç解ããŸãããã
-
ã¹ããã 1ïŒWeights & Biases ã©ã³ã®åæåïŒãããžã§ã¯ãåãšãžã§ãã¿ã€ããæå®ããWeights & Biases å®è¡ãåæåããããšããå§ããããã®ã©ã³ã¯ãã¢ãã«ã®ãã¬ãŒãã³ã°ããã³æ€èšŒããã»ã¹ã远跡ããã³ç®¡çããŸãã
-
ã¹ããã 2:YOLOv8 ã¢ãã«ãšããŒã¿ã»ãããå®çŸ©ããïŒäœ¿çšãããã¢ãã«ã»ããªã¢ã³ããšããŒã¿ã»ãããæå®ãããYOLO ã¢ãã«ããæå®ãããã¢ãã«ã»ãã¡ã€ã«ã§åæåãããŸãã
-
ã¹ããã 3ïŒWeights & Biases Ultralytics ã®ã³ãŒã«ããã¯ãè¿œå ããïŒãã®ã¹ãããã¯ããã¬ãŒãã³ã°ã»ã¡ããªã¯ã¹ãšæ€èšŒçµæã®èªåãã®ã³ã°ãWeights & Biases ãã¢ãã«ã®ããã©ãŒãã³ã¹ã®è©³çŽ°ãªãã¥ãŒãæäŸãããããéåžžã«éèŠã§ãã
-
ã¹ããã4ïŒã¢ãã«ã®èšç·ŽãšåŸ®èª¿æŽïŒæå®ãããããŒã¿ã»ããããšããã¯æ°ãç»åãµã€ãºã§ã¢ãã«ã®ãã¬ãŒãã³ã°ãéå§ããŸãããã¬ãŒãã³ã°ã»ããã»ã¹ã«ã¯ãåãšããã¯ã®çµäºæã«ã¡ããªã¯ã¹ãšäºæž¬å€ã®ãã®ã³ã°ãå«ãŸããã¢ãã«ã®åŠç¿é²æã®å æ¬çãªãã¥ãŒãæäŸããŸãã
-
ã¹ããã5ïŒã¢ãã«ã®æ€èšŒïŒãã¬ãŒãã³ã°ã®åŸãã¢ãã«ãæ€èšŒããããã®ã¹ãããã¯ãæªç¥ã®ããŒã¿ã«å¯Ÿããã¢ãã«ã®ããã©ãŒãã³ã¹ãè©äŸ¡ãããã®æ±åå¯èœæ§ã確ä¿ããããã«æ¥µããŠéèŠã§ããã
-
ã¹ããã6ïŒæšè«ã®å®è¡ãšçµæã®ãã°ïŒã¢ãã«ã¯æå®ãããç»åã«å¯ŸããŠäºæž¬ãå®è¡ããŸãããããã®äºæž¬ã¯ãèŠèŠçãªãªãŒããŒã¬ã€ãšæŽå¯ãšãšãã«ãã€ã³ã¿ã©ã¯ãã£ããªæ¢çŽ¢ã®ããã«W&BããŒãã«ã«èªåçã«èšé²ãããŸãã
-
ã¹ããã 7: W&B ã®å®è¡ã確å®ããŸãïŒãã®ã¹ãããã§ããŒã¿ãã®ã³ã°ãçµäºããã¢ãã«ã®ãã¬ãŒãã³ã°ãšæ€èšŒããã»ã¹ã®æçµç¶æ ãW&Bããã·ã¥ããŒãã«ä¿åããŸãã
ã¢ãŠãããããç解ãã
äžèšã®ã³ãŒãã»ã¹ãããããå®è¡ãããšã次ã®ãããªäž»ãªåºåãæåŸ ã§ããïŒ
- ãã¬ãŒãã³ã°ããã»ã¹ã®éå§ã瀺ãäžæã®IDãæã€æ°ããã©ã³ã®ã»ããã¢ããã
- ã¬ã€ã€ãŒããã©ã¡ãŒã¿ã®æ°ãªã©ãã¢ãã«ã®æ§é ã®ç°¡æœãªæŠèŠã
- åãã¬ãŒãã³ã°ãšããã¯ã«ãããŠãbox lossãcls lossãdfl lossãprecisionãrecallãmAPã¹ã³ã¢ãªã©ã®éèŠãªã¡ããªã¯ã¹ãå®æçã«æŽæ°ãããã
- ãã¬ãŒãã³ã°ã®æåŸã«ã¯ãã¢ãã«ã®æšè«é床ãå šäœçãªç²ŸåºŠã®ã¡ããªã¯ã¹ãå«ã詳现ãªã¡ããªã¯ã¹ã衚瀺ãããŸãã
- ãã¬ãŒãã³ã°ããã»ã¹ã®è©³çŽ°ãªåæãšèŠèŠåã®ããã®Weights & Biases ããã·ã¥ããŒããžã®ãªã³ã¯ãããã³ããŒã«ã«ã®ãã°ãã¡ã€ã«ã®å Žæã«é¢ããæ å ±ã
Weights & Biases ããã·ã¥ããŒãã®è¡šç€º
䜿çšæ³ã®ã³ãŒãã»ã¹ãããããå®è¡ããåŸãåºåã«ããæäŸããããªã³ã¯ããWeights & Biases (W&B) ããã·ã¥ããŒãã«ã¢ã¯ã»ã¹ããããšãã§ããŸãããã®ããã·ã¥ããŒãã§ã¯ãYOLOv8 ã䜿ã£ãã¢ãã«ã®ãã¬ãŒãã³ã°ããã»ã¹ãå æ¬çã«èŠãããšãã§ããŸãã
Weights & Biases ããã·ã¥ããŒãã®äž»ãªæ©èœ
-
ãªã¢ã«ã¿ã€ã ã®ã¡ããªã¯ã¹è¿œè·¡ïŒæ倱ã粟床ãæ€èšŒã¹ã³ã¢ãªã©ã®ã¡ããªã¯ã¹ããã¬ãŒãã³ã°äžã«ã©ã®ããã«å€åãããã芳å¯ããã¢ãã«ãã¥ãŒãã³ã°ã®ããã®æŽå¯ãå³åº§ã«æäŸããŸãã Weights & Biases ã 䜿çšããå®éšã®è¿œè·¡æ¹æ³ãã芧ãã ããã
-
ãã€ããŒãã©ã¡ãŒã¿ã®æé©å:Weights & Biases ã¯ãåŠç¿çãããããµã€ãºãªã©ã®éèŠãªãã©ã¡ãŒã¿ã埮調æŽããYOLOv8 ã®ããã©ãŒãã³ã¹ãåäžãããã®ã«åœ¹ç«ã¡ãŸãã
-
æ¯èŒåæïŒãã®ãã©ãããã©ãŒã ã§ã¯ãããŸããŸãªã¢ãã«æ§æã®åœ±é¿ãè©äŸ¡ããããã«äžå¯æ¬ ãªãç°ãªããã¬ãŒãã³ã°å®è¡ã®æšªäžŠã³æ¯èŒãå¯èœã§ãã
-
ãã¬ãŒãã³ã°é²æã®èŠèŠåïŒäž»èŠãªã¡ããªã¯ã¹ãã°ã©ãã£ã«ã«ã«è¡šç€ºããããšã§ããšããã¯ã«ãããã¢ãã«ã®ããã©ãŒãã³ã¹ãçŽæçã«ç解ããããšãã§ããŸãã Weights & Biases ãæ€èšŒçµæã®èŠèŠåã«ã©ã®ããã«åœ¹ç«ã€ããã芧ãã ããã
-
ãªãœãŒã¹ã®ã¢ãã¿ãªã³ã°ïŒãã¬ãŒãã³ã°ããã»ã¹ã®å¹çãæé©åããããã«ãCPU ãGPU ãã¡ã¢ãªäœ¿çšéã远跡ããŸãã
-
ã¢ãã«ææç©ã®ç®¡çïŒã¢ãã«ã®ãã§ãã¯ãã€ã³ãã«ã¢ã¯ã»ã¹ããŠå ±æããå±éãã³ã©ãã¬ãŒã·ã§ã³ã容æã«ããŸãã
-
ç»åãªãŒããŒã¬ã€ã«ããæšè«çµæã®è¡šç€ºïŒWeights & Biases ã®ã€ã³ã¿ã©ã¯ãã£ããªãªãŒããŒã¬ã€ã䜿çšããŠãç»åäžã§äºæž¬çµæãèŠèŠåãWeights & Biases' ç»åãªãŒããŒã¬ã€æ©èœã®è©³çŽ°ã«ã€ããŠã¯ããã¡ãã®ãªã³ã¯ãã芧ãã ããã Weights & Biases' ç»åãªãŒããŒã¬ã€ãã¢ãã«ã®æšè«ãã©ã®ããã«èŠèŠåããããã芧ãã ããã
ãããã®æ©èœã䜿çšããããšã§ãYOLOv8 ã¢ãã«ã®ãã¬ãŒãã³ã°ãå¹æçã«è¿œè·¡ãåæãæé©åããæé«ã®ããã©ãŒãã³ã¹ãšå¹çãå®çŸããããšãã§ããŸãã
æŠèŠ
ãã®ã¬ã€ãã¯ãæ¢çŽ¢ã«åœ¹ç«ã¡ãŸãã Ultralytics' YOLOv8 ãšã®çµ±å Weights & Biases.ããã¯ãã¢ãã«ã®ãã¬ãŒãã³ã°ãšäºæž¬ã®çµæãå¹ççã«è¿œè·¡ããã³èŠèŠåãããã®çµ±åã®æ©èœã瀺ããŠããŸãã
䜿ãæ¹ã®è©³çŽ°ã«ã€ããŠã¯ãWeights & Biases'å ¬åŒããã¥ã¡ã³ããã芧ãã ããã
ãŸããUltralytics ã®çµ±åã¬ã€ãããŒãžã§ãããŸããŸãªãšããµã€ãã£ã³ã°ãªçµ±åã«ã€ããŠè©³ããã芧ãã ããã
ããããã質å
YOLOv8 ãšWeights & Biases ã«å¿ èŠãªããã±ãŒãžã®ã€ã³ã¹ããŒã«æ¹æ³ã¯ïŒ
YOLOv8 ãšWeights & Biases ã«å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ããã«ã¯ãã³ãã³ãã©ã€ã³ã€ã³ã¿ãŒãã§ã€ã¹ãéããŠå®è¡ããïŒ
ã€ã³ã¹ããŒã«æé ã®è©³çŽ°ã«ã€ããŠã¯ãYOLOv8 ã€ã³ã¹ããŒã«ã¬ã€ããåç §ããŠãã ãããåé¡ãçºçããå Žåããã©ãã«ã·ã¥ãŒãã£ã³ã°ã®ãã³ãã«ã€ããŠã¯ããããããåé¡ãã¬ã€ããåç §ããŠãã ããã
Ultralytics YOLOv8 ãWeights & Biases ãšçµ±åããå©ç¹ã¯ïŒ
Ultralytics YOLOv8 ãWeights & Biases ãšçµ±åãããšã以äžã®ãããªå©ç¹ãããïŒ
- ãªã¢ã«ã¿ã€ã ã®ã¡ããªã¯ã¹è¿œè·¡ïŒãã¬ãŒãã³ã°äžã®ææšã®å€åã芳å¯ããå³åº§ã«æŽå¯ãåŸãããšãã§ããŸãã
- ãã€ããŒãã©ã¡ãŒã¿ã®æé©åïŒåŠç¿çãããããµã€ãºãªã©ã埮調æŽããããšã§ãã¢ãã«ã®ããã©ãŒãã³ã¹ãåäžãããŸãã
- æ¯èŒåæïŒç°ãªããã¬ãŒãã³ã°ã®å®è¡ã䞊ã¹ãŠæ¯èŒã
- ãªãœãŒã¹ç£èŠïŒ CPU,GPU, ã¡ã¢ãªäœ¿çšéã远跡ã
- ã¢ãã«ææç©ã®ç®¡çïŒã¢ãã«ã®ãã§ãã¯ãã€ã³ãã«ç°¡åã«ã¢ã¯ã»ã¹ããå ±æããããšãã§ããŸãã
ãããã®æ©èœã®è©³çŽ°ã«ã€ããŠã¯ãäžèšã®Weights & Biases ããã·ã¥ããŒãã®ã»ã¯ã·ã§ã³ãåç §ããŠãã ããã
YOLOv8 ãã¬ãŒãã³ã°çšã«Weights & Biases ãèšå®ããã«ã¯ã©ãããã°ããã§ããïŒ
YOLOv8 ãã¬ãŒãã³ã°çšã«Weights & Biases ãèšå®ããã«ã¯ã以äžã®æé ã«åŸãïŒ
- Weights & Biases ãåæåããã³ãã³ããå®è¡ããïŒ
- Weights & Biases ãŠã§ããµã€ãããAPIããŒãååŸããŸãã
- APIããŒã䜿çšããŠéçºç°å¢ãèªèšŒããŸãã
詳现ãªèšå®æ¹æ³ã¯ãäžèšã®ãWeights & Biases ã®èšå®ãã»ã¯ã·ã§ã³ã«èšèŒãããŠããŸãã
Weights & Biases ã䜿ã£ãŠYOLOv8 ã¢ãã«ããã¬ãŒãã³ã°ããã«ã¯ïŒ
Weights & Biases ã䜿çšããŠYOLOv8 ã¢ãã«ããã¬ãŒãã³ã°ããã«ã¯ãPython ã¹ã¯ãªããã§ä»¥äžã®æé ã䜿çšããïŒ
import wandb
from wandb.integration.ultralytics import add_wandb_callback
from ultralytics import YOLO
# Initialize a Weights & Biases run
wandb.init(project="ultralytics", job_type="training")
# Load a YOLO model
model = YOLO("yolov8n.pt")
# Add W&B Callback for Ultralytics
add_wandb_callback(model, enable_model_checkpointing=True)
# Train and Fine-Tune the Model
model.train(project="ultralytics", data="coco8.yaml", epochs=5, imgsz=640)
# Validate the Model
model.val()
# Perform Inference and Log Results
model(["path/to/image1", "path/to/image2"])
# Finalize the W&B Run
wandb.finish()
ãã®ã¹ã¯ãªããã¯ãWeights & Biases ãåæåããã¢ãã«ãã»ããã¢ãããããã¬ãŒãã³ã°ããçµæããã°ã«èšé²ããŸãã詳现ã«ã€ããŠã¯ãäžèšã®äœ¿çšæ³ã®ã»ã¯ã·ã§ã³ãã芧ãã ããã
ãªãä»ã®ãã©ãããã©ãŒã ã§ã¯ãªããWeights & Biases ã§Ultralytics YOLOv8 ã䜿ãã¹ããªã®ã§ããïŒ
Ultralytics YOLOv8 Weights & Biases ïŒ
- é«å¹çïŒãã¬ãŒãã³ã°ææšããªã¢ã«ã¿ã€ã ã§è¿œè·¡ããããã©ãŒãã³ã¹ãæé©åã
- æ¡åŒµæ§ïŒå ç¢ãªãªãœãŒã¹ç£èŠããã³å©çšããŒã«ã«ããã倧èŠæš¡ãªãã¬ãŒãã³ã°ãžã§ãã容æã«ç®¡çã§ããŸãã
- ã€ã³ã¿ã©ã¯ãã£ãæ§ïŒããŒã¿ã®å¯èŠåãšã¢ãã«ç®¡çã®ããã®ãŠãŒã¶ãŒãã¬ã³ããªãŒãªã€ã³ã¿ã©ã¯ãã£ãUIã
- ã³ãã¥ããã£ãšãµããŒãïŒåŒ·åãªçµ±åããã¥ã¡ã³ããšã³ãã¥ããã£ãµããŒããæè»ãªã«ã¹ã¿ãã€ãºãšæ¡åŒµãªãã·ã§ã³ã
Comet ãClearML ã®ãããªä»ã®ãã©ãããã©ãŒã ãšã®æ¯èŒã«ã€ããŠã¯ãUltralytics çµ±å ãåç §ã