tlc.client.torch.metrics.metrics_collectors.segmentation_metrics_collector#

Collects metrics for segmentation problems.

Module Contents#

Classes#

Class

Description

SegmentationMetricsCollector

Collects predicted mask from model.

Data#

Data

Description

BASE_PREDICTION_FOLDER

API#

tlc.client.torch.metrics.metrics_collectors.segmentation_metrics_collector.BASE_PREDICTION_FOLDER = predictions_0000#
class tlc.client.torch.metrics.metrics_collectors.segmentation_metrics_collector.SegmentationMetricsCollector(segmentation_model: torch.nn.Module, id2label: dict[int, str], post_process_function: Callable[..., list[torch.Tensor]], current_epoch: int, example_id_start: int = 0, predictions_folder_location: str | tlc.core.url.Url | None = None, compute_aggregates: bool = True)#

Bases: tlc.client.torch.metrics.metrics_collectors.metrics_collector_base.MetricsCollector

Collects predicted mask from model.

This class is a specialized version of MetricsCollector and is designed to collect metrics relevant to segmentation mask problems.

Parameters:
  • model_segmentation – The PyTorch model for which the metrics are to be collected.

  • id2_label – A dictionary mapping class ids to class labels.

  • post_process_function – Function used to post process inference.

  • current_epoch – Current epoch used to store predictions inside a folder.

  • example_id_start – The starting index for the example id. Default is 0.

  • predictions_folder_location – The location where the predictions are to be stored. Default is inside the run

  • compute_aggregates – Whether to compute aggregates for the collected metrics. Default is True.

compute_metrics(batch: tlc.core.builtins.types.SampleData, predictions: tlc.core.builtins.types.SampleData | None = None, hook_outputs: dict[int, torch.Tensor] | None = None) dict[str, tlc.core.builtins.types.MetricData]#
property column_schemas: dict[str, tlc.core.schema.Schema]#