Skip to content

naokiwakata/detectron2_for_windows

Repository files navigation

Detectron2をWindowsで動かす(植物の検出)

Detectron2とは

https://github.com/facebookresearch/detectron2

Detectron2とはFacebook AIが開発した、PyTorchベースの物体検出のライブラリです。 様々なモデルとそのPre-Trainedモデルが実装されており、下記のように、Bounding boxやInstance Segmentation等の物体検出を簡単に実装することができます。

流れ

  1. データセットの収集(coco-anotatorでアノテーションを行う)
  2. 学習(GoogleColaboratory上で学習し,学習モデル(pthファイル)を保存)
  3. 検証(GoogleColaboratory上で上手くいくか検証)
  4. 保存した学習モデルをWindows上で動かす。
参考記事

detectron2をWindwos上で動かすための環境構築

How to Install Detectron2 on Windows 10 or 11 –2021(AUG) with the latest build(v0.5).

こちらの記事を参考にWindowsでdetectron2を動かす

conda info
  • 記事のCUDAインストールはスキップ(GPUを使用しないため)

  • conda環境を作る

conda create -n detectron2(名前はなんでもok) python=3.7
  • conda環境に移動
conda activate detectron2
  • PyTorchをインストール(バージョンは変えない方が良いかも。以下のバージョンを僕は入れました)
pip install torch==1.10.0
pip install torchaudio==0.10.0
pip install torchvision==0.11.1
pip install cython
pip install “git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"
  • OpenCVをインストール
pip install opencv-python
  • detectron2_for_windowsをclone
git clone https://github.com/naokiwakata/detectron2_for_local.git
  • 作業フォルダをdetectron2-windowsに移動
cd detectron2-windows
  • detectron2をclone(detectron2がcloneされていればスキップ)
git clone https://github.com/facebookresearch/detectron2.git

もしくは自分のリポジトリにforkしてきたdetectron2をclone

git clone https://github.com/naokiwakata/detectron2.git
python -m pip install -e detectron2

これで動かせるはず!!!!

About

ローカル環境でdetectron2を動かす

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages