Metadata-Version: 2.4
Name: mira-ai
Version: 2.0.0rc1
Summary: Machine Intelligence for Recycling Automation: YOLO11 waste detection (glass, metal, paper, plastic, trash) with a live dashboard and CLI.
Author: Jeremy Darko
License-Expression: MIT
Project-URL: Homepage, https://jeremydarko.me
Project-URL: Documentation, https://mira-vision.vercel.app/
Project-URL: Repository, https://github.com/jeremy341/MIRA-AI
Project-URL: Issues, https://github.com/jeremy341/MIRA-AI/issues
Project-URL: Changelog, https://github.com/jeremy341/MIRA-AI/blob/main/CHANGELOG.md
Project-URL: Hugging Face, https://huggingface.co/Jeremy341/MIRA-AI
Keywords: recycling,edge-ai,yolo,yolo11,object-detection,computer-vision,waste-sorting,waste-detection,tflite,onnx
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Requires-Python: <3.13,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ultralytics>=8.3.0
Requires-Dist: lap>=0.5.12
Requires-Dist: opencv-python>=4.0
Requires-Dist: pyarrow>=10.0
Requires-Dist: torch>=2.0
Requires-Dist: torchvision>=0.15
Requires-Dist: numpy>=1.24
Requires-Dist: psutil>=5.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: fastapi>=0.100
Requires-Dist: pydantic>=2.0
Requires-Dist: uvicorn>=0.20
Requires-Dist: websockets>=10.0
Requires-Dist: python-multipart>=0.0.5
Requires-Dist: pillow>=9.0
Provides-Extra: train
Requires-Dist: tensorflow>=2.10; extra == "train"
Provides-Extra: analysis
Requires-Dist: matplotlib>=3.5; extra == "analysis"
Requires-Dist: pandas>=1.5; extra == "analysis"
Requires-Dist: scikit-learn>=1.0; extra == "analysis"
Requires-Dist: scipy>=1.0; extra == "analysis"
Provides-Extra: all
Requires-Dist: mira-ai[analysis,train]; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest==8.3.5; extra == "dev"
Requires-Dist: pytest-asyncio==0.24.0; extra == "dev"
Requires-Dist: pytest-mock==3.14.0; extra == "dev"
Requires-Dist: ruff==0.12.1; extra == "dev"
Requires-Dist: mypy==1.15.0; extra == "dev"
Requires-Dist: types-PyYAML; extra == "dev"
Requires-Dist: mira-ai[all]; extra == "dev"
Dynamic: license-file

# MIRA: Machine Intelligence for Recycling Automation

**Jugend forscht 2027**

[![CI](https://github.com/jeremy341/MIRA-AI/actions/workflows/ci.yml/badge.svg)](https://github.com/jeremy341/MIRA-AI/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/mira-ai)](https://pypi.org/project/mira-ai/)

I started MIRA to see if an ordinary camera could tell glass, metal, paper, plastic and trash apart well enough to feed a sorter. The detector and local dashboard are working. The sorting arm in the dashboard is a simulator; this repository does not control a physical sorter.

## Try the detector

Install [`mira-ai` from PyPI](https://pypi.org/project/mira-ai/) with Python 3.11 or 3.12. The published package includes the EXP-014, EXP-018 and EXP-019 weights; you don’t need a Hugging Face account or separate weights download for the standard demo.

```powershell
py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install mira-ai
mira models
mira live --model mira_exp014.pt
```

Or run `mira dashboard` and open [127.0.0.1:8000](http://127.0.0.1:8000). Use **Detect** for the connected camera, or stop the live stream before choosing a JPEG or PNG (up to 8 MB and 16 megapixels). Still-photo detections do not count toward camera sessions. The dashboard also supports session history, CSV/JSON exports, a print-ready HTML report, video and image batches, and same-image model comparison.

## What I measured

I started with a custom CNN and MobileNetV2, then moved to YOLOv8n and YOLO11n because the project needed bounding boxes, not just one label per picture. Combining more data brought in incompatible labels and setups, so I cleaned the classes and tried a more balanced training set.

| Experiment | Evaluation | mAP50 |
| --- | --- | ---: |
| EXP-014 | Earlier recorded baseline | 60.7% |
| EXP-018 | 415-image tabletop validation split | 90.6% |
| EXP-019 | Repeat on the same validation split | 90.58% |

EXP-019 repeated EXP-018 on that validation set; its 1,375-image reserved test split was **not** evaluated. The earlier baseline is not a head-to-head result on the later split. These scores don’t establish accuracy on household waste in the wild or on a physical sorter. Crumpled paper, cans seen from their opening, overlapping objects and unfamiliar conditions can all trip up the models. EXP-014 is still the live-demo default, not a claim that it wins on an independent test.

See [the experiment log](results/experiments_log.md) for setup, per-class numbers and export results. The training images are not stored in Git; [dataset origins and licensing](docs/DATASET_ORIGINS.md) are documented separately.

## Compare two models from the current source

Use the current checkout for the explicit split behavior below. Follow the [source setup](CONTRIBUTING.md) and run `git lfs pull` after cloning to hydrate the bundled weight files. For the Svelte interface in a source checkout, see the [dashboard build instructions](src/dashboard/ui/README.md).

Use a local YOLO-format dataset and explicitly choose its split:

```powershell
mira benchmark --models mira_exp014.pt mira_exp019.pt --dataset C:/datasets/mira/dataset.yaml --split test --max-images 1375 --output comparison.json
```

Adjust the image limit to cover your split; the CLI defaults to 100. Provide a label file for every image, empty for a deliberate negative. A missing split or label stops the run instead of silently using training data. Verify that the test images were outside training for **both** models before calling them an independent holdout.

The current source uses the same Ultralytics detector for first-party benchmarks and the live/still workflows, without tracking in the benchmark. Custom adapters can use different inference code; reports identify the backend. Do not compare a new run directly with historical results from a different benchmark or backend.

## Code and further reading

- [Project website and research notes](https://mira-vision.vercel.app/)
- [Model card, extra weights and ONNX/TFLite exports](https://huggingface.co/Jeremy341/MIRA-AI)
- [Dataset tools, training and benchmark code](src/pipeline/) and [dashboard contract](docs/dashboard-v2/CONTRACT.md)
- [Development and testing](CONTRIBUTING.md) and [CI runs](https://github.com/jeremy341/MIRA-AI/actions/workflows/ci.yml)

I used AI tools for parts of the coding and debugging. The problem choice, dataset experiments, model comparisons and decisions about what worked were my own.

[MIT license](LICENSE)
