This program aims to detect wildlife from camera trap images using MegaDetector (Beery et al. 2019) and to extract images in which animals were detected. This document is a minimal description and will be updated as needed.
このプログラムは、MegaDetector (Beery et al. 2019)を利用してカメラトラップ映像から野生動物を検出し、動物が検出された画像を抽出することを目的として作成されました。このドキュメントは現時点では最低限の記述しかされていないため、今後随時更新していく予定です。
OS
The following code was tested on Windows 10 Pro.
During the test run, .jpg as the image file format.
以下のコードはWindows 10 Proで動作確認しています。
動作確認時、静止画ファイル形式は.jpgを用いました。NVIDIA Driver(if you use gpu) NVIDAドライバーをインストールする
Please refer to NVIDIA Driver Version Check. *** is a placeholder. Please enter the recommended nvidia driver version.
NVIDIAドライババージョンチェックを参照し、***に推奨されるnvidiaドライババージョンを入力した上で実行してください。Check installation.
インストール状況の確認。nvidia-smi # NVIDIA Driver installation checkIf nvidia-smi does not work, Try Rebooting.
nvidia-smiコマンドが動作しない場合は再起動してみてください。
Auto Installation download mdet_setup.py
python mdet_setup.pyIf auto installation fail, run berow step.
OR
Clone the Repository:リポジトリの複製
Run
git clone,git cloneを実行するor Download ZIP and Unzip in any directory of yours. The following codes are assumed that it was extracted to the user's home directory (
/home/${USER}/).
もしくはZIPをダウンロードし、任意のディレクトリで解凍してください。なお、このページではユーザのホームディレクトリ(/home/${USER}/)に解凍した前提でスクリプトを記載しています。Move Project Directory:プロジェクトディレクトリへ移動
cd {ImageExtractWinのパス} 例 cd project\ImageExtractWin-master python make_batch_gui.pyinstall miniconda(anaconda) : miniconda(anaconda)をインストール
https://docs.conda.io/projects/miniconda/en/latest/
condaのパスを通す Pass through the path of conda システム環境変数の編集->環境変数->PATH->新規->condaのpathをコピペ(例 C:\Users{ユーザー名}\miniconda3\condabin) Edit System Environment Variables->Environment Variables->PATH->New->copy and paste the path for conda (e.g. C:\Users{user name}\miniconda3\condabin)
create conda environment:conda環境の構築
conda env create -f environment.ymlIf you use gpu, visit the following site and install the matching version gpuを使う場合、以下のサイトを見てバージョンを合わせたものをインストールする
CUDA Toolkit 12.3 Downloads https://developer.nvidia.com/cuda-downloads
Installation of cudnn (login required) cudnnのインストール(ログインが必要) https://developer.nvidia.com/rdp/cudnn-download
pip uninstall torch torchvision torchaudio pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
1.Click on the Detect_gui shortcut on the Desktop
デスクトップにあるDetect_guiのショートカットをクリックする
2.Select a folder with images in browse, and click
browseで画像があるフォルダを選択,
3.Select detection model,
検出モデルの選択,
4.Start
開始
threshold:検出の閾値 ;
skip:既にファイルがある場合スキップする ;
differential reasoning:前の画像と同じ位置のanimalの検出をblankに変換する
