You are browsing as a guest. Sign up (or log in) to start making projects!

9h 33m 9s logged

MIRA — Day 10: Removing Streamlit, Safety, and Purging my LLM Tools

I spent the last week cleaning up a massive amount of technical debt. After about 40 commits, touching 168 files, and adding 6,186 lines of code while removing 1,200 lines of old code, the repo is finally much cleaner.

The biggest changes were replacing Streamlit with a Flask-SocketIO server, auditing my project for the Jugend Forscht competition, and removing my custom AI development tools (which I built earlier to help me write code).


Replacing Streamlit with Flask + SocketIO

Streamlit was a bottleneck for real-time video streaming and thread-safe operations because it re-runs the entire script on user interaction.

  • The Architecture: I built a custom Flask and SocketIO dashboard under src/dashboard_flask/. Live camera frames are captured in a background thread, encoded to JPEG, and pushed over WebSockets.
  • Thread Safety: I implemented four threading locks to prevent race conditions: camera_lock, model_lock, inventory_lock, and config_lock.
  • Bugs Fixed: I resolved an unnecessary BGR-to-RGB conversion that was washing out my live camera colors, and wrapped my configuration updater in config_lock to prevent multi-thread memory corruption.

Modularizing my Inference Pipeline

To clean up the backend, I consolidated all duplication:

  • I deleted the separate live and debug scripts, merging their logic into a single src/inference_engine.py module.
  • This engine handles the threaded camera feed, YOLO11n prediction loop, and my BYTETrack fallback.
  • All paths, labels, and parameters are now centralized in src/config.py.

Purging my Custom AI Tools

I built a terminal-based AI coding assistant to help me write and modify code. However, after an architectural review, I decided it does not belong in this repository.

  • The Reason: MIRA stands for Machine Intelligence for Recycling Automation. The codebase should focus strictly on computer vision and robotics, not LLM wrappers.
  • The Separation: I separated all AI coding utilities into a new MIRA-DevTools repository, which I will start as I near the end of MIRA.

JUFO Competition Audit & Paper

Since this project is for Jugend Forscht, I have been heavily working on my scientific paper (which I realized I haven’t actually mentioned in previous updates).

  • AI Audit: I ran an AI-assisted audit against JUFO evaluation criteria. It originally rated my project at a 6/10 because my paper lacked a deep discussion section and YOLO11n graphs.
  • The Fixes: I expanded my analysis on how the WaRP dataset’s class imbalance skewed my trash predictions, and compiled a 22-page LaTeX report with proper bibliographies and training curves.
  • Quality Assurance: I added 17 unit tests and automated GitHub Actions with Pytest and Ruff. I will translate the paper to English and upload it soon.

Next Steps

  • Folder Cleanup: Run git-filter-repo to shrink my 17 GB folder by removing cached datasets before pushing to GitHub.
  • Final Training: Train one last model on my optimized dataset combination once my Kaggle GPU hours reset.
0
3

Comments 0

No comments yet. Be the first!