class_docstr: An internal YOLO model wrapper that tracks metrics, and logs models to Weights & Biases.
  
  Usage:
  ```python
  from wandb.integration.yolov8.yolov8 import WandbCallback
  
  model = YOLO("yolov8n.pt")
  wandb_logger = WandbCallback(
      model,
  )
  for event, callback_fn in wandb_logger.callbacks.items():
      model.add_callback(event, callback_fn)
  ```
class_docstr_tok: ["An","internal","YOLO","model","wrapper","that","tracks","metrics",",","and","logs","models","to","Weights","&","Biases",".","Usage",":","``","`","python","from","wandb.integration.yolov8.yolov8","import","WandbCallback","model","=","YOLO","(","``","yolov8n.pt","''",")","wandb_logger","=","WandbCallback","(","model",",",")","for","event",",","callback_fn","in","wandb_logger.callbacks.items","(",")",":","model.add_callback","(","event",",","callback_fn",")","``","`"]
docstr: Starts a new wandb run to track the training process and log to Weights & Biases.
  
  Args:
      trainer: A task trainer that's inherited from `:class:ultralytics.yolo.engine.trainer.BaseTrainer`
              that contains the model training and optimization routine.
docstr_tok: ["Starts","a","new","wandb","run","to","track","the","training","process","and","log","to","Weights","&","Biases",".","Args",":","trainer",":","A","task","trainer","that","'s","inherited","from","`",":","class",":","ultralytics.yolo.engine.trainer.BaseTrainer","`","that","contains","the","model","training","and","optimization","routine","."]
code: def on_pretrain_routine_start(self, trainer: BaseTrainer) -> None:
      """Starts a new wandb run to track the training process and log to Weights & Biases.
  
      Args:
          trainer: A task trainer that's inherited from `:class:ultralytics.yolo.engine.trainer.BaseTrainer`
                  that contains the model training and optimization routine.
      """
      if wandb.run is None:
          self.run = wandb.init(
              name=self.run_name
              if self.run_name
              else trainer.args.name,
              project=self.project
              if self.project
              else trainer.args.project or "YOLOv8",
              tags=self.tags if self.tags else ["YOLOv8"],
              config=vars(trainer.args),
              resume=self.resume if self.resume else None,
              **self.kwargs,
          )
      else:
          self.run = wandb.run
      assert self.run is not None
      self.run.define_metric("epoch", hidden=True)
      self.run.define_metric(
          "train/*", step_metric="epoch", step_sync=True, summary="min"
      )
  
      self.run.define_metric(
          "val/*", step_metric="epoch", step_sync=True, summary="min"
      )
  
      self.run.define_metric(
          "metrics/*",
          step_metric="epoch",
          step_sync=True,
          summary="max",
      )
      self.run.define_metric(
          "lr/*", step_metric="epoch", step_sync=True, summary="last"
      )
  
      with telemetry.context(run=wandb.run) as tel:
          tel.feature.ultralytics_yolov8 = True
  
file_path: wandb/wandb/integration/yolov8/yolov8.py
imports: from typing import Any, Callable, Dict, List, Optional
  from ultralytics.yolo.engine.model import YOLO
  from ultralytics.yolo.engine.trainer import BaseTrainer
  from ultralytics.yolo.v8.classify.train import ClassificationTrainer
  import wandb
  from wandb.sdk.lib import telemetry
label_desc: Use image node_id 2 for calling the WandbCallback obj's underlying member method code with example usage: obj.on_pretrain_routine_start(trainer) without return types