masora1030 / CVPR2023-FDSL-on-VisualAtom

MIT License
12 stars 2 forks source link

About detection/segmentation evaluation #4

Open tomoki87 opened 7 months ago

tomoki87 commented 7 months ago

@masora1030

Thank you for answering my question in another issue. I would like to reproduce the experiment of detection/segmentation using the COCO dataset described in the paper. Would it be possible for you to provide me with the git repository and the procedure you referred to when you did this evaluation? Thank you.

別issueでも私の疑問にご回答いただきありがとうございます。 論文記載のCOCOデータセットを使ったdetection/segmententationの実験を再現したいと考えています。 こちらの評価をされた際に参照したgitリポジトリと手順を教えていただけくことは可能でしょうか? よろしくお願いいたします。

image

masora1030 commented 6 months ago

@tomoki87

Sorry for my delay in replying. For the detection/segmentation experiments, we are using Swin-Transformer-Object-Detection, an official implementation of SwinTransformer, which was created based on mmdetection.

We used swin_base_patch4_window7 (by timm) pre-trained in the Classification task as the backbone model, while Fine-Tuning with an object detection script that uses R-CNN as the Head. After properly including dependent libraries and environment modules and setting up the configuration on the config file, we used the following command and run tools/train.py.

mpiexec --hostfile . /hostfile -np ${NHOSTS} python -B tools/train.py \
configs/swin/mask_rcnn_swin_base_patch4_window7_mstrain_480-800_adamw_5x_coco.py 16 \
--work-dir=${WORD_DIR_PATH} }
--cfg-options model.pretrained=${PRETRAINED_MODEL_PATH} model.backbone.use_checkpoint=True data.samples_per_gpu=2 \
--seed=0 \
--deterministic \
--launcher=mpi \
--host=${HOST}

For the Fine-Tuning experiment, we used 4 nodes of V100x4 for a total of 16 GPUs for the calculation. In the above script, the local batch size is 2, so the global batch size is 32.

For details on how to set up the config file, please refer to Swin-Transformer-Object-Detection and follow the description in the library.

ご返信遅れて申し訳ありません。 detection/segmentationの実験には、mmdetectionをベースに作成された、SwinTransformerの公式実装であるSwin-Transformer-Object-Detectionを用いています。

swin_base_patch4_window7(timmにあるアーキテクチャ)をClassificationのタスクで事前学習させたものをバックボーンモデルとしつつ、R-CNNをHeadとして併用した物体検知スクリプトでFine-Tuningをしています。 具体的には、依存するライブラリや環境モジュールを適切に含め、コンフィグファイル上の設定記述を行った上で、以下のようなコマンドを使用してtools/train.pyを実行しています。

mpiexec --hostfile ./hostfile -np ${NHOSTS} python -B tools/train.py \
configs/swin/mask_rcnn_swin_base_patch4_window7_mstrain_480-800_adamw_5x_coco.py 16 \
--work-dir=${WORD_DIR_PATH} \
--cfg-options model.pretrained=${PRETRAINED_MODEL_PATH} model.backbone.use_checkpoint=True data.samples_per_gpu=2 \
--seed=0 \
--deterministic \
--launcher=mpi \
--host=${HOST}

Fine-Tuning実験時には、V100の4GPUノードを4つで、合計16GPU(上記スクリプトではlocal batch sizeが2なので、global batch sizeは32となります)の資源を用いて計算を行いました。

コンフィグファイルの詳細な設定方法などは、Swin-Transformer-Object-Detectionライブラリ内の記述に従っていただければ幸いです。

tomoki87 commented 3 months ago

@masora1030

Sorry for the late reply. I was even able to run the detection code using the repository you provided.

I have one request. I would like to use the mask_rcnn_swin_base_patch4_window7_mstrain_480-800_adamw_5x_coco.py configuration file, but I couldn't find it in the Swin-Transformer-Object-Detection repository. Is it possible for you to share this file with me?

We would also like to be able to reproduce the segmentation experiment. Would it be possible to share with us the git repository you referred to in your evaluation and the procedure you followed? Thank you in advance.

返信が遅くなり申し訳ありません。 教えていただいたリポジトリを使用して、detectionのコードを実行することまでできました。

一点お願いさせていただきたい事項がございます。configで使用されているmask_rcnn_swin_base_patch4_window7_mstrain_480-800_adamw_5x_coco.pyを利用したいのですが、Swin-Transformer-Object-Detection上で見つけることができませんでした。こちらのファイルを共有いただくことは可能でしょうか?

また、segmententationの実験も再現できればと考えております。 評価をされた際に参照したgitリポジトリと手順を教えていただけくことは可能でしょうか? よろしくお願いいたします。