Skip to content

Commit 3cd401f

Browse files
Remove Hindi links
1 parent a9af0e2 commit 3cd401f

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

segment/train.py

+14-13
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,7 @@
9696

9797

9898
def train(hyp, opt, device, callbacks):
99-
"""
100-
Trains the YOLOv5 model on a dataset, managing hyperparameters, model optimization, logging, and validation.
101-
102-
`hyp` is path/to/hyp.yaml or hyp dictionary.
103-
"""
99+
"""Trains a YOLOv5 segmentation model on a dataset, handling hyperparameters, optimization, and validation."""
104100
(
105101
save_dir,
106102
epochs,
@@ -541,11 +537,7 @@ def lf(x):
541537

542538

543539
def parse_opt(known=False):
544-
"""
545-
Parses command line arguments for training configurations, returning parsed arguments.
546-
547-
Supports both known and unknown args.
548-
"""
540+
"""Parses command line arguments for YOLOv5 training configurations, supporting both known and unknown arguments."""
549541
parser = argparse.ArgumentParser()
550542
parser.add_argument("--weights", type=str, default=ROOT / "yolov5s-seg.pt", help="initial weights path")
551543
parser.add_argument("--cfg", type=str, default="", help="model.yaml path")
@@ -748,9 +740,18 @@ def main(opt, callbacks=Callbacks()):
748740

749741
def run(**kwargs):
750742
"""
751-
Executes YOLOv5 training with given parameters, altering options programmatically; returns updated options.
752-
753-
Example: import train; train.run(data='coco128.yaml', imgsz=320, weights='yolov5m.pt')
743+
Executes YOLOv5 training with given parameters, altering options programmatically.
744+
745+
Args:
746+
**kwargs (Any): Keyword arguments to override default training options.
747+
748+
Returns:
749+
(argparse.Namespace): Updated options after parsing and applying keyword arguments.
750+
751+
Examples:
752+
Run YOLOv5 training with custom data and image size
753+
>>> import train
754+
>>> train.run(data='coco128.yaml', imgsz=320, weights='yolov5m.pt')
754755
"""
755756
opt = parse_opt(True)
756757
for k, v in kwargs.items():

0 commit comments

Comments
 (0)