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: On train epoch end we log all the metrics to the Weights & Biases run.
docstr_tok: ["On","train","epoch","end","we","log","all","the","metrics","to","the","Weights","&","Biases","run","."]
code: def on_train_epoch_end(self, trainer: BaseTrainer) -> None:
      """On train epoch end we log all the metrics to the Weights & Biases run."""
      assert self.run is not None
      self.run.log(
          {
              **trainer.metrics,
              **trainer.label_loss_items(trainer.tloss, prefix="train"),
              **trainer.lr,
          },
      )
      # Currently only the detection and segmentation trainers save images to the save_dir
      if not isinstance(trainer, ClassificationTrainer):
          self.run.log(
              {
                  "train_batch_images": [
                      wandb.Image(
                          str(image_path), caption=image_path.stem
                      )
                      for image_path in trainer.save_dir.glob(
                          "train_batch*.jpg"
                      )
                  ]
              }
          )
  
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 5 for calling the WandbCallback obj's underlying member method code with example usage: obj.on_train_epoch_end(trainer) without return types