CutLER のインストールと動作確認を行う.
MaskCut は,画像から,複数のセグメンテーション・マスク (segmentation mask)を得る.ViT を使用
CutLER は,MaskCut の結果に対して物体検出を実行.自己学習 (self-training) を使用.
【目次】
【文献】
Wang, Xudong and Girdhar, Rohit and Yu, Stella X and Misra, Ishan, Cut and Learn for Unsupervised Object Detection and Instance Segmentation, arXiv preprint arXiv:2301.11320, 2023.
【関連する外部ページ】
Windows での Git のインストール: 別ページ »で説明
【関連する外部ページ】
Git の公式ページ: https://git-scm.com/
cmake のダウンロードのページ https://cmake.org/download/ からダウンロードしてインストール
Windows での Python 3.10,関連パッケージ,Python 開発環境のインストール: 別ページ »で説明
【サイト内の関連ページ】
Python のまとめ: 別ページ »にまとめ
【関連する外部ページ】
Python の公式ページ: https://www.python.org/
Windows での Build Tools for Visual Studio 2022,NVIDIA ドライバ,NVIDIA CUDA ツールキット 11.8,NVIDIA cuDNN v8.6 のインストールと動作確認: 別ページ »で説明
【関連する外部ページ】
コマンドプロンプトを管理者として実行: 別ページ »で説明
PyTorch のページ: https://pytorch.org/index.html
次のコマンドは, PyTorch 2.0 (NVIDIA CUDA 11.8 用) をインストールする. 事前に NVIDIA CUDA のバージョンを確認しておくこと(ここでは,NVIDIA CUDA ツールキット 11.8 が前もってインストール済みであるとする).
python -m pip install -U pip python -m pip install -U torch torchvision torchaudio numpy numba --index-url https://download.pytorch.org/whl/cu118 python -c "import torch; print(torch.__version__, torch.cuda.is_available())"
コマンドプロンプトを管理者として実行: 別ページ »で説明
※ 「pip install ...」は,Python パッケージをインストールするための操作
python -m pip install -U opencv-python opencv-contrib-python
次の記事に記載の手順による.
https://dgmaxime.medium.com/how-to-easily-install-detectron2-on-windows-10-39186139101c
コマンドプロンプトを管理者として実行: 別ページ »で説明
python -m pip install cython
python -m pip install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"
https://github.com/DGMaxime/detectron2-windows を使用している.
python -m pip uninstall detectron2 cd %HOMEPATH% rmdir /s /q detectron2-windows git clone --recursive https://github.com/DGMaxime/detectron2-windows.git cd detectron2-windows python -m pip install -e . python tests\test_windows_install.py
結果が,次のように表示される.
pip install git+https://github.com/cocodataset/panopticapi.git pip install git+https://github.com/mcordts/cityscapesScripts.git
コマンドプロンプトを管理者として実行: 別ページ »で説明
次のコマンドを実行.
python -m pip install git+https://github.com/lucasb-eyer/pydensecrf.git
次のコマンドを実行.
cd %HOMEPATH% rmdir /s /q CutLER git clone --recursive https://github.com/facebookresearch/CutLER.git cd CutLER python -m pip install -U faiss_cpu python -m pip install -U opencv-python scikit-image scikit-learn shapely timm pyyaml colored fvcore gdown
demo.jpg ができる.
cd %HOMEPATH% cd CutLER cd maskcut python demo.py --img-path imgs/demo2.jpg --N 3 --tau 0.15 --vit-arch base --patch-size 8 --cpu --out-dir .