MultiTaskHead¶
- class mmpretrain.models.heads.MultiTaskHead(task_heads, init_cfg=None, **kwargs)[source]¶
Multi task head.
- Parameters:
- loss(feats, data_samples, **kwargs)[source]¶
Calculate losses from the classification score.
- Parameters:
feats (tuple[Tensor]) – The features extracted from the backbone.
data_samples (List[MultiTaskDataSample]) – The annotation data of every samples.
**kwargs – Other keyword arguments to forward the loss module.
- Returns:
- a dictionary of loss components, each task loss
key will be prefixed by the task_name like “task1_loss”
- Return type:
- predict(feats, data_samples=None)[source]¶
Inference without augmentation.
- Parameters:
feats (tuple[Tensor]) – The features extracted from the backbone.
data_samples (List[MultiTaskDataSample], optional) – The annotation data of every samples. If not None, set
pred_label
of the input data samples. Defaults to None.
- Returns:
A list of data samples which contains the predicted results.
- Return type:
List[MultiTaskDataSample]