Skip to content

ObjectDetection3DLogger Class

Keyword mmdet3d_mode (deprecated since v0.5.0)

On v0.4.x, pass mmdet3d_mode=True when the model runs on MMDetection3D (it can be omitted when the model is declared with a ModelSpec). Since v0.5.0 the keyword is not needed — passing it still works, with a deprecation warning. It is consumed when the model's preset is resolved, so it does not appear in the __init__ signature below. ObjectDetection3DTracer / ObjectDetection3DDataFilter behave the same way.

ml_debugger.monitoring.object_detection_3d.object_detection_3d_torchlogger.ObjectDetection3DTorchLogger

Bases: BaseMonitoringLogger, ObjectDetection3DTorchTracer

Base BaseMonitoringLogger for 3D object detection tasks using PyTorch models.

Subclasses must implement the following abstract methods
  • detect(model): Static method to check if this subclass handles the model.
  • _get_n_class(model): Extract number of classes from the model.
  • _register_model_hooks(model): Register forward hooks for logit capture.
  • _parse_model_output(model_output): Convert model output to a standardized Detection3DOutput.
Optionally override
  • _is_nms_free(): Return True if the model uses NMS-free inference.

__init__(model, model_name, version_name, result_name=None, n_epoch='latest', target_layers=None, additional_fields=None, auto_sync=True, force_table_recreate=False, api_endpoint=None, api_key=None, n_class=None, score_thresh=None, iou_thresh=None, max_detections_per_image=None, max_detections_per_frame=None)

Initialize 3D object detection monitoring logger.

Parameters:

Name Type Description Default

model

Module

PyTorch model to trace.

required

model_name

str

Name of the ML model.

required

version_name

str

Version identifier for the ML model.

required

result_name

Optional[str]

The name of the existing evaluation result to retrieve.

None

n_epoch

Union[str, Optional[int]]

Filter option for n_epoch value.

'latest'

target_layers

Optional[Dict[str, str]]

Mapping of layer aliases to module paths.

None

additional_fields

Optional[List[dict]]

Extra fields for database schema.

None

auto_sync

bool

Enable background syncing of logged data.

True

force_table_recreate

bool

Whether to drop and recreate existing tables.

False

api_endpoint

Optional[str]

URL of the service API for data upload.

None

api_key

Optional[str]

API key for authenticating with the service.

None

n_class

Optional[int]

Number of classes. Auto-detected from model if None.

None

score_thresh

Optional[float]

Minimum score threshold for user-visible NMS decisions.

None

iou_thresh

Optional[float]

IoU threshold for user-visible NMS decisions.

None

max_detections_per_image

Optional[int]

Maximum detections per frame for user-visible output.

None

max_detections_per_frame

Optional[int]

The name earlier releases and existing scripts use for max_detections_per_image, still accepted; passing both with different values raises ValueError.

None

__call__(model_input, input_ids=None, dataset_type='deploying', **kwargs)

Invoke the logger on a single inference, recording I/O data.

Parameters:

Name Type Description Default

model_input

Any

Input data for the model inference.

required

input_ids

Optional[List[str]]

Identifiers of each input data.

None

dataset_type

str

Identifier of input dataset. (e.g. 'train', 'val', 'test', 'deploying')

'deploying'

**kwargs

Any

Additional keyword arguments for parsing and saving I/O data.

{}

Returns:

Type Description
Any

The raw output produced by the model.

get_hooked_features(layer_name)

Retrieve the captured output for a given layer alias.

Parameters:

Name Type Description Default

layer_name

str

Alias of the layer whose activation was captured.

required

Returns:

Name Type Description
Any Any

Activation data stored for the specified layer.

Raises:

Type Description
KeyError

If no activation has been captured for layer_name.

export(output_path=None)

Export extracted features into a ZIP archive.

Uses the internal n_epoch resolved during validator setup to filter records, consistent with upload() and wait_for_save().

Parameters:

Name Type Description Default

output_path

Optional[str]

Path or directory for saving the ZIP file. If no .zip extension, the default filename is appended. Defaults to cwd.

None

Returns:

Type Description
Optional[Path]

Path to the created ZIP file, or None on non-primary distributed ranks. A

Optional[Path]

model with named outputs returns one path per output name instead.

wait_for_save(interval=3, *, force=False, timeout=None)

Flush pending writes and upload the monitoring log to the service.

Parameters:

Name Type Description Default

interval

int

Poll interval (seconds) while waiting for background sync.

3

force

bool

Upload even when nothing has been marked unsaved since the last upload.

False

timeout

Optional[float]

Optional hard cap (seconds) on waiting for background sync before falling back to a direct upload / raising.

None
Note

Monitoring logs are always appended on the server, so the upload mode option offered by the training tracers does not apply to Logger / DataFilter and is intentionally not exposed here.

upload(*, force=False)

Flush pending writes and upload the monitoring log to the service.

Parameters:

Name Type Description Default

force

bool

Upload even when nothing has been marked unsaved since the last upload.

False
Note

Monitoring logs are always appended on the server, so the upload mode option offered by the training tracers does not apply to Logger / DataFilter and is intentionally not exposed here.

get_statistics()

Count what this instance has recorded locally, without returning any of it.

This is the supported way to confirm what was recorded: how many rows, how many distinct inputs and how many ground-truth rows each recorded group holds. It returns counts only, never recorded values. Writes still pending are completed first, so the counts include everything recorded so far. In a distributed run, each process counts the records it wrote itself.

Returns:

Type Description
Any

A list with one entry per (dataset_type, n_epoch) group present in the

Any

local records, each of the form ``{"dataset_type": str, "n_epoch":

Any

Optional[int], "rows": int, "inputs": int, "ground_truth_rows": int}`` --

Any

n_epoch is None for records made without an epoch, inputs counts

Any

distinct input ids, and ground_truth_rows is 0 when no ground truth is

Any

recorded. A model with named outputs returns {output name: list}.