RolnickLab / ami-ml

Software, algorithms and documentation related to the Automated Monitoring of Insects using deep learning and other machine learning methods.
MIT License
1 stars 1 forks source link

ML for Automated Monitoring of Insects

Software, algorithms and research related to the Automated Monitoring of Insects using deep learning and other machine learning methods.

Monitoring station deployment in field Emerald moths detected in processed images Monitoring station deployment in field Monitoring station deployment in field

Setup

Poetry is used to manage the dependencies common to all scripts and sub-projects. Some sub-projects may manage their own dependencies if necessary.

  1. Install Poetry
  2. Clone this repository
  3. Create a .env or copy .env.example and update the values
  4. Run poetry install in the root of the repository
  5. Install pre-commit hooks poetry run pre-commit install

[Optional] Conda + Poetry

An optional way to setup the environment is to use Conda for creating and managing the environment, while using Poetry for managing the packages and dependencies. Run the following steps to setup:

  1. Install Conda
  2. Create conda environment using the environment.yml: conda env create -f environment.yml
  3. Activate the conda environment: conda activate ami-ml
  4. Install packages in the root of the repository using Poetry: poetry install

Usage

Activate the virtual environment before running scripts

poetry shell

Example for running a script (in the poetry shell):

python src/localization/inference_localization.py \
  --data_dir ~/TRAPIMAGES/Sample/ \
  --ckpt_path ~/Downloads/fasterrcnn_mobilenet_v3_large_fpn_uqfh7u9w.pt \
  --model_type fasterrcnn_mobilenet_v3_large_fpn

Alternatively, one can run the scripts without activating poetry's shell:

 poetry run python <script>