vis4d.engine.callbacks.yolox_callbacks

YOLOX-specific callbacks.

Functions

get_norm_states(module)

Get the state_dict of batch norms in the module.

Classes

YOLOXModeSwitchCallback(*args, switch_epoch, ...)

Callback for switching the mode of YOLOX training.

YOLOXSyncNormCallback([epoch_based, ...])

Callback for syncing the norm states of YOLOX training.

YOLOXSyncRandomResizeCallback(*args, ...)

Callback for syncing random resize during YOLOX training.

class YOLOXModeSwitchCallback(*args, switch_epoch, **kwargs)[source]

Callback for switching the mode of YOLOX training.

Parameters:

switch_epoch (int) – Epoch to switch the mode.

Init callback.

on_train_epoch_end(trainer_state, model, loss_module)[source]

Hook to run at the end of a training epoch.

Return type:

None

class YOLOXSyncNormCallback(epoch_based=True, train_connector=None, test_connector=None)[source]

Callback for syncing the norm states of YOLOX training.

Init callback.

Parameters:
  • epoch_based (bool, optional) – Whether the callback is epoch based. Defaults to False.

  • train_connector (None | CallbackConnector, optional) – Defines which kwargs to use during training for different callbacks. Defaults to None.

  • test_connector (None | CallbackConnector, optional) – Defines which kwargs to use during testing for different callbacks. Defaults to None.

on_test_epoch_start(trainer_state, model)[source]

Hook to run at the beginning of a testing epoch.

Parameters:
  • trainer_state (TrainerState) – Trainer state.

  • model (nn.Module) – Model that is being trained.

Return type:

None

class YOLOXSyncRandomResizeCallback(*args, size_list, interval, **kwargs)[source]

Callback for syncing random resize during YOLOX training.

Init callback.

on_train_batch_start(trainer_state, model, loss_module, batch, batch_idx)[source]

Hook to run at the start of a training batch.

Return type:

None

get_norm_states(module)[source]

Get the state_dict of batch norms in the module.

Parameters:

module (nn.Module) – Module to get batch norm states from.

Return type:

Dict[str, Any]