Skip to content

RolnickLab/ami-ml

Repository files navigation

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

uv is used to manage the dependencies common to all scripts and sub-projects. uv is a fast, modern Python package manager.

  1. Install uv
    # On macOS and Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # On Windows
    powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
  2. Clone this repository
  3. Create a .env or copy .env.example and update the values
  4. Install dependencies in the root of the repository (--extra dev adds the development tools, including pre-commit):
    uv sync --extra dev
  5. Install pre-commit hooks:
    uv run pre-commit install

[Optional] Conda + uv

An optional way to setup the environment is to use Conda for creating and managing the Python environment, while using uv for managing the packages and dependencies.

  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 uv: uv sync

Usage

Activate the virtual environment before running scripts

source .venv/bin/activate     # On Linux/macOS
# or, on Windows PowerShell
.\.venv\Scripts\Activate.ps1

Example for running a script (in the activated environment):

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 scripts without activating the environment:

uv run python <script>

uv run automatically uses the project's virtual environment, so there is no need to activate it first.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors