Skip to content

WildDetect is a powerful wildlife detection and census system for aerial imagery. It helps conservationists, researchers, and organizations analyze wildlife populations, generate geographic visualizations, and produce actionable reportsβ€”all with easy-to-use command-line tools.

Notifications You must be signed in to change notification settings

FadelMamar/wildetect

Repository files navigation

WildDetect

WildDetect Monorepo

A complete ecosystem for wildlife monitoring and conservation using aerial imagery.

WildDetect is an integrated monorepo containing three specialized packages for the entire wildlife detection workflowβ€”from data management to model training and deployment.

πŸ“¦ Packages

πŸ—‚οΈ WilData - Data Management

Unified data pipeline for dataset management and preparation.

  • Multi-format import/export (COCO, YOLO, Label Studio)
  • Data transformations (tiling, augmentation, clipping)
  • ROI dataset creation for classification
  • DVC integration for version control
  • REST API for programmatic access

πŸ“– WilData Documentation

πŸŽ“ WildTrain - Model Training

Modular training framework for detection and classification models.

  • YOLO and MMDetection support
  • PyTorch Lightning for classification
  • MLflow experiment tracking
  • Hyperparameter optimization (Optuna)
  • Model registration and versioning

πŸ“– WildTrain Documentation

πŸ” WildDetect - Detection & Analysis

Production-ready detection system with census capabilities.

  • Multi-threaded detection pipelines
  • Large raster image support (GeoTIFF)
  • Census campaign orchestration
  • Geographic analysis and visualization
  • FiftyOne integration
  • Comprehensive reporting (JSON, CSV, PDF)

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/fadelmamar/wildetect.git
cd wildetect

# Create virtual environment
uv venv --python 3.10
.venv\Scripts\activate  # Windows

# Install all packages
cd wildata && uv pip install -e . && cd ..
cd wildtrain && uv pip install -e . && cd ..
uv pip install -e .

πŸ“– Full Installation Guide

Quick Detection

# Run detection
wildetect detect /path/to/images --model model.pt --output results/

# Run census campaign
wildetect census campaign_2024 /path/to/images --model model.pt --output campaign_results/

πŸ“– Quick Start Guide


πŸ“š Documentation

Complete documentation is available at: WildDetect Documentation

Getting Started

Architecture

Tutorials

Reference

Support


🎯 Main Features

Detection & Analysis

  • Multi-species detection optimized for aerial imagery
  • Batch processing of large datasets
  • Raster detection for GeoTIFF files
  • Multi-threaded pipelines for performance

Data Management

  • Import from COCO, YOLO, Label Studio
  • Data transformations (tiling, augmentation)
  • ROI extraction for classification
  • DVC integration for versioning

Model Training

  • YOLO and MMDetection frameworks
  • PyTorch Lightning for classification
  • MLflow experiment tracking
  • Hyperparameter optimization

Geographic Analysis

  • GPS metadata extraction and management
  • Flight path analysis and coverage maps
  • Population density calculations
  • Interactive visualizations with FiftyOne

Census Capabilities

  • Full census campaign orchestration
  • Species counting and statistics
  • Distribution analysis
  • Comprehensive PDF reports

πŸ”§ Main CLI Commands

WildDetect

wildetect detect      # Run wildlife detection
wildetect census      # Census campaign
wildetect analyze     # Analyze results
wildetect visualize   # Create visualizations
wildetect fiftyone    # Launch FiftyOne viewer
wildetect ui          # Launch web interface

WilData

wildata import-dataset    # Import dataset
wildata dataset list      # List datasets
wildata dataset export    # Export dataset
wildata create-roi        # Create ROI dataset
wildata visualize-dataset # Visualize data

WildTrain

wildtrain train classifier  # Train classification model
wildtrain train detector    # Train detection model
wildtrain eval classifier   # Evaluate model
wildtrain register         # Register to MLflow

For all options:

wildetect --help
wildata --help
wildtrain --help

🐾 WildDetect Command-Line Interface (CLI)

WildDetect provides a powerful and flexible command-line interface (CLI) built with Typer, making it easy to run wildlife detection, census campaigns, analysis, visualization, and moreβ€”all from your terminal.

How to Use

After installing WildDetect, simply run:

wildetect [COMMAND] [OPTIONS]

You can always see all available commands and options with:

wildetect --help

Main Commands

  • detect
    Run wildlife detection on images or directories of images.

    wildetect detect /path/to/images --model model.pt --output results/

    Options include model type, confidence threshold, device (CPU/GPU), batch size, tiling, and more.

  • census
    Orchestrate a full wildlife census campaign, including detection, statistics, and reporting.

    wildetect census campaign_2024 /path/to/images --model model.pt --output campaign_results/

    Supports campaign metadata, pilot info, target species, and advanced analysis.

  • analyze
    Analyze detection results for statistics and insights.

    wildetect analyze results.json --output analysis/
  • visualize
    Create interactive geographic maps and visualizations from detection results.

    wildetect visualize results.json --output maps/
  • info
    Display system and environment information, including dependencies and hardware support.

    wildetect info
  • ui
    Launch the WildDetect web interface (Streamlit-based) for interactive exploration.

    wildetect ui
  • fiftyone
    Manage FiftyOne datasets: launch the app, get info, or export data.

    wildetect fiftyone --action launch
    wildetect fiftyone --action info --dataset my_dataset
    wildetect fiftyone --action export --format coco --output export_dir/
  • clear-results
    Delete all detection results in a specified directory (with confirmation).

General CLI Features

  • Rich Output: Uses rich for beautiful tables, progress bars, and colored logs.
  • Flexible Input: Accepts both individual image files and directories.
  • Advanced Options: Fine-tune detection, tiling, device selection, and more.
  • Batch Processing: Efficiently processes large datasets.
  • Integration: Seamless export to FiftyOne, JSON, and CSV formats.
  • Help for Every Command: Use wildetect [COMMAND] --help for detailed options.

πŸ“ Repository Structure

wildetect/                    # Monorepo root
β”œβ”€β”€ wildata/                  # Data management package
β”‚   β”œβ”€β”€ src/wildata/
β”‚   β”œβ”€β”€ configs/
β”‚   β”œβ”€β”€ scripts/
β”‚   └── tests/
β”œβ”€β”€ wildtrain/                # Training framework package
β”‚   β”œβ”€β”€ src/wildtrain/
β”‚   β”œβ”€β”€ configs/
β”‚   β”œβ”€β”€ scripts/
β”‚   └── tests/
β”œβ”€β”€ src/wildetect/            # Detection package
β”‚   β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ cli/
β”‚   β”œβ”€β”€ api/
β”‚   └── ui/
β”œβ”€β”€ config/                   # WildDetect configurations
β”œβ”€β”€ scripts/                  # Batch scripts
β”œβ”€β”€ docs/                     # Documentation
└── tests/                    # Tests

πŸ”„ Common Workflows

Detection Workflow

# 1. Run detection
wildetect detect images/ --model model.pt --output results/

# 2. View in FiftyOne
wildetect fiftyone --action launch

# 3. Analyze results
wildetect analyze results/detections.json

Data Preparation Workflow

# 1. Import dataset
cd wildata
wildata import-dataset annotations.json --format coco --name dataset

# 2. Apply transformations (tiling)
# (configured in import config)

# 3. Export for training
wildata dataset export dataset --format yolo

Training Workflow

# 1. Train model
cd wildtrain
wildtrain train detector -c configs/detection/yolo.yaml

# 2. Evaluate
wildtrain eval detector -c configs/detection/yolo_eval.yaml

# 3. Register to MLflow
wildtrain register detector config/registration.yaml

Census Workflow

# 1. Configure census (edit config/census.yaml)

# 2. Run census
wildetect census campaign_2024 images/ -c config/census.yaml

# 3. View report
# Open census_results/report.pdf

🌟 Key Technologies

  • Python 3.9+ - Primary language
  • PyTorch - Deep learning framework
  • YOLO / MMDetection - Object detection
  • PyTorch Lightning - Training framework
  • MLflow - Experiment tracking
  • FiftyOne - Dataset visualization
  • FastAPI - REST API
  • Streamlit - Web interfaces
  • DVC - Data versioning
  • Hydra - Configuration management
  • Typer - CLI interfaces

🀝 Contributing

Contributions are welcome! This is an open-source project for the conservation community.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please ensure:

  • Code follows project style (use ruff)
  • Tests pass (uv run pytest tests/ -v)
  • Documentation is updated
  • Commit messages are descriptive

πŸ“„ License

MIT License - see LICENSE for details.


πŸ“§ Support & Contact


πŸ™ Acknowledgments

  • Conservation organizations using this toolkit
  • Open-source community
  • YOLO and MMDetection teams
  • PyTorch and Lightning teams

Ready to get started? Head to the Installation Guide or Quick Start!

About

WildDetect is a powerful wildlife detection and census system for aerial imagery. It helps conservationists, researchers, and organizations analyze wildlife populations, generate geographic visualizations, and produce actionable reportsβ€”all with easy-to-use command-line tools.

Topics

Resources

Stars

Watchers

Forks