Skip to content

Commit

Permalink
Merge pull request #8 from Burhan-Q/dev
Browse files Browse the repository at this point in the history
`0.1.1` Patch - correct `yolo-train-kwords`
  • Loading branch information
Burhan-Q committed Jul 2, 2024
2 parents 74fa9f4 + 6d219df commit 896ebe4
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ultralytics-snippets",
"displayName": "Ultralytics Snippets",
"description": "Snippets to use with the Ultralytics Python library.",
"version": "0.1.0",
"version": "0.1.1",
"publisher": "Ultralytics",
"repository": {
"type": "git",
Expand Down
136 changes: 68 additions & 68 deletions snippets/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,74 +205,74 @@
"'''",
"model = YOLO(\"yolov${1|8,5,9,10|}${2|n,s,m,l,x,c,e|}${3|.,-cls.,-seg.,-obb.,-pose.,-world.,-worldv2.|}pt\")",
"results: list = model.train(",
"data=${4:\"coco8.yaml\"}, # (str, optional) path to data file, i.e. coco8.yaml",
"epochs=${5:100}, # (int) number of epochs to train for",
"time=${6:None}, # (float, optional) number of hours to train for, overrides epochs if supplied",
"patience=${7:100}, # (int) epochs to wait for no observable improvement for early stopping of training",
"batch=${8:16}, # (int) number of images per batch (-1 for AutoBatch)",
"imgsz=${9:640}, # (int | list) input images size as int for train and val modes, or list[w,h] for predict and export modes",
"save=${10:True}, # (bool) save train checkpoints and predict results",
"save_period=${11:-1}, # (int) Save checkpoint every x epochs (disabled if < 1)",
"cache=${12:False}, # (bool) True/ram, disk or False. Use cache for data loading",
"device=${13:None}, # (int | str | list, optional) device to run on, i.e. cuda device=0 or device=0,1,2,3 or device=cpu",
"workers=${14:8}, # (int) number of worker threads for data loading (per RANK if DDP)",
"project=${15:None}, # (str, optional) project name",
"name=${16:None}, # (str, optional) experiment name, results saved to 'project/name' directory",
"exist_ok=${17:False}, # (bool) whether to overwrite existing experiment",
"val=${18:True}, # (bool) validate/test during training",
"pretrained=${19:True}, # (bool | str) whether to use a pretrained model (bool) or a model to load weights from (str)",
"optimizer=\"${20|SGD,Adam,Adamax,AdamW,NAdam,RAdam,RMSProp,auto|}\", # (str) optimizer to use, choices=[SGD, Adam, Adamax, AdamW, NAdam, RAdam, RMSProp, auto]",
"verbose=${21:True}, # (bool) whether to print verbose output",
"seed=${22:0}, # (int) random seed for reproducibility",
"deterministic=${23:True}, # (bool) whether to enable deterministic mode",
"single_cls=${24:False}, # (bool) train multi-class data as single-class",
"rect=${25:False}, # (bool) rectangular training if mode='train' or rectangular validation if mode='val'",
"cos_lr=${26:False}, # (bool) use cosine learning rate scheduler",
"close_mosaic=${27:10}, # (int) disable mosaic augmentation for final epochs (0 to disable)",
"resume=${28:False}, # (bool) resume training from last checkpoint",
"amp=${29:True}, # (bool) Automatic Mixed Precision (AMP) training, choices=[True, False], True runs AMP check",
"fraction=${30:1.0}, # (float) dataset fraction to train on (default is 1.0, all images in train set)",
"profile=${31:False}, # (bool) profile ONNX and TensorRT speeds during training for loggers",
"freeze=${32:None}, # (int | list, optional) freeze first n layers, or freeze list of layer indices during training",
"multi_scale=${33:False}, # (bool) Whether to use multiscale during training",
"plots=${34:True} # (bool) save plots and images during train/val",
"# Segmentation",
"overlap_mask=${35:True}, # (bool) masks should overlap during training (segment train only)",
"mask_ratio=${36:4}, # (int) mask downsample ratio (segment train only)",
"# Classification",
"dropout=${37:0.0}, # (float) use dropout regularization (classify train only)",
"# Hyperparameters",
"lr0=${38:0.01}, # (float) initial learning rate (i.e. SGD=1E-2, Adam=1E-3)",
"lrf=${39:0.01}, # (float) final learning rate (lr0 * lrf)",
"momentum=${40:0.937}, # (float) SGD momentum/Adam beta1",
"weight_decay=${41:0.0005}, # (float) optimizer weight decay 5e-4",
"warmup_epochs=${42:3.0}, # (float) warmup epochs (fractions ok)",
"warmup_momentum=${43:0.8}, # (float) warmup initial momentum",
"warmup_bias_lr=${44:0.1}, # (float) warmup initial bias lr",
"box=${45:7.5}, # (float) box loss gain",
"cls=${46:0.5}, # (float) cls loss gain (scale with pixels)",
"dfl=${47:1.5}, # (float) dfl loss gain",
"pose=${48:12.0}, # (float) pose loss gain",
"kobj=${49:1.0}, # (float) keypoint obj loss gain",
"label_smoothing=${50:0.0}, # (float) label smoothing (fraction)",
"nbs=${51:64}, # (int) nominal batch size",
"hsv_h=${52:0.015}, # (float) image HSV-Hue augmentation (fraction)",
"hsv_s=${53:0.7}, # (float) image HSV-Saturation augmentation (fraction)",
"hsv_v=${54:0.4}, # (float) image HSV-Value augmentation (fraction)",
"degrees=${55:0.0}, # (float) image rotation (+/- deg)",
"translate=${56:0.1}, # (float) image translation (+/- fraction)",
"scale=${57:0.5}, # (float) image scale (+/- gain)",
"shear=${58:0.0}, # (float) image shear (+/- deg)",
"perspective=${59:0.0}, # (float) image perspective (+/- fraction), range 0-0.001",
"flipud=${60:0.0}, # (float) image flip up-down (probability)",
"fliplr=${61:0.5}, # (float) image flip left-right (probability)",
"bgr=${62:0.0}, # (float) image channel BGR (probability)",
"mosaic=${63:1.0}, # (float) image mosaic (probability)",
"mixup=${64:0.0}, # (float) image mixup (probability)",
"copy_paste=${65:0.0}, # (float) segment copy-paste (probability)",
"auto_augment=\"${66|randaugment,autoaugment,augmix|}\", # (str) auto augmentation policy for classification (randaugment, autoaugment, augmix)",
"erasing=${67:0.4}, # (float) probability of random erasing during classification training (0-0.9), 0 means no erasing, must be less than 1.0.",
"crop_fraction=${68:1.0}, # (float) image crop fraction for classification (0.1-1), 1.0 means no crop, must be greater than 0.",
" data=${4:\"coco8.yaml\"}, # (str, optional) path to data file, i.e. coco8.yaml",
" epochs=${5:100}, # (int) number of epochs to train for",
" time=${6:None}, # (float, optional) number of hours to train for, overrides epochs if supplied",
" patience=${7:100}, # (int) epochs to wait for no observable improvement for early stopping of training",
" batch=${8:16}, # (int) number of images per batch (-1 for AutoBatch)",
" imgsz=${9:640}, # (int | list) input images size as int for train and val modes, or list[w,h] for predict and export modes",
" save=${10:True}, # (bool) save train checkpoints and predict results",
" save_period=${11:-1}, # (int) Save checkpoint every x epochs (disabled if < 1)",
" cache=${12:False}, # (bool) True/ram, disk or False. Use cache for data loading",
" device=${13:None}, # (int | str | list, optional) device to run on, i.e. cuda device=0 or device=0,1,2,3 or device=cpu",
" workers=${14:8}, # (int) number of worker threads for data loading (per RANK if DDP)",
" project=${15:None}, # (str, optional) project name",
" name=${16:None}, # (str, optional) experiment name, results saved to 'project/name' directory",
" exist_ok=${17:False}, # (bool) whether to overwrite existing experiment",
" val=${18:True}, # (bool) validate/test during training",
" pretrained=${19:True}, # (bool | str) whether to use a pretrained model (bool) or a model to load weights from (str)",
" optimizer=\"${20|SGD,Adam,Adamax,AdamW,NAdam,RAdam,RMSProp,auto|}\", # (str) optimizer to use, choices=[SGD, Adam, Adamax, AdamW, NAdam, RAdam, RMSProp, auto]",
" verbose=${21:True}, # (bool) whether to print verbose output",
" seed=${22:0}, # (int) random seed for reproducibility",
" deterministic=${23:True}, # (bool) whether to enable deterministic mode",
" single_cls=${24:False}, # (bool) train multi-class data as single-class",
" rect=${25:False}, # (bool) rectangular training if mode='train' or rectangular validation if mode='val'",
" cos_lr=${26:False}, # (bool) use cosine learning rate scheduler",
" close_mosaic=${27:10}, # (int) disable mosaic augmentation for final epochs (0 to disable)",
" resume=${28:False}, # (bool) resume training from last checkpoint",
" amp=${29:True}, # (bool) Automatic Mixed Precision (AMP) training, choices=[True, False], True runs AMP check",
" fraction=${30:1.0}, # (float) dataset fraction to train on (default is 1.0, all images in train set)",
" profile=${31:False}, # (bool) profile ONNX and TensorRT speeds during training for loggers",
" freeze=${32:None}, # (int | list, optional) freeze first n layers, or freeze list of layer indices during training",
" multi_scale=${33:False}, # (bool) Whether to use multiscale during training",
" plots=${34:True}, # (bool) save plots and images during train/val",
" # Segmentation",
" overlap_mask=${35:True}, # (bool) masks should overlap during training (segment train only)",
" mask_ratio=${36:4}, # (int) mask downsample ratio (segment train only)",
" # Classification",
" dropout=${37:0.0}, # (float) use dropout regularization (classify train only)",
" # Hyperparameters",
" lr0=${38:0.01}, # (float) initial learning rate (i.e. SGD=1E-2, Adam=1E-3)",
" lrf=${39:0.01}, # (float) final learning rate (lr0 * lrf)",
" momentum=${40:0.937}, # (float) SGD momentum/Adam beta1",
" weight_decay=${41:0.0005}, # (float) optimizer weight decay 5e-4",
" warmup_epochs=${42:3.0}, # (float) warmup epochs (fractions ok)",
" warmup_momentum=${43:0.8}, # (float) warmup initial momentum",
" warmup_bias_lr=${44:0.1}, # (float) warmup initial bias lr",
" box=${45:7.5}, # (float) box loss gain",
" cls=${46:0.5}, # (float) cls loss gain (scale with pixels)",
" dfl=${47:1.5}, # (float) dfl loss gain",
" pose=${48:12.0}, # (float) pose loss gain",
" kobj=${49:1.0}, # (float) keypoint obj loss gain",
" label_smoothing=${50:0.0}, # (float) label smoothing (fraction)",
" nbs=${51:64}, # (int) nominal batch size",
" hsv_h=${52:0.015}, # (float) image HSV-Hue augmentation (fraction)",
" hsv_s=${53:0.7}, # (float) image HSV-Saturation augmentation (fraction)",
" hsv_v=${54:0.4}, # (float) image HSV-Value augmentation (fraction)",
" degrees=${55:0.0}, # (float) image rotation (+/- deg)",
" translate=${56:0.1}, # (float) image translation (+/- fraction)",
" scale=${57:0.5}, # (float) image scale (+/- gain)",
" shear=${58:0.0}, # (float) image shear (+/- deg)",
" perspective=${59:0.0}, # (float) image perspective (+/- fraction), range 0-0.001",
" flipud=${60:0.0}, # (float) image flip up-down (probability)",
" fliplr=${61:0.5}, # (float) image flip left-right (probability)",
" bgr=${62:0.0}, # (float) image channel BGR (probability)",
" mosaic=${63:1.0}, # (float) image mosaic (probability)",
" mixup=${64:0.0}, # (float) image mixup (probability)",
" copy_paste=${65:0.0}, # (float) segment copy-paste (probability)",
" auto_augment=\"${66|randaugment,autoaugment,augmix|}\", # (str) auto augmentation policy for classification (randaugment, autoaugment, augmix)",
" erasing=${67:0.4}, # (float) probability of random erasing during classification training (0-0.9), 0 means no erasing, must be less than 1.0.",
" crop_fraction=${68:1.0}, # (float) image crop fraction for classification (0.1-1), 1.0 means no crop, must be greater than 0.",
")",
"# reference https://docs.ultralytics.com/modes/predict/"
],
Expand Down

0 comments on commit 896ebe4

Please sign in to comment.