open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.66k stars 9.47k forks source link

运行AutoAugment类中example示例代码报错 #7248

Open vansin opened 2 years ago

vansin commented 2 years ago

背景:想通过代码链接链接文档中的example学习以下mmdet中的auto_augment

image

测试python程序如下


import mmdet.datasets.pipelines.auto_augment

from mmdet.datasets.pipelines import AutoAugment

import numpy as np

replace = (104, 116, 124)
policies = [
    [
        dict(type='Sharpness', prob=0.0, level=8),
        dict(
            type='Shear',
            prob=0.4,
            level=0,
            replace=replace,
            axis='x')
    ],
    [
        dict(
            type='Rotate',
            prob=0.6,
            level=10,
            replace=replace),
        dict(type='Color', prob=1.0, level=6)
    ]
]
augmentation = AutoAugment(policies)
img = np.ones(100, 100, 3)
gt_bboxes = np.ones(10, 4)
results = dict(img=img, gt_bboxes=gt_bboxes)
results = augmentation(results)

问题描述如下:

  1. Sharpness在mmdet中好像未实现(KeyError: 'Sharpness is not in the pipeline registry')
  2. 如下图片的replace=replace是什么意思呢,也报错了(TypeError: Shear: init() got an unexpected keyword argument 'replace')

image

环境信息

ubuntu 20.04 mmdet 2.21.0

ZwwWayne commented 2 years ago

AutoAugment is not fully supported for now, community helps are welcomed.