Skip to content

yodaka0/VideoExtractWin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VideoExtractWin

What's this:このプログラムについて

This program aims to detect wildlife from camera trap images using MegaDetector (Beery et al. 2019) and to extract videos in which animals were detected. This document is a minimal description and will be updated as needed.
このプログラムは、MegaDetector (Beery et al. 2019)を利用してカメラトラップ映像から野生動物を検出し、動物が検出された動画を抽出することを目的として作成されました。このドキュメントは現時点では最低限の記述しかされていないため、今後随時更新していく予定です。


Get Started:はじめに


Prerequisites:環境整備

  • OS
    The following code was tested on Windows 10 Pro.
    During the test run, .jpg as the image file format.
    以下のコードはWindows 10 Proで動作確認しています。
    動作確認時、動画ファイル形式は.mp4を用いました。

  • NVIDIA Driver 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 check
    
      If nvidia-smi does not work, Try Rebooting.  
      nvidia-smiコマンドが動作しない場合は再起動してみてください。
    
  • Conda

    Download installer and run the script.
    インストーラーをダウンロードしてスクリプトを実行します。

    condaのパスを通す システム環境変数の編集->環境変数->PATH->新規->condaのpathをコピペ


Instllation:インストール

  1. 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}/)に解凍した前提でスクリプトを記載しています。

  2. Move Project Directory:プロジェクトディレクトリへ移動

    cd {VideExtractWinのパス}
    
  3. create conda environment:conda環境の構築

    conda env create -f environment.yml
    conda activate pwlife
    
  4. 以下のサイトを見てバージョンを合わせたものをインストールする CUDA Toolkit 11.3 Downloads https://developer.nvidia.com/cuda-11.3.0-download-archive

    cudnnのインストール(ログインが必要) https://developer.nvidia.com/rdp/cudnn-download

  5. バージョン管理

    pip uninstall torch torchvision torchaudio
    pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
    


Usage:使い方


  1. ディレクトリの移動

    cd {VideoExtractWinのパス}
    
  2. conda環境のアクティベート

    conda activate pwlife
    
  3. gpuが使えるか確認

    python gpu_check.py
    
  4. Run MegaDetector
    MegaDetectorの実行

    python exec_mdet.py session_root={カメラデータが入ったフォルダ} threshold={検出の閾値}
    

    thresholdは省略可(デフォルトは0.2) {カメラデータが入ったフォルダ}_outにcsvファイルとjsonファイルが保存される

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages