tlc.integration.super_gradients.callbacks.pose_callback
¶
Callback for collecting predictions from SuperGradients detection models.
Module Contents¶
Classes¶
Class |
Description |
---|---|
Callback for collecting predictions from SuperGradients pose estimation models. |
API¶
- class PoseEstimationMetricsCollectionCallback(
- project_name: str | None = None,
- run_name: str | None = None,
- run_description: str | None = None,
- image_column_name: str = 'image',
- label_column_name: str | None = None,
- metrics_collection_epochs: list[int] | None = None,
- collect_metrics_on_train_end: bool = True,
- collect_val_only: bool = False,
- batch_size: int | None = 32,
- pipeline_params: PipelineParams | dict[str, Any] | None = None,
- collect_predictions: bool | None = None,
- collect_embeddings: bool = False,
- embeddings_dim: int = 2,
- embeddings_method: Literal[pacmap, umap] = 'pacmap',
- inference_chunk_size: int = 5000,
Bases:
tlc.integration.super_gradients.callbacks.base_callback.MetricsCollectionCallback
Callback for collecting predictions from SuperGradients pose estimation models.
Create a new metrics collection callback.
- Parameters:
project_name – The name of the 3LC project to use if no active run exists.
run_name – The name of the 3LC run to use if no active run exists.
run_description – The description of the 3LC run to use if no active run exists.
image_column_name – The name of the column in the table that contains the images.
label_column_name – The name of the column in the table that contains the labels. If not provided, a task-specific default will be used.
metrics_collection_epochs – The zero-indexed epochs after which to collect metrics.
collect_metrics_on_train_end – Whether to collect metrics after training finishes.
collect_val_only – Whether to collect metrics only on the validation set.
metrics_collection_dataloader_args – Additional arguments to pass to the dataloaders used for metrics collection.
batch_size – The batch size to use for metrics collection.
pipeline_params – The pipeline parameters to use for metrics collection. Can be provided as a PipelineParams instance, a dictionary, or None (default) which will use a default PipelineParams instance.
collect_predictions – Whether to collect predictions. Default is None, which means predictions will be logged for all task-specific subclasses if not explicitly set to False. On using the base callback, no predictions will be logged by default.
collect_embeddings – Whether to collect embeddings. Is only applied if the model has a backbone attribute (Yolo-NAS models have this). Default is False because embeddings collection performs additional inference and therefore spends additional time.
embeddings_dim – The dimensionality to reduce the embeddings to, default is 2. 2 or 3 are recommended.
embeddings_method – The method to use for reducing the embeddings.
inference_chunk_size – SuperGradients
Pipeline
s load all images in memory at once. This parameter effectively controls how many images to load in memory at once, and how many rows each metrics table will contain.
- compute_metrics(
- images: list[str],
- predictions: super_gradients.training.utils.predict.prediction_pose_estimation_results.ImagesPoseEstimationPrediction | super_gradients.training.utils.predict.prediction_pose_estimation_results.ImagePoseEstimationPrediction,
- table: Table,
Compute metrics from a batch of data and corresponding predictions.