open-mmlab / mmaction2

OpenMMLab's Next Generation Video Understanding Toolbox and Benchmark
https://mmaction2.readthedocs.io
Apache License 2.0
4.21k stars 1.23k forks source link

UPDATE ConfusionMatrix support multimodal predicts #2817

Open HoBeom opened 5 months ago

HoBeom commented 5 months ago

Motivation

2815

Modification

acc_metric.py/class ConfusionMatrix

BC-breaking (Optional)

.

Use cases (Optional)

.

Checklist

  1. Pre-commit or other linting tools should be used to fix the potential lint issues. ✅
  2. The modification should be covered by complete unit tests. If not, please add more unit tests to ensure the correctness. ❎
  3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMCls. ⛔︎
  4. The documentation should be modified accordingly, like docstring or example tutorials. ⛔︎
HoBeom commented 5 months ago

Also I got error in RGBPoseHead in training on last batch with less then batch size.

https://github.com/open-mmlab/mmaction2/blob/4d6c93474730cad2f25e51109adcf96824efc7a3/mmaction/models/heads/rgbpose_head.py#L117-L118

can be changed as follows to check the size correctly.

        elif labels.dim() == 1 and labels.size()[0] == self.num_classes \
                and cls_scores[self.loss_components[0]].size()[0] == 1: