get_callbacks

lightning_pose.callbacks.get_callbacks(cfg: DictConfig | ListConfig, early_stopping: bool = False, checkpointing: bool = True, lr_monitor: bool = True, ckpt_every_n_epochs: int | None = None, backbone_unfreeze: bool = True, status_file: Path | None = None) list[source]

Build and return the list of training callbacks based on the config.

Parameters:
  • cfg – hydra config containing training and callback parameters.

  • early_stopping – if True, add an EarlyStopping callback.

  • checkpointing – if True, add a ModelCheckpoint callback that saves the best model.

  • lr_monitor – if True, add a LearningRateMonitor callback.

  • ckpt_every_n_epochs – if not None, also save a checkpoint every this many epochs.

  • backbone_unfreeze – if True, add the UnfreezeBackbone callback.

  • status_file – if not None, add a JSONTrainingProgressTracker callback writing to this path.

Returns:

List of callback objects ready to pass to a pl.Trainer.