MIRA — Day 12: Codebase Audit, EXP-017 Results, and Cross-Platform Fixes
Before diving into codebase fixes, I finished training EXP-017 on Kaggle using the merged mira_all dataset. It reached 59.3% mAP50—which is slightly below EXP-014’s 60.7%. This confirmed a key lesson for me: dataset quality and class balance matter far more than sheer image count. After that, I shifted my focus to running a full diagnostic audit of my codebase to clean up bugs and edge cases.
Fixing the Health Check
My health check command (mira doctor) was crashing immediately on Windows with a UnicodeEncodeError due to special status symbols (✓, ✗, ⚠).
- I replaced them with plain ASCII characters (
[OK],[!],[FAIL]). - Added checks for missing camera backends on Linux so the health check runs cleanly end-to-end regardless of the OS.
Making Torch and TensorFlow Optional
MIRA supports both PyTorch (.pt) and TFLite (.tflite) models, but requiring both libraries installed was frustrating—PyTorch alone takes up over 800 MB.
- I refactored my model adapters and dashboard to use lazy-imports.
- If PyTorch isn’t installed, PyTorch models gracefully report as unsupported without crashing the application.
- This allows a lightweight setup without forcing massive unnecessary downloads if someone only wants to run TFLite models on edge hardware.
Cross-Platform & Service Hardening
I cleaned up my startup scripts and hardened my camera service against common edge-case failures:
- Updated
mira.batwithPYTHONUTF8=1for Windows, and created a nativemira.shfor Linux and macOS. - Added OS guards around the Windows-specific DirectShow camera backend.
- Fixed a potential division-by-zero crash when video FPS drops to zero.
- Switched Linux CPU temperature reads to
psutilinstead of hardcoding 0°C. - Ensured the model object memory is properly freed on shutdown.
Security, Pydantic v2, and Edge Cases
-
Security: I restricted CORS in my web dashboard from wildcard access (
*) to localhost (127.0.0.1:8000). -
Pydantic Upgrade: Replaced deprecated
.dict()calls with.model_dump()for Pydantic v2 compatibility. -
Integrity: Explicitly forced UTF-8 encoding on all YAML file reads, and added SHA-256 hash verification to
mira download.
Current System Status
After resolving these issues, my test suite is sitting at 99 out of 99 passing unit tests, my Ruff linter reports 0 errors, and all 17 CLI commands are fully functional. I also prepared my HackClub StarDance submission writeup and updated the main README with current CLI specs and experiment data.
Next Steps
- Hardware Benchmarking: Measure real-world FPS and inference latency on a Raspberry Pi Zero 2W.
- Trash Class Data: Collect targeted training images to improve the general “Trash” class, which remains my weakest performer (7.1% mAP50).
in this pic you can see a sneakpeak to a new feature
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.