1
1

More than 3 years have passed since last update.

Detectron2のv0.5アップデート内容まとめ

Posted at

画像認識や画像検出でよく利用されるプラットフォームであるDetectron2のアップデートがありました。

7/24にアップデートされた内容を確認して変更点のまとめと、気になった箇所を深掘りしました。

Detectron2そのものについては次の記事を参照ください。

変更点まとめ

  • LazyConfigシステムを追加
  • Mask R-CNNベースラインを追加
  • mmdetectionのモデルにバックボーンラッパーとディテクターラッパーを追加
  • Implicit PointRend & PointSupのコードを公開
  • BatchNormのRethinking Batchのコードをリリース
  • BatchNormのRethinking Batchのコードをリリース
  • RegNetバックボーンのサポートを追加
  • DensePose CSEの新機能:詳細はリリースノート

以下の環境でビルド済みのLinuxバイナリが利用できます。

CUDA torch 1.9 torch 1.8 torch 1.7
11.1 install install
11.0 install
10.2 install install install
10.1 install install
9.2 install
cpu install install install

LazyConfigシステムを追加

従来のyacsベースのコンフィグシステムからLazyConfigシステムに対応したことで、柔軟性が大幅に向上しました。

Detectron2での公式サンプルは以下のようになっています。

# config.py:
a = dict(x=1, y=2, z=dict(xx=1))
b = dict(x=3, y=4)

# my_code.py:
from detectron2.config import LazyConfig
cfg = LazyConfig.load("path/to/config.py")  # an omegaconf dictionary
assert cfg.a.z.xx == 1

他にも実装時に参考になるサンプルがGitHubに公開されています。

# Common training-related configs that are designed for "tools/lazyconfig_train_net.py"
# You can use your own instead, together with your own train_net.py
train = dict(
    output_dir="./output",
    init_checkpoint="detectron2://ImageNetPretrained/MSRA/R-50.pkl",
    max_iter=90000,
    amp=dict(enabled=False),  # options for Automatic Mixed Precision
    ddp=dict(  # options for DistributedDataParallel
        broadcast_buffers=False,
        find_unused_parameters=False,
        fp16_compression=False,
    ),
    checkpointer=dict(period=5000, max_to_keep=100),  # options for PeriodicCheckpointer
    eval_period=5000,
    log_period=20,
    device="cuda"
    # ...
)

LazyConfigそのものについては以下を参照して下さい。

Mask R-CNNベースラインを追加

新しいベースラインはEpochsの増加によりAPが向上しています。
Mask R-CNN ResNet-50-FPN Box AP メトリックは、41から 46.7(ImageNet の初期化を使用)、47.4(ランダムな初期化を使用)に増加しました。

新しくDetectron2を動かす際は、Model Zooから最新のベースラインを使うことで精度向上が期待できます。

baseline

mmdetection

mmdetectionが追加されたことで、さらに多くの事前学習済みのモデルを使用して画像検出等のタスクを実行できるようになりました。

MMDetecitonについて

MMDetectionは、Model Zooで何百もの既存・在来の検出モデルを提供し、Pascal VOC、COCO、CityScapes、LVISなどの複数の標準データセットをサポートしています。これらの既存モデルや標準データセットに対して、以下のようなタスクを実行できます。

  • 既存のモデルを使って、与えられた画像を推論する。
  • 標準的なデータセットで既存のモデルをテストする。
  • 標準的なデータセットで定義済みモデルを学習する

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1