Skip to main content

MIRA_logo

MIRA - Microscopy Image Recognition and Analysis

Documentation Status License: GPL v3 Python 3.10+

MIRA is a professional PyQt5 application designed for real-time spore detection and quantification using deep learning (YOLO) and microscopy imaging.


📖 Documentation

Full documentation is available at mira-microscopy.readthedocs.io

The documentation includes:

  • Detailed installation guides for all platforms.
  • Comprehensive usage tutorials.
  • Hardware configuration and camera settings.
  • Advanced data analysis and export workflows.

Key Features

  • 🔬 Real-time Analysis: Live video feed with YOLO-based object detection.
  • 🧪 Standardized Chambers: Built-in support for Malassez and KOVA slides.
  • 📊 Automated Quantification: Automatic calculation of spores/mL and titer with dilution factors.
  • 📈 Professional Export: Multi-sheet Excel reports with statistical analysis (Mean, SD, CV%).
  • 📷 High-Res Support: Optimized for ArduCam 20MP and industrial microscopy cameras.
  • 🎨 Modern UI: Auto dark/light mode (OS detection), HiDPI support, resizable panels, and real-time quality indicators.

Installation

Requirements

  • Python 3.10 to 3.13
  • A USB microscopy camera (ArduCam recommended)

Quick Install (PyPI)

pip install mira-microscopy
pip install opencv-python-headless --force-reinstall  # Linux only — avoids Qt conflict

Install from Source

git clone https://forge.ird.fr/phim/sravel/mira.git
cd mira
pip install .
pip install opencv-python-headless --force-reinstall  # Linux only

Quick Start

  1. Launch MIRA: Run mira in your terminal.
  2. Configure: Select your camera and load a YOLO .pt model.
  3. Analyze: Select a chamber on the interactive grid, set your dilution factor, and capture images.
  4. Export: Click "Save to Excel" to get your full report.

Pretrained Models

Four pretrained YOLO models accompany the MIRA paper (Mejias et al., 2026) and are distributed on the CIRAD Dataverse:

Model Task Weights (Dataverse) mAP@0.5
M. oryzae spore counter Detect (yolo26m) spore-m-oryzae-xzewf_v9_yolo26m_20260721_0.765.pt 0.765
F. oxysporum micro/macroconidia Detect (yolo26m) spore-fusarium-object_v6_yolo26m_20260721_0.884.pt 0.884
P. fijiensis spore + surface Segment (yolo26m-seg) spore-fijiensis-seg_v6_yolo26m-seg_20260721_0.766.pt 0.770
Mix multi-genus (6 rice-associated) Segment (yolo26m-seg) curvularia-genus_v12_yolo26m-seg_20260721_0.820.pt 0.823

The Mix model covers 6 rice-associated fungal genera: Alternaria, Bipolaris, Curvularia, Exserohilum, Fusarium, Pyricularia.

Weights are distributed compressed with xz -9 (~12 % smaller). Decompress before use:

# Linux / Mac
xz -d *.pt.xz          # produces the .pt files

# Windows
# Right-click each .pt.xz → 7-Zip → Extract Here

Then place the .pt files in <repo>/models/, or set the environment variable:

export MIRA_MODELS_DIR=/path/to/models

Training your own models

MIRA models are trained with the VEGA CLI (Versatile Engine for Generic Automated-training):

https://forge.ird.fr/phim/sravel/vega

VEGA handles Roboflow dataset download, SLURM job submission, per-run reporting, and canonical weight naming. See its README for the full workflow.

Authors

Development Team:

  • Sébastien RAVEL (CIRAD) - Lead Developer

  • Joffrey MEJIAS (CIRAD) - Co-Developer

Institution: CIRAD (Centre de coopération internationale en recherche agronomique pour le développement)

License

This project is licensed under the GNU General Public License v3.0 or later (GPLv3+).

Free for non-commercial use. For commercial licensing, contact the authors.

Citation

If you use MIRA in your research, please cite the software AND the accompanying dataset:

@software{mira2026,
  title     = {MIRA: Microscopy Image Recognition and Analysis},
  author    = {Ravel, S{\'e}bastien and Mejias, Joffrey and Adreit, Henri and Blanc, Ana{\"e}lle and Lubin, Nadia and Jolivet, Cassandre and Guyot, Valentin and Brayle, O{\"i}ana and Poncelet, Nicolas and Fournier, Elisabeth and Wicker, Emmanuel and Carlier, Jean and Tharreau, Didier},
  year      = {2026},
  institution = {CIRAD, UMR PHIM, Montpellier, France},
  url       = {https://forge.ird.fr/phim/sravel/mira},
  version   = {1.0.0}
}

@dataset{mira_dataverse_2026,
  title     = {MIRA: dataset and trained YOLO weights for automated counting and sizing of fungal spores --- France, 2024--2026},
  author    = {Ravel, S{\'e}bastien and Mejias, Joffrey and others},
  year      = {2026},
  publisher = {CIRAD Dataverse},
  doi       = {10.18167/DVN1/E0JRDL},
  url       = {https://doi.org/10.18167/DVN1/E0JRDL}
}

Support

For questions, bug reports, or feature requests:

Made with ❤️ by CIRAD for the scientific community

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mira_microscopy-1.0.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mira_microscopy-1.0.0-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file mira_microscopy-1.0.0.tar.gz.

File metadata

  • Download URL: mira_microscopy-1.0.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for mira_microscopy-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1b2fb90b3047f51a5832f9566a90a3dc1fbccd0299988a1d8ada7ce8fa300e3c
MD5 c815f11e39d79fe1f409276524ae729b
BLAKE2b-256 e2530de4092b1316b6477d653b1ac2953700672bd2d6a76c75c73f4fb9da1076

See more details on using hashes here.

File details

Details for the file mira_microscopy-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mira_microscopy-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a741583df2f43f85e3e3495ca5c95f3dfcda03255fbe354a3f5b3792e39fc290
MD5 721da5d51f139cddfb722c635f5cc578
BLAKE2b-256 d801f98c90a894758633a59e1f59d88edfdd904f56e395405efa00ca49f47d02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page