tlc.integration.detectron2.detectron_metrics_collection_hook¶

Hook that collects detectron2 standard metrics.

Module Contents¶

Classes¶

Class

Description

DetectronMetricsCollectionHook

Hook that collects detectron2 standard metrics during training.

API¶

class DetectronMetricsCollectionHook(
run_url: Run | Url | str | None = None,
cfg: CfgNode | None = None,
collection_start_iteration: int = 0,
collection_frequency: int = -1,
)¶

Bases: detectron2.engine.hooks.HookBase

Hook that collects detectron2 standard metrics during training.

Collect any metrics that are available in the detectron2 event storage and write them as a single table to the run.

Parameters:
  • run_url – A tlc.Run object, or the URL of the Run to use. Will default to using the current active Run.

  • cfg – The detectron2 config. If None, the config will be read from the trainer.

  • collection_start_iteration – The iteration to start collecting metrics on.

  • collection_frequency – The frequency with which to collect metrics.

after_step() None¶

Collects metrics if required.

after_train() None¶

Writes the metrics table to the run.

before_train() None¶

Checks that the detectron config includes the values required to collect metrics, collects metrics if required.