LoginSignup
1
0

More than 1 year has passed since last update.

mmdetectionでalbumentationsを使う

Posted at

概要

  1. 前提
  2. ここにすべてある
  3. 解説
  4. 拡張結果の確認

前提

albumentationsをインストールしてあることである
albumentaionsのgithubにあるinstallationを参考にインストールするのが手っ取り早い

ここにすべてがある

albumentaionsを適用したmmdetection公式のconfigファイルである.
これがすべてである.
https://github.com/open-mmlab/mmdetection/blob/master/configs/albu_example/mask_rcnn_r50_fpn_albu_1x_coco.py

解説

train_pipeline 変数内にtype='albu' となっている場所があり,albumentationsを適用するためのコードが書いてある.
これはそのままパクれば良さそうである.

実際にalbumentaionsのどの関数を使うのかはalbu_train_transforms に書かれている.
albu_train_transforms はtypeに適用したい関数名,他の変数にその関数の実引数が書かれている.

albumentationsのAPIリファレンスを参考にしよう.
デモページでは,どんな風に拡張されるのか,確認できる.ぜひ使っておきたい.

拡張結果の確認

自分の思い通りに拡張されているか確認したいときは以下のコマンドで確認できる.

$ python tools/misc/browse_dataset.py your/config/file/path

SSHしていてX転送できないなど,GUI環境が使えないときは以下のようにする.
check_aug_resディレクトリに拡張された結果が格納されている.

$ python tools/misc/browse_dataset.py your/config/file/path --output-dir check_aug_res --not-show
1
0
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
0