lisbet.evaluation#

Model evaluation utilities for LISBET.

This module provides functions to evaluate classification models on labeled datasets, using the new LISBET inference API, torchmetrics, and improved output handling.

Functions

evaluate(model_path, weights_path, ...[, ...])

Evaluate a classification model on a labeled dataset and print/save metrics.

lisbet.evaluation.evaluate(model_path, weights_path, data_format, data_path, data_scale=None, data_filter=None, window_size=200, window_offset=0, fps_scaling=1.0, batch_size=128, select_coords=None, rename_coords=None, ignore_index=None, mode='multiclass', threshold=0.5, output_path=None)[source]#

Evaluate a classification model on a labeled dataset and print/save metrics.

Parameters:
  • model_path (str) – Path to the model config (YAML).

  • weights_path (str) – Path to the model weights.

  • data_format (str) – Format of the dataset to analyze.

  • data_path (str) – Path to the directory containing the dataset files.

  • data_scale (str | None) – Scaling string or None for auto-scaling.

  • data_filter (str | None) – Filter to apply when loading records.

  • window_size (int) – Size of the sliding window to apply on the input sequences.

  • window_offset (int) – Sliding window offset.

  • fps_scaling (float) – FPS scaling factor.

  • batch_size (int) – Batch size for inference.

  • select_coords (str | None) – Optional subset string in the format ‘INDIVIDUALS;AXES;KEYPOINTS’.

  • rename_coords (str | None) – Optional coordinate names remapping in the format ‘INDIVIDUALS;AXES;KEYPOINTS’.

  • mode (str) – Evaluation mode: ‘multiclass’ or ‘multilabel’.

  • output_path (str | None) – If given, the evaluation report will be saved as a YAML file in this directory.

  • ignore_index (int | None) – Index to ignore in the evaluation metrics (e.g., background class).

  • threshold (float) – Threshold for multilabel binarization.

Returns:

Evaluation report with metrics.

Return type:

dict