Skip to content

Commit 896ebe4

Browse files
authored
Merge pull request #8 from Burhan-Q/dev
`0.1.1` Patch - correct `yolo-train-kwords`
2 parents 74fa9f4 + 6d219df commit 896ebe4

File tree

2 files changed

+69
-69
lines changed

2 files changed

+69
-69
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "ultralytics-snippets",
33
"displayName": "Ultralytics Snippets",
44
"description": "Snippets to use with the Ultralytics Python library.",
5-
"version": "0.1.0",
5+
"version": "0.1.1",
66
"publisher": "Ultralytics",
77
"repository": {
88
"type": "git",

snippets/examples.json

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -205,74 +205,74 @@
205205
"'''",
206206
"model = YOLO(\"yolov${1|8,5,9,10|}${2|n,s,m,l,x,c,e|}${3|.,-cls.,-seg.,-obb.,-pose.,-world.,-worldv2.|}pt\")",
207207
"results: list = model.train(",
208-
"data=${4:\"coco8.yaml\"}, # (str, optional) path to data file, i.e. coco8.yaml",
209-
"epochs=${5:100}, # (int) number of epochs to train for",
210-
"time=${6:None}, # (float, optional) number of hours to train for, overrides epochs if supplied",
211-
"patience=${7:100}, # (int) epochs to wait for no observable improvement for early stopping of training",
212-
"batch=${8:16}, # (int) number of images per batch (-1 for AutoBatch)",
213-
"imgsz=${9:640}, # (int | list) input images size as int for train and val modes, or list[w,h] for predict and export modes",
214-
"save=${10:True}, # (bool) save train checkpoints and predict results",
215-
"save_period=${11:-1}, # (int) Save checkpoint every x epochs (disabled if < 1)",
216-
"cache=${12:False}, # (bool) True/ram, disk or False. Use cache for data loading",
217-
"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",
218-
"workers=${14:8}, # (int) number of worker threads for data loading (per RANK if DDP)",
219-
"project=${15:None}, # (str, optional) project name",
220-
"name=${16:None}, # (str, optional) experiment name, results saved to 'project/name' directory",
221-
"exist_ok=${17:False}, # (bool) whether to overwrite existing experiment",
222-
"val=${18:True}, # (bool) validate/test during training",
223-
"pretrained=${19:True}, # (bool | str) whether to use a pretrained model (bool) or a model to load weights from (str)",
224-
"optimizer=\"${20|SGD,Adam,Adamax,AdamW,NAdam,RAdam,RMSProp,auto|}\", # (str) optimizer to use, choices=[SGD, Adam, Adamax, AdamW, NAdam, RAdam, RMSProp, auto]",
225-
"verbose=${21:True}, # (bool) whether to print verbose output",
226-
"seed=${22:0}, # (int) random seed for reproducibility",
227-
"deterministic=${23:True}, # (bool) whether to enable deterministic mode",
228-
"single_cls=${24:False}, # (bool) train multi-class data as single-class",
229-
"rect=${25:False}, # (bool) rectangular training if mode='train' or rectangular validation if mode='val'",
230-
"cos_lr=${26:False}, # (bool) use cosine learning rate scheduler",
231-
"close_mosaic=${27:10}, # (int) disable mosaic augmentation for final epochs (0 to disable)",
232-
"resume=${28:False}, # (bool) resume training from last checkpoint",
233-
"amp=${29:True}, # (bool) Automatic Mixed Precision (AMP) training, choices=[True, False], True runs AMP check",
234-
"fraction=${30:1.0}, # (float) dataset fraction to train on (default is 1.0, all images in train set)",
235-
"profile=${31:False}, # (bool) profile ONNX and TensorRT speeds during training for loggers",
236-
"freeze=${32:None}, # (int | list, optional) freeze first n layers, or freeze list of layer indices during training",
237-
"multi_scale=${33:False}, # (bool) Whether to use multiscale during training",
238-
"plots=${34:True} # (bool) save plots and images during train/val",
239-
"# Segmentation",
240-
"overlap_mask=${35:True}, # (bool) masks should overlap during training (segment train only)",
241-
"mask_ratio=${36:4}, # (int) mask downsample ratio (segment train only)",
242-
"# Classification",
243-
"dropout=${37:0.0}, # (float) use dropout regularization (classify train only)",
244-
"# Hyperparameters",
245-
"lr0=${38:0.01}, # (float) initial learning rate (i.e. SGD=1E-2, Adam=1E-3)",
246-
"lrf=${39:0.01}, # (float) final learning rate (lr0 * lrf)",
247-
"momentum=${40:0.937}, # (float) SGD momentum/Adam beta1",
248-
"weight_decay=${41:0.0005}, # (float) optimizer weight decay 5e-4",
249-
"warmup_epochs=${42:3.0}, # (float) warmup epochs (fractions ok)",
250-
"warmup_momentum=${43:0.8}, # (float) warmup initial momentum",
251-
"warmup_bias_lr=${44:0.1}, # (float) warmup initial bias lr",
252-
"box=${45:7.5}, # (float) box loss gain",
253-
"cls=${46:0.5}, # (float) cls loss gain (scale with pixels)",
254-
"dfl=${47:1.5}, # (float) dfl loss gain",
255-
"pose=${48:12.0}, # (float) pose loss gain",
256-
"kobj=${49:1.0}, # (float) keypoint obj loss gain",
257-
"label_smoothing=${50:0.0}, # (float) label smoothing (fraction)",
258-
"nbs=${51:64}, # (int) nominal batch size",
259-
"hsv_h=${52:0.015}, # (float) image HSV-Hue augmentation (fraction)",
260-
"hsv_s=${53:0.7}, # (float) image HSV-Saturation augmentation (fraction)",
261-
"hsv_v=${54:0.4}, # (float) image HSV-Value augmentation (fraction)",
262-
"degrees=${55:0.0}, # (float) image rotation (+/- deg)",
263-
"translate=${56:0.1}, # (float) image translation (+/- fraction)",
264-
"scale=${57:0.5}, # (float) image scale (+/- gain)",
265-
"shear=${58:0.0}, # (float) image shear (+/- deg)",
266-
"perspective=${59:0.0}, # (float) image perspective (+/- fraction), range 0-0.001",
267-
"flipud=${60:0.0}, # (float) image flip up-down (probability)",
268-
"fliplr=${61:0.5}, # (float) image flip left-right (probability)",
269-
"bgr=${62:0.0}, # (float) image channel BGR (probability)",
270-
"mosaic=${63:1.0}, # (float) image mosaic (probability)",
271-
"mixup=${64:0.0}, # (float) image mixup (probability)",
272-
"copy_paste=${65:0.0}, # (float) segment copy-paste (probability)",
273-
"auto_augment=\"${66|randaugment,autoaugment,augmix|}\", # (str) auto augmentation policy for classification (randaugment, autoaugment, augmix)",
274-
"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.",
275-
"crop_fraction=${68:1.0}, # (float) image crop fraction for classification (0.1-1), 1.0 means no crop, must be greater than 0.",
208+
" data=${4:\"coco8.yaml\"}, # (str, optional) path to data file, i.e. coco8.yaml",
209+
" epochs=${5:100}, # (int) number of epochs to train for",
210+
" time=${6:None}, # (float, optional) number of hours to train for, overrides epochs if supplied",
211+
" patience=${7:100}, # (int) epochs to wait for no observable improvement for early stopping of training",
212+
" batch=${8:16}, # (int) number of images per batch (-1 for AutoBatch)",
213+
" imgsz=${9:640}, # (int | list) input images size as int for train and val modes, or list[w,h] for predict and export modes",
214+
" save=${10:True}, # (bool) save train checkpoints and predict results",
215+
" save_period=${11:-1}, # (int) Save checkpoint every x epochs (disabled if < 1)",
216+
" cache=${12:False}, # (bool) True/ram, disk or False. Use cache for data loading",
217+
" 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",
218+
" workers=${14:8}, # (int) number of worker threads for data loading (per RANK if DDP)",
219+
" project=${15:None}, # (str, optional) project name",
220+
" name=${16:None}, # (str, optional) experiment name, results saved to 'project/name' directory",
221+
" exist_ok=${17:False}, # (bool) whether to overwrite existing experiment",
222+
" val=${18:True}, # (bool) validate/test during training",
223+
" pretrained=${19:True}, # (bool | str) whether to use a pretrained model (bool) or a model to load weights from (str)",
224+
" optimizer=\"${20|SGD,Adam,Adamax,AdamW,NAdam,RAdam,RMSProp,auto|}\", # (str) optimizer to use, choices=[SGD, Adam, Adamax, AdamW, NAdam, RAdam, RMSProp, auto]",
225+
" verbose=${21:True}, # (bool) whether to print verbose output",
226+
" seed=${22:0}, # (int) random seed for reproducibility",
227+
" deterministic=${23:True}, # (bool) whether to enable deterministic mode",
228+
" single_cls=${24:False}, # (bool) train multi-class data as single-class",
229+
" rect=${25:False}, # (bool) rectangular training if mode='train' or rectangular validation if mode='val'",
230+
" cos_lr=${26:False}, # (bool) use cosine learning rate scheduler",
231+
" close_mosaic=${27:10}, # (int) disable mosaic augmentation for final epochs (0 to disable)",
232+
" resume=${28:False}, # (bool) resume training from last checkpoint",
233+
" amp=${29:True}, # (bool) Automatic Mixed Precision (AMP) training, choices=[True, False], True runs AMP check",
234+
" fraction=${30:1.0}, # (float) dataset fraction to train on (default is 1.0, all images in train set)",
235+
" profile=${31:False}, # (bool) profile ONNX and TensorRT speeds during training for loggers",
236+
" freeze=${32:None}, # (int | list, optional) freeze first n layers, or freeze list of layer indices during training",
237+
" multi_scale=${33:False}, # (bool) Whether to use multiscale during training",
238+
" plots=${34:True}, # (bool) save plots and images during train/val",
239+
" # Segmentation",
240+
" overlap_mask=${35:True}, # (bool) masks should overlap during training (segment train only)",
241+
" mask_ratio=${36:4}, # (int) mask downsample ratio (segment train only)",
242+
" # Classification",
243+
" dropout=${37:0.0}, # (float) use dropout regularization (classify train only)",
244+
" # Hyperparameters",
245+
" lr0=${38:0.01}, # (float) initial learning rate (i.e. SGD=1E-2, Adam=1E-3)",
246+
" lrf=${39:0.01}, # (float) final learning rate (lr0 * lrf)",
247+
" momentum=${40:0.937}, # (float) SGD momentum/Adam beta1",
248+
" weight_decay=${41:0.0005}, # (float) optimizer weight decay 5e-4",
249+
" warmup_epochs=${42:3.0}, # (float) warmup epochs (fractions ok)",
250+
" warmup_momentum=${43:0.8}, # (float) warmup initial momentum",
251+
" warmup_bias_lr=${44:0.1}, # (float) warmup initial bias lr",
252+
" box=${45:7.5}, # (float) box loss gain",
253+
" cls=${46:0.5}, # (float) cls loss gain (scale with pixels)",
254+
" dfl=${47:1.5}, # (float) dfl loss gain",
255+
" pose=${48:12.0}, # (float) pose loss gain",
256+
" kobj=${49:1.0}, # (float) keypoint obj loss gain",
257+
" label_smoothing=${50:0.0}, # (float) label smoothing (fraction)",
258+
" nbs=${51:64}, # (int) nominal batch size",
259+
" hsv_h=${52:0.015}, # (float) image HSV-Hue augmentation (fraction)",
260+
" hsv_s=${53:0.7}, # (float) image HSV-Saturation augmentation (fraction)",
261+
" hsv_v=${54:0.4}, # (float) image HSV-Value augmentation (fraction)",
262+
" degrees=${55:0.0}, # (float) image rotation (+/- deg)",
263+
" translate=${56:0.1}, # (float) image translation (+/- fraction)",
264+
" scale=${57:0.5}, # (float) image scale (+/- gain)",
265+
" shear=${58:0.0}, # (float) image shear (+/- deg)",
266+
" perspective=${59:0.0}, # (float) image perspective (+/- fraction), range 0-0.001",
267+
" flipud=${60:0.0}, # (float) image flip up-down (probability)",
268+
" fliplr=${61:0.5}, # (float) image flip left-right (probability)",
269+
" bgr=${62:0.0}, # (float) image channel BGR (probability)",
270+
" mosaic=${63:1.0}, # (float) image mosaic (probability)",
271+
" mixup=${64:0.0}, # (float) image mixup (probability)",
272+
" copy_paste=${65:0.0}, # (float) segment copy-paste (probability)",
273+
" auto_augment=\"${66|randaugment,autoaugment,augmix|}\", # (str) auto augmentation policy for classification (randaugment, autoaugment, augmix)",
274+
" 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.",
275+
" crop_fraction=${68:1.0}, # (float) image crop fraction for classification (0.1-1), 1.0 means no crop, must be greater than 0.",
276276
")",
277277
"# reference https://docs.ultralytics.com/modes/predict/"
278278
],

0 commit comments

Comments
 (0)