Shortcuts

mmcls.core

This package includes some runtime components. These components are useful in classification tasks but not supported by MMCV yet.

Note

Some components may be moved to MMCV in the future.

Evaluation

Evaluation metrics calculation functions

precision

Calculate precision according to the prediction and target.

recall

Calculate recall according to the prediction and target.

f1_score

Calculate F1 score according to the prediction and target.

precision_recall_f1

Calculate precision, recall and f1 score according to the prediction and target.

average_precision

Calculate the average precision for a single class.

mAP

Calculate the mean average precision with respect of classes.

support

Calculate the total number of occurrences of each label according to the prediction and target.

average_performance

Calculate CP, CR, CF1, OP, OR, OF1, where C stands for per-class average, O stands for overall average, P stands for precision, R stands for recall and F1 stands for F1-score.

calculate_confusion_matrix

Calculate confusion matrix according to the prediction and target.

Hook

ClassNumCheckHook

PreciseBNHook

Precise BN hook.

CosineAnnealingCooldownLrUpdaterHook

Cosine annealing learning rate scheduler with cooldown.

Optimizers

Lamb

A pure pytorch variant of FuseLAMB (NvLamb variant) optimizer.