ã¢ãã«ã»ãã¬ãŒãã³ã°Ultralytics YOLO
ã¯ããã«
Training a deep learning model involves feeding it data and adjusting its parameters so that it can make accurate predictions. Train mode in Ultralytics YOLO11 is engineered for effective and efficient training of object detection models, fully utilizing modern hardware capabilities. This guide aims to cover all the details you need to get started with training your own models using YOLO11's robust set of features.
èŠããã ïŒ How to Train a YOLO model on Your Custom Dataset in Google Colab.
ãã¬ãŒãã³ã°ã«Ultralytics YOLO ãéžã¶çç±
Here are some compelling reasons to opt for YOLO11's Train mode:
- å¹çïŒã·ã³ã°ã«GPU ã®ã»ããã¢ããã§ããè€æ°ã®GPUã«ãŸãããã¹ã±ãŒãªã³ã°ã§ããããŒããŠã§ã¢ãæ倧éã«æŽ»çšã§ããŸãã
- æ±çšæ§ïŒCOCOãVOCãImageNetã®ãããªå ¥æããããããŒã¿ã»ããã ãã§ãªããã«ã¹ã¿ã ããŒã¿ã»ããã§ãåŠç¿ã§ããŸãã
- ãŠãŒã¶ãŒãã¬ã³ããªãŒïŒã·ã³ãã«ãã€ãã¯ãã«ãªCLI ããã³Python ã€ã³ã¿ãŒãã§ãŒã¹ã«ããããããããããã¬ãŒãã³ã°äœéšãæäŸããŸãã
- ãã€ããŒãã©ã¡ãŒã¿ã®æè»æ§ïŒã¢ãã«ã®æ§èœã埮調æŽããããã®ã«ã¹ã¿ãã€ãºå¯èœãªå¹ åºããã€ããŒãã©ã¡ãŒã¿ã
ãã¬ã€ã³ã»ã¢ãŒãã®äž»ãªç¹åŸŽ
The following are some notable features of YOLO11's Train mode:
- ããŒã¿ã»ããã®èªåããŠã³ããŒãïŒCOCOãVOCãImageNetãªã©ã®æšæºããŒã¿ã»ããã¯ãåå䜿çšæã«èªåçã«ããŠã³ããŒããããŸãã
- ãã«ãGPU ãµããŒãïŒè€æ°ã®GPUã§ã·ãŒã ã¬ã¹ã«ãã¬ãŒãã³ã°ã®èŠæš¡ãæ¡å€§ããããã»ã¹ãè¿ éåããŸãã
- ãã€ããŒãã©ã¡ãŒã¿ã®èšå®ïŒYAML èšå®ãã¡ã€ã«ãŸãã¯CLI åŒæ°ãéããŠãã€ããŒãã©ã¡ãŒã¿ãå€æŽãããªãã·ã§ã³ã
- å¯èŠåãšã¢ãã¿ãªã³ã°ïŒãã¬ãŒãã³ã°ã¡ããªã¯ã¹ããªã¢ã«ã¿ã€ã ã§è¿œè·¡ããåŠç¿ããã»ã¹ãå¯èŠåããããšã§ãããè¯ãæŽå¯ãåŸãããšãã§ããŸãã
ããã
- YOLO11 datasets like COCO, VOC, ImageNet and many others automatically download on first use, i.e.
yolo train data=coco.yaml
䜿çšäŸ
Train YOLO11n on the COCO8 dataset for 100 epochs at image size 640. The training device can be specified using the device
åŒæ°ãæž¡ããåŒæ°ãæž¡ãããªãå ŽåGPU device=0
ã䜿çšãããŸãã device='cpu'
ã䜿çšãããããã¬ãŒãã³ã°åŒæ°ã®å
šãªã¹ãã¯äžèšã®ãåŒæ°ãã»ã¯ã·ã§ã³ãåç
§ã
ã·ã³ã°ã«GPU ãCPU ãã¬ãŒãã³ã°äŸ
ããã€ã¹ã¯èªåçã«æ±ºå®ããããGPU ãå©çšå¯èœã§ããã°ããã䜿çšãããããã§ãªããã°CPU ãããã¬ãŒãã³ã°ãéå§ãããã
from ultralytics import YOLO
# Load a model
model = YOLO("yolo11n.yaml") # build a new model from YAML
model = YOLO("yolo11n.pt") # load a pretrained model (recommended for training)
model = YOLO("yolo11n.yaml").load("yolo11n.pt") # build from YAML and transfer weights
# Train the model
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)
# Build a new model from YAML and start training from scratch
yolo detect train data=coco8.yaml model=yolo11n.yaml epochs=100 imgsz=640
# Start training from a pretrained *.pt model
yolo detect train data=coco8.yaml model=yolo11n.pt epochs=100 imgsz=640
# Build a new model from YAML, transfer pretrained weights to it and start training
yolo detect train data=coco8.yaml model=yolo11n.yaml pretrained=yolo11n.pt epochs=100 imgsz=640
ãã«ãGPU ãã¬ãŒãã³ã°
ãã«ãGPU ãã¬ãŒãã³ã°ã¯ããã¬ãŒãã³ã°è² è·ãè€æ°ã®GPUã«åæ£ããããšã§ãå©çšå¯èœãªããŒããŠã§ã¢ãªãœãŒã¹ãããå¹ççã«å©çšããããšãã§ããŸãããã®æ©èœã¯Python API ãšã³ãã³ãã©ã€ã³ã»ã€ã³ã¿ãŒãã§ãŒã¹ã®äž¡æ¹ããå©çšå¯èœã§ãããã«ãGPU ãã¬ãŒãã³ã°ãæå¹ã«ããã«ã¯ã䜿çšãããGPU ããã€ã¹ ID ãæå®ããŸãã
ãã«ãGPU ãã¬ãŒãã³ã°äŸ
2ã€ã®GPUãCUDA ããã€ã¹0ãš1ã§ãã¬ãŒãã³ã°ããã«ã¯ã以äžã®ã³ãã³ãã䜿çšããŸããå¿ èŠã«å¿ããŠGPUãè¿œå ããŠãã ããã
Apple M1 and M2MPS ãã¬ãŒãã³ã°
Ultralytics YOLO ã¢ãã«ã«çµ±åãããApple M1ããã³M2ãããã®ãµããŒãã«ããã匷åãªMetal Performance Shaders (MPS) ãã¬ãŒã ã¯ãŒã¯ãå©çšããããã€ã¹äžã§ã¢ãã«ããã¬ãŒãã³ã°ããããšãå¯èœã«ãªããŸãããMPS ã¯ãã¢ããã«ã®ã«ã¹ã¿ã ã·ãªã³ã³äžã§èšç®ãšç»ååŠçã¿ã¹ã¯ãå®è¡ããé«æ§èœãªæ¹æ³ãæäŸããŸãã
Apple M1 ããã³ M2 ãããã®ãã¬ãŒãã³ã°ãæå¹ã«ããã«ã¯ããã¬ãŒãã³ã°ããã»ã¹ãéå§ããéã«ãããã€ã¹ãšã㊠'mps' ãæå®ããå¿ èŠããããŸãã以äžã¯ãPython ãã³ãã³ãã©ã€ã³ããè¡ãæ¹æ³ã®äŸã§ãïŒ
MPS ãã¬ãŒãã³ã°äŸ
M1/M2ãããã®èšç®èœåã掻çšããªããããã¬ãŒãã³ã°ã¿ã¹ã¯ãããå¹ççã«åŠçããããšãã§ããŸãããã詳现ãªã¬ã€ãã³ã¹ãšé«åºŠãªèšå®ãªãã·ã§ã³ã«ã€ããŠã¯ãPyTorch MPS ããã¥ã¡ã³ããåç §ããŠãã ããã
äžæããããã¬ãŒãã³ã°ã®åé
以åã«ä¿åããç¶æ ããåŠç¿ãåéããããšã¯ããã£ãŒãã©ãŒãã³ã°ã»ã¢ãã«ãæ±ãäžã§éåžžã«éèŠãªæ©èœã§ããããã¯ãåŠç¿ããã»ã¹ãäºæããäžæãããå Žåããæ°ããããŒã¿ãŸãã¯ããå€ãã®ãšããã¯ã§ã¢ãã«ã®åŠç¿ãç¶è¡ãããå Žåãªã©ãããŸããŸãªã·ããªãªã§äŸ¿å©ã§ãã
When training is resumed, Ultralytics YOLO loads the weights from the last saved model and also restores the optimizer state, learning rate scheduler, and the epoch number. This allows you to continue the training process seamlessly from where it was left off.
ãèšå®ããããšã§ãç°¡åã«Ultralytics YOLO ã§ãã¬ãŒãã³ã°ãåéããããšãã§ããŸãã resume
åŒæ° True
ãåŒã³åºããšãã« train
ã¡ãœãããžã®ãã¹ãæå®ããã .pt
ãã¡ã€ã«ã«ã¯ãéšåçã«åŠç¿ãããã¢ãã«ã®éã¿ãå«ãŸããŠããã
以äžã¯ãPython ãã³ãã³ãã©ã€ã³ã䜿ã£ãŠäžæãããã¬ãŒãã³ã°ãåéããæ¹æ³ã®äŸã§ãïŒ
å±¥æŽæžãã¬ãŒãã³ã°ã®äŸ
ã»ããã£ã³ã° resume=True
ãã® train
é¢æ°ã¯ã'path/to/last.pt'ãã¡ã€ã«ã«ä¿åãããŠããç¶æ
ã䜿çšããŠããã¬ãŒãã³ã°ãäžæãããšããããç¶ããŸãããã resume
åŒæ°ãçç¥ããããããŸã㯠False
ãã® train
é¢æ°ã¯æ°ãããã¬ãŒãã³ã°ã»ãã·ã§ã³ãéå§ããã
Remember that checkpoints are saved at the end of every epoch by default, or at fixed intervals using the save_period
ãã®ããããã¬ãŒãã³ã°èµ°è¡ãåéããã«ã¯ãå°ãªããšã1ãšããã¯ãå®äºããå¿
èŠãããã
åè»èšå®
The training settings for YOLO models encompass various hyperparameters and configurations used during the training process. These settings influence the model's performance, speed, and accuracy. Key training settings include batch size, learning rate, momentum, and weight decay. Additionally, the choice of optimizer, loss function, and training dataset composition can impact the training process. Careful tuning and experimentation with these settings are crucial for optimizing performance.
è°è« | ããã©ã«ã | 説æ |
---|---|---|
model |
None |
ãã¬ãŒãã³ã°çšã®ã¢ãã«ãã¡ã€ã«ãæå®ããŸãããã¡ã€ã«ãžã®ãã¹ãæå®ããŸãã .pt èšç·Žæžã¿ã¢ãã«ãŸã㯠.yaml èšå®ãã¡ã€ã«ãã¢ãã«æ§é ã®å®çŸ©ãéã¿ã®åæåã«äžå¯æ¬ ã |
data |
None |
ããŒã¿ã»ããèšå®ãã¡ã€ã«ãžã®ãã¹ïŒäŸïŒ coco8.yaml ). This file contains dataset-specific parameters, including paths to training and validation data, class names, and number of classes. |
epochs |
100 |
Total number of training epochs. Each epoch represents a full pass over the entire dataset. Adjusting this value can affect training duration and model performance. |
time |
None |
æ倧ãã¬ãŒãã³ã°æéïŒæéåäœïŒãèšå®ãããš epochs åŒæ°ãæå®ããããšã§ãæå®ããæéåŸã«ãã¬ãŒãã³ã°ãèªåçã«åæ¢ããããšãã§ããŸããæéã«å¶çŽã®ãããã¬ãŒãã³ã°ã·ããªãªã«äŸ¿å©ã§ãã |
patience |
100 |
Number of epochs to wait without improvement in validation metrics before early stopping the training. Helps prevent overfitting by stopping training when performance plateaus. |
batch |
16 |
Batch size, with three modes: set as an integer (e.g., batch=16 )ãGPU ã¡ã¢ãªäœ¿çšç60%ã®èªåã¢ãŒã(batch=-1 )ããŸãã¯æå®ããã䜿çšçã®å²åãæã€èªåã¢ãŒã(batch=0.70 ). |
imgsz |
640 |
Target image size for training. All images are resized to this dimension before being fed into the model. Affects model accuracy and computational complexity. |
save |
True |
Enables saving of training checkpoints and final model weights. Useful for resuming training or model deployment. |
save_period |
-1 |
ã¢ãã«ã®ãã§ãã¯ãã€ã³ããä¿åããé »åºŠããšããã¯ã§æå®ããŸããå€ã-1ã«ãããšããã®æ©èœã¯ç¡å¹ã«ãªããŸããé·ããã¬ãŒãã³ã°ã»ãã·ã§ã³äžã«äžéã¢ãã«ãä¿åããã®ã«äŸ¿å©ã§ãã |
cache |
False |
ããŒã¿ã»ããç»åãã¡ã¢ãªäžã«ãã£ãã·ã¥ã§ããããã«ãã (True /ram )ããã£ã¹ã¯äž(disk )ããŸãã¯ç¡å¹ã«ãã(False ).ã¡ã¢ãªäœ¿çšéã®å¢å ãšåŒãæãã«ããã£ã¹ã¯I/Oãåæžããããšã§ãã¬ãŒãã³ã°é床ãåäžãããã |
device |
None |
ãã¬ãŒãã³ã°ã®ããã®èšç®è£
眮ãæå®ããïŒã·ã³ã°ã«GPU (device=0 )ããã«ãGPU(device=0,1 )ãCPU (device=cpu )ããŸãã¯ã¢ããã«ã»ã·ãªã³ã³çšã®MPS (device=mps ). |
workers |
8 |
ããŒã¿ããŒãã®ããã®ã¯ãŒã«ãŒã¹ã¬ããæ°ïŒ1ã¹ã¬ããããã RANK ãã«ãGPU ãã¬ãŒãã³ã°ã®å ŽåïŒãããŒã¿ã®ååŠçãšã¢ãã«ãžã®æå
¥é床ã«åœ±é¿ããç¹ã«ãã«ãGPU ã»ããã¢ããã§æçšã |
project |
None |
ãã¬ãŒãã³ã°åºåãä¿åããããããžã§ã¯ããã£ã¬ã¯ããªã®ååãç°ãªãå®éšãæŽçããŠä¿åã§ããããã«ããã |
name |
None |
ãã¬ãŒãã³ã°å®è¡ã®ååããããžã§ã¯ããã©ã«ãå ã«ãµããã£ã¬ã¯ããªãäœæããããã«ãã¬ãŒãã³ã°ãã°ãšåºåãä¿åããŸãã |
exist_ok |
False |
Trueã®å Žåãæ¢åã®project/nameãã£ã¬ã¯ããªãäžæžãã§ããã以åã®åºåãæåã§æ¶å»ããå¿ èŠããªããç¹°ãè¿ãå®éšããã®ã«äŸ¿å©ã§ãã |
pretrained |
True |
äºåã«èšç·Žãããã¢ãã«ããåŠç¿ãéå§ãããã©ããã決å®ããŸããããŒã«å€ãŸãã¯ç¹å®ã®ã¢ãã«ãžã®æååãã¹ãæå®ããããããéã¿ãèªã¿èŸŒã¿ãŸãããã¬ãŒãã³ã°ã®å¹çãšã¢ãã«ã®ããã©ãŒãã³ã¹ãåäžãããŸãã |
optimizer |
'auto' |
ãã¬ãŒãã³ã°çšãªããã£ãã€ã¶ãŒã®éžæããªãã·ã§ã³ SGD , Adam , AdamW , NAdam , RAdam , RMSProp ãªã©ãããã㯠auto ã¢ãã«æ§æã«åºã¥ãèªåéžæãåæé床ãšå®å®æ§ã«åœ±é¿ã |
verbose |
False |
ãã¬ãŒãã³ã°äžã®åé·åºåãæå¹ã«ãã詳现ãªãã°ãšé²æç¶æ³ãæäŸããŸãããããã°ããã¬ãŒãã³ã°ããã»ã¹ã®ç£èŠã«äŸ¿å©ã§ãã |
seed |
0 |
ãã¬ãŒãã³ã°çšã®ã©ã³ãã ã·ãŒããèšå®ããåãã³ã³ãã£ã®ã¥ã¬ãŒã·ã§ã³ã§å®è¡ããå Žåã®çµæã®åçŸæ§ã確ä¿ããŸãã |
deterministic |
True |
決å®è«çã¢ã«ãŽãªãºã ã®äœ¿çšã匷å¶ããåçŸæ§ã確ä¿ããããé決å®è«çã¢ã«ãŽãªãºã ã®å¶éã«ãããããã©ãŒãã³ã¹ãšã¹ããŒãã«åœ±é¿ãäžããå¯èœæ§ãããã |
single_cls |
False |
ãã«ãã¯ã©ã¹ããŒã¿ã»ããã®ãã¹ãŠã®ã¯ã©ã¹ã1ã€ã®ã¯ã©ã¹ãšããŠæ±ãããã€ããªåé¡ã¿ã¹ã¯ããåé¡ããããªããžã§ã¯ãã®ååšã«æ³šç®ããå Žåã«äŸ¿å©ã |
rect |
False |
æå°éã®ããã£ã³ã°ã®ããã«ãããæ§æãæé©åããç©åœ¢åŠç¿ãå¯èœã«ãããå¹çãšã¹ããŒããåäžããŸãããã¢ãã«ã®ç²ŸåºŠã«åœ±é¿ãäžããå¯èœæ§ããããŸãã |
cos_lr |
False |
Utilizes a cosine learning rate scheduler, adjusting the learning rate following a cosine curve over epochs. Helps in managing learning rate for better convergence. |
close_mosaic |
10 |
Disables mosaic data augmentation in the last N epochs to stabilize training before completion. Setting to 0 disables this feature. |
resume |
False |
æåŸã«ä¿åãããã§ãã¯ãã€ã³ããããã¬ãŒãã³ã°ãåéãã¢ãã«ã®éã¿ããªããã£ãã€ã¶ã®ç¶æ ããšããã¯ã«ãŠã³ããèªåçã«ããŒãããã·ãŒã ã¬ã¹ã«ãã¬ãŒãã³ã°ãç¶ç¶ã |
amp |
True |
Enables Automatic Mixed Precision (AMP) training, reducing memory usage and possibly speeding up training with minimal impact on accuracy. |
fraction |
1.0 |
åŠç¿ã«äœ¿çšããããŒã¿ã»ããã®å²åãæå®ããŸããå®éšããªãœãŒã¹ãéãããŠããå Žåã«äŸ¿å©ã§ãã |
profile |
False |
ãã¬ãŒãã³ã°äžã®ONNX ãšTensorRT é床ã®ãããã¡ã€ãªã³ã°ãå¯èœã«ããã¢ãã«å±éã®æé©åã«åœ¹ç«ã€ã |
freeze |
None |
Freezes the first N layers of the model or specified layers by index, reducing the number of trainable parameters. Useful for fine-tuning or transfer learning. |
lr0 |
0.01 |
åæåŠç¿ç SGD=1E-2 , Adam=1E-3 ) .ãã®å€ã調æŽããããšã¯ãæé©åããã»ã¹ã«ãšã£ãŠéåžžã«éèŠã§ãããã¢ãã«ã®éã¿ã®æŽæ°é床ã«åœ±é¿ããã |
lrf |
0.01 |
åæåŠç¿çã«å¯ŸããæçµåŠç¿çã®å²å = (lr0 * lrf )ãã¹ã±ãžã¥ãŒã©ãšçµã¿åãããŠäœ¿çšããæéçµéãšãšãã«åŠç¿çã調æŽããã |
momentum |
0.937 |
Momentum factor for SGD or beta1 for Adam optimizers, influencing the incorporation of past gradients in the current update. |
weight_decay |
0.0005 |
L2 regularization term, penalizing large weights to prevent overfitting. |
warmup_epochs |
3.0 |
åŠç¿çã®ãŠã©ãŒã ã¢ããã®ããã®ãšããã¯æ°ãäœãå€ããåæåŠç¿çãŸã§åŸã ã«åŠç¿çãäžããŠãããæ©ã段éã§åŠç¿ãå®å®ãããã |
warmup_momentum |
0.8 |
ãŠã©ãŒã ã¢ããæã®åæã¢ã¡ã³ã¿ã ã¯ããŠã©ãŒã ã¢ããæéäžã«èšå®ãããã¢ã¡ã³ã¿ã ã«åŸã ã«èª¿æŽãããã |
warmup_bias_lr |
0.1 |
ãŠã©ãŒã ã¢ãããã§ãŒãºã«ããããã€ã¢ã¹ãã©ã¡ãŒã¿ã®åŠç¿çã¯ãåæãšããã¯ã«ãããã¢ãã«åŠç¿ãå®å®ãããã®ã«åœ¹ç«ã€ã |
box |
7.5 |
Weight of the box loss component in the loss function, influencing how much emphasis is placed on accurately predicting bounding box coordinates. |
cls |
0.5 |
å šæ倱é¢æ°ã«ãããåé¡æ倱ã®éã¿ã§ãä»ã®ã³ã³ããŒãã³ãã«å¯Ÿããæ£ããã¯ã©ã¹äºæž¬ã®éèŠæ§ã«åœ±é¿ããã |
dfl |
1.5 |
ååžãã©ãŒã«ã«ãã¹ã®éã¿ãYOLO ã®ç¹å®ã®ããŒãžã§ã³ã§ã现ããåé¡ã«äœ¿çšãããã |
pose |
12.0 |
ããŒãºæšå®çšã«åŠç¿ãããã¢ãã«ã«ãããããŒãºãã¹ã®éã¿ãããŒãºããŒãã€ã³ããæ£ç¢ºã«äºæž¬ããããšã«éç¹ã眮ãããŠããããšã圱é¿ããŠããã |
kobj |
2.0 |
ããŒãºæšå®ã¢ãã«ã«ãããããŒãã€ã³ãã®ãªããžã§ã¯ããã¹æ倱ã®éã¿ãæ€åºä¿¡é ŒåºŠãšããŒãºç²ŸåºŠã®ãã©ã³ã¹ã |
label_smoothing |
0.0 |
ã©ãã«ã¹ã ãŒãžã³ã°ãé©çšããããŒãã©ãã«ãã¿ãŒã²ããã©ãã«ãšã©ãã«äžã®äžæ§ååžã®æ··åã«æãããããããšã§ãæ±åãæ¹åããããšãã§ããã |
nbs |
64 |
ãã¹ãæ£èŠåããããã®å ¬ç§°ããããµã€ãºã |
overlap_mask |
True |
Determines whether segmentation masks should overlap during training, applicable in instance segmentation tasks. |
mask_ratio |
4 |
ã»ã°ã¡ã³ããŒã·ã§ã³ãã¹ã¯ã®ããŠã³ãµã³ãã«æ¯ããã¬ãŒãã³ã°æã«äœ¿çšãããã¹ã¯ã®è§£å床ã«åœ±é¿ããã |
dropout |
0.0 |
åé¡ã¿ã¹ã¯ã«ãããæ£ååã®ããã®ããããã¢ãŠãçããã¬ãŒãã³ã°äžã«ãŠããããã©ã³ãã ã«çç¥ããããšã§ãªãŒããŒãã£ããã£ã³ã°ãé²ãã |
val |
True |
ãã¬ãŒãã³ã°äžã«æ€èšŒãæå¹ã«ããå¥ã®ããŒã¿ã»ããã§ã¢ãã«ã®æ§èœãå®æçã«è©äŸ¡ã§ããããã«ããã |
plots |
False |
äºæž¬äŸã ãã§ãªããèšç·Žãšæ€èšŒã®ã¡ããªã¯ã¹ã®ãããããçæããŠä¿åããã¢ãã«ã®ããã©ãŒãã³ã¹ãšåŠç¿ã®é²è¡ã«é¢ããèŠèŠçãªæŽå¯ãæäŸããŸãã |
ããããµã€ãºèšå®ã«é¢ãã泚æ
ã«ã€ã㊠batch
åŒæ°ã¯ã次㮠3 ã€ã®æ¹æ³ã§æ§æã§ããŸãã
- Fixed Batch Size: æŽæ°å€ãèšå®ããŸã (äŸ:
batch=16
) ã§ã¯ãããããããã®ç»åæ°ãçŽæ¥æå®ããŸãã - ãªãŒãã¢ãŒã (60%GPU ã¡ã¢ãªãŒ)ïŒäœ¿ã
batch=-1
ã䜿çšããŠãCUDA ã¡ã¢ãªäœ¿çšçãçŽ 60% ã«ãªãããã«ããããµã€ãºãèªåçã«èª¿æŽããŸãã - 䜿çšççã«ããèªåã¢ãŒã:åæ°ã®å€ãèšå®ããŸã(äŸ:
batch=0.70
) ã䜿ã£ãŠãGPU ã¡ã¢ãªäœ¿çšéã®æå®ãããå²åã«åºã¥ããŠããããµã€ãºã調æŽããã
ãªãŒã°ã¡ã³ããŒã·ã§ã³ã®èšå®ãšãã€ããŒãã©ã¡ãŒã¿
Augmentation techniques are essential for improving the robustness and performance of YOLO models by introducing variability into the training data, helping the model generalize better to unseen data. The following table outlines the purpose and effect of each augmentation argument:
è°è« | ã¿ã€ã | ããã©ã«ã | ã¬ã³ãž | 説æ |
---|---|---|---|---|
hsv_h |
float |
0.015 |
0.0 - 1.0 |
ç»åã®è²çžãã«ã©ãŒãã€ãŒã«ã®æ°åã®äžã ã調æŽããè²ã®ã°ãã€ããå°å ¥ããŸããç°ãªãç §ææ¡ä»¶ã§ã®ã¢ãã«ã®äžè¬åãå©ããŸãã |
hsv_s |
float |
0.7 |
0.0 - 1.0 |
ç»åã®åœ©åºŠãã»ãã®å°ãå€åãããè²ã®æ¿ãã«åœ±é¿ãäžããŸããç°ãªãç°å¢æ¡ä»¶ãã·ãã¥ã¬ãŒãããã®ã«äŸ¿å©ã§ãã |
hsv_v |
float |
0.4 |
0.0 - 1.0 |
ç»åã®å€ïŒæããïŒãå°æ°ã§å€æŽããããŸããŸãªç §ææ¡ä»¶äžã§ã¢ãã«ãããŸãæ©èœããããã«ããŸãã |
degrees |
float |
0.0 |
-180 - +180 |
æå®ãã床æ°ã®ç¯å²å ã§ç»åãã©ã³ãã ã«å転ãããããŸããŸãªåãã®ãªããžã§ã¯ããèªèããã¢ãã«ã®èœåãåäžãããŸãã |
translate |
float |
0.1 |
0.0 - 1.0 |
ç»åãæ°Žå¹³æ¹åãšåçŽæ¹åã«ç»åãµã€ãºã®æ°åã®äžã ãå¹³è¡ç§»åãããéšåçã«èŠããç©äœãæ€åºããåŠç¿ã«åœ¹ç«ãŠãã |
scale |
float |
0.5 |
>=0.0 |
ã²ã€ã³ä¿æ°ã§ç»åãã¹ã±ãŒãªã³ã°ããã«ã¡ã©ããç°ãªãè·é¢ã«ããç©äœãã·ãã¥ã¬ãŒãããã |
shear |
float |
0.0 |
-180 - +180 |
ç»åãæå®ããè§åºŠã§åæããç©äœãç°ãªãè§åºŠããèŠããšãã®å¹æãæš¡å£ããã |
perspective |
float |
0.0 |
0.0 - 0.001 |
ç»åã«ã©ã³ãã ãªéèŠå€æãé©çšãã3D空éã®ãªããžã§ã¯ããç解ããã¢ãã«ã®èœåãé«ããã |
flipud |
float |
0.0 |
0.0 - 1.0 |
æå®ããã確çã§ç»åãäžäžå転ããããªããžã§ã¯ãã®ç¹æ§ã«åœ±é¿ãäžããããšãªãããŒã¿ã®ã°ãã€ãã倧ããããã |
fliplr |
float |
0.5 |
0.0 - 1.0 |
å·Šå³å¯Ÿç§°ã®ãªããžã§ã¯ããåŠç¿ããããããŒã¿ã»ããã®å€æ§æ§ãé«ãããããã®ã«åœ¹ç«ã€ã |
bgr |
float |
0.0 |
0.0 - 1.0 |
ç»åãã£ã³ãã«ããæå®ãã確çã§RGBããBGRã«å転ãããŸããããã¯ã誀ã£ããã£ã³ãã«é åºã«å¯Ÿããããã¹ãæ§ãé«ããã®ã«åœ¹ç«ã¡ãŸãã |
mosaic |
float |
1.0 |
0.0 - 1.0 |
4æã®ãã¬ãŒãã³ã°ç»åã1æã«åæããç°ãªãã·ãŒã³ã®æ§æããªããžã§ã¯ãã®çžäºäœçšãã·ãã¥ã¬ãŒããè€éãªã·ãŒã³ã®ç解ã«é«ãå¹æãçºæ®ã |
mixup |
float |
0.0 |
0.0 - 1.0 |
2ã€ã®ç»åãšãã®ã©ãã«ããã¬ã³ãããåæç»åãäœæããŸããã©ãã«ãã€ãºãèŠèŠçãªã°ãã€ããå°å ¥ããããšã§ãã¢ãã«ã®æ±åèœåãé«ããã |
copy_paste |
float |
0.0 |
0.0 - 1.0 |
ãªããžã§ã¯ãã®ã€ã³ã¹ã¿ã³ã¹ãå¢ããããããªããžã§ã¯ãã®ãªã¯ã«ãŒãžã§ã³ãåŠç¿ãããããã®ã«äŸ¿å©ã§ãã |
copy_paste_mode |
str |
flip |
- | Copy-Paste augmentation method selection among the options of ("flip" , "mixup" ). |
auto_augment |
str |
randaugment |
- | äºåã«å®çŸ©ãããè£åŒ·ããªã·ãŒ(randaugment , autoaugment , augmix )ãèŠèŠçç¹åŸŽãå€æ§åããããšã§åé¡ã¿ã¹ã¯ãæé©åããã |
erasing |
float |
0.4 |
0.0 - 0.9 |
åé¡ãã¬ãŒãã³ã°äžã«ç»åã®äžéšãã©ã³ãã ã«æ¶å»ããã¢ãã«ãèªèã®ããã«ããŸãç®ç«ããªãç¹åŸŽã«éäžããããä¿ãã |
crop_fraction |
float |
1.0 |
0.1 - 1.0 |
äžå¿ã®ç¹åŸŽã匷調ãããªããžã§ã¯ãã®ã¹ã±ãŒã«ã«é©å¿ããèæ¯ã®ä¹±ãã軜æžããããã«ãåé¡ç»åããã®ãµã€ãºã®ã»ãã®äžéšã«åãåããŸãã |
ãããã®èšå®ã¯ãããŒã¿ã»ãããšæå ã®ã¿ã¹ã¯ã®ç¹å®ã®èŠä»¶ãæºããããã«èª¿æŽããããšãã§ããŸããç°ãªãå€ã§å®éšããããšã§ãæè¯ã®ã¢ãã«æ§èœã«ã€ãªããæé©ãªãªãŒã°ã¡ã³ããŒã·ã§ã³æŠç¥ãèŠã€ããããšãã§ããŸãã
ã€ã³ãã©ã¡ãŒã·ã§ã³
ãã¬ãŒãã³ã°è£åŒ·äœæŠã®è©³çŽ°ã«ã€ããŠã¯ãåèã»ã¯ã·ã§ã³ãåç §ã®ããšã
ãã®ã³ã°
In training a YOLO11 model, you might find it valuable to keep track of the model's performance over time. This is where logging comes into play. Ultralytics' YOLO provides support for three types of loggers - Comet, ClearML, and TensorBoard.
ãã¬ãŒã䜿çšããã«ã¯ãäžã®ã³ãŒãã¹ããããã®ããããããŠã³ã¡ãã¥ãŒããéžæããå®è¡ããŸããéžæãããã¬ãŒãã€ã³ã¹ããŒã«ãããåæåãããŸãã
Comet
Cometã¯ãããŒã¿ãµã€ãšã³ãã£ã¹ããéçºè ãå®éšãã¢ãã«ã远跡ãæ¯èŒã説æãæé©åã§ãããã©ãããã©ãŒã ã§ãããªã¢ã«ã¿ã€ã ã®ã¡ããªã¯ã¹ãã³ãŒãã®å·®åããã€ããŒãã©ã¡ãŒã¿ã®ãã©ããã³ã°ãªã©ã®æ©èœãæäŸããŸãã
Comet ã䜿çšããïŒ
ãŠã§ããµã€ãããComet ã®ã¢ã«ãŠã³ãã«ãµã€ã³ã€ã³ããAPIããŒãååŸããããšãå¿ããã«ããããç°å¢å€æ°ãã¹ã¯ãªããã«è¿œå ããŠãå®éšã®ãã°ãåãå¿ èŠããããŸãã
ClearML
ClearMLã¯ãå®éšã®ãã©ããã³ã°ãèªååãããªãœãŒã¹ã®å¹ççãªå ±æãæ¯æŽãããªãŒãã³ãœãŒã¹ã®ãã©ãããã©ãŒã ã§ãããããŒã ãMLäœæ¥ãããå¹ççã«ç®¡çãå®è¡ãåçŸã§ããããã«èšèšãããŠããã
ClearML ã䜿çšããïŒ
ãã®ã¹ã¯ãªãããå®è¡ããåŸããã©ãŠã¶ã§ClearML ã¢ã«ãŠã³ãã«ãµã€ã³ã€ã³ããã»ãã·ã§ã³ãèªèšŒããå¿ èŠããããŸãã
ãã³ãœã«ããŒã
TensorBoard is a visualization toolkit for TensorFlow. It allows you to visualize your TensorFlow graph, plot quantitative metrics about the execution of your graph, and show additional data like images that pass through it.
TensorBoard ãGoogle ColabïŒ
TensorBoardãããŒã«ã«ã§äœ¿çšããã«ã¯ã以äžã®ã³ãã³ããå®è¡ããçµæãhttp://localhost:6006/ã
ããã«ãããTensorBoardãããŒãããããã¬ãŒãã³ã°ãã°ãä¿åãããŠãããã£ã¬ã¯ããªã«ç§»åããŸãã
ãã¬ãŒãèšå®ããåŸãã¢ãã«ã®ãã¬ãŒãã³ã°ãé²ããããšãã§ããŸãããã¹ãŠã®ãã¬ãŒãã³ã°ã¡ããªã¯ã¹ã¯ãéžæãããã©ãããã©ãŒã ã«èªåçã«èšé²ããããããã®ãã°ã«ã¢ã¯ã»ã¹ããŠãæéã®çµéãšãšãã«ã¢ãã«ã®ããã©ãŒãã³ã¹ãç£èŠããç°ãªãã¢ãã«ãæ¯èŒããæ¹åãã¹ãé åãç¹å®ããããšãã§ããŸãã
ããããã質å
How do I train an object detection model using Ultralytics YOLO11?
To train an object detection model using Ultralytics YOLO11, you can either use the Python API or the CLI. Below is an example for both:
ã·ã³ã°ã«GPU ãCPU ãã¬ãŒãã³ã°äŸ
詳现ã«ã€ããŠã¯ãåè»èšå®ã®ã»ã¯ã·ã§ã³ãåç §ããŠãã ããã
What are the key features of Ultralytics YOLO11's Train mode?
The key features of Ultralytics YOLO11's Train mode include:
- ããŒã¿ã»ããã®èªåããŠã³ããŒãCOCOãVOCãImageNetãªã©ã®æšæºããŒã¿ã»ãããèªåçã«ããŠã³ããŒãããŸãã
- ãã«ãGPU ãµããŒãïŒè€æ°ã®GPUã§ãã¬ãŒãã³ã°ãã¹ã±ãŒã«ãããããé«éãªåŠçãå®çŸã
- ãã€ããŒãã©ã¡ãŒã¿ã®èšå®ïŒYAML ãã¡ã€ã«ãŸãã¯CLI åŒæ°ã§ãã€ããŒãã©ã¡ãŒã¿ãã«ã¹ã¿ãã€ãºã
- å¯èŠåãšã¢ãã¿ãªã³ã°ïŒããè¯ãæŽå¯ã®ããã®ãã¬ãŒãã³ã°ã¡ããªã¯ã¹ã®ãªã¢ã«ã¿ã€ã ãã©ããã³ã°ã
ãããã®æ©èœã«ããããã¬ãŒãã³ã°ãå¹ççã«è¡ããããŒãºã«åãããŠã«ã¹ã¿ãã€ãºããããšãã§ããŸãã詳现ã«ã€ããŠã¯ããã¬ã€ã³ã¢ãŒãã®äž»ãªæ©èœã®ã»ã¯ã·ã§ã³ãã芧ãã ããã
How do I resume training from an interrupted session in Ultralytics YOLO11?
äžæããã»ãã·ã§ã³ãããã¬ãŒãã³ã°ãåéããã«ã¯ resume
åŒæ° True
ãéžæããæåŸã«ä¿åãããã§ãã¯ãã€ã³ããžã®ãã¹ãæå®ããã
å±¥æŽæžãã¬ãŒãã³ã°ã®äŸ
詳ããã¯ããäžæããããã¬ãŒãã³ã°ã®åéãã®ã»ã¯ã·ã§ã³ãã芧ãã ããã
Can I train YOLO11 models on Apple M1 and M2 chips?
Yes, Ultralytics YOLO11 supports training on Apple M1 and M2 chips utilizing the Metal Performance Shaders (MPS) framework. Specify 'mps' as your training device.
MPS ãã¬ãŒãã³ã°äŸ
詳现ã«ã€ããŠã¯ãApple M1 and M2MPS Trainingã»ã¯ã·ã§ã³ããåç §ãã ããã
äžè¬çãªãã¬ãŒãã³ã°ã®èšå®ãšãã®æ¹æ³ã¯ïŒ
Ultralytics YOLO11 allows you to configure a variety of training settings such as batch size, learning rate, epochs, and more through arguments. Here's a brief overview:
è°è« | ããã©ã«ã | 説æ |
---|---|---|
model |
None |
ãã¬ãŒãã³ã°çšã¢ãã«ãã¡ã€ã«ãžã®ãã¹ã |
data |
None |
ããŒã¿ã»ããèšå®ãã¡ã€ã«ãžã®ãã¹ïŒäŸïŒ coco8.yaml ). |
epochs |
100 |
ãã¬ãŒãã³ã°ãšããã¯ã®ç·æ°ã |
batch |
16 |
ããããµã€ãºã¯ãæŽæ°ãŸãã¯èªåã¢ãŒããšããŠèª¿æŽå¯èœã |
imgsz |
640 |
ãã¬ãŒãã³ã°ã®ã¿ãŒã²ããç»åãµã€ãºã |
device |
None |
ãã¬ãŒãã³ã°çšã®èšç®æ© cpu , 0 , 0,1 ããã㯠mps . |
save |
True |
ãã¬ãŒãã³ã°ã®ãã§ãã¯ãã€ã³ããšæçµçãªã¢ãã«ã®éã¿ãä¿åã§ããããã«ããŸãã |
ãã¬ãŒãã³ã°èšå®ã®è©³çŽ°ã«ã€ããŠã¯ããã¬ãŒãã³ã°èšå®ã®ã»ã¯ã·ã§ã³ãã芧ãã ããã