How xevila/openmcx works
Main Components
• User Interface (GUI)
– PyQt6-based windows and file‐selection dialogs
– Widgets for model, labels, input folder, output folder, progress bar, results list
• Classification Engine (Background Thread)
– ClassificationThread class
– Loads the ML model via TensorFlow or TFLite runtime
– Uses NumPy + Pillow to preprocess images
– Runs inference and returns class indices
• File System Manager
– Scans input folder (up to 50 images)
– Reads/writes image files, creates per‐class subfolders in output directory
– Persists last‐used paths (e.g., via QSettings or a small config file)
• Model & Labels
– External .h5, .tflite or .pb file
– .txt label file mapping indices to class names
Relationships & Data Flow
a. User → UI: user selects model file, label file, input/output folders
b. UI → ClassificationThread: once “Start” is clicked, the UI spawns the thread
c. ClassificationThread → File System Manager:
• Reads images via Pillow/NumPy
• For each image: run inference, get class index, map to label
• Write or move image into the appropriate output subfolder
• Emit progress and individual‐result signals back to UI
d. ClassificationThread → UI: emits signals to update progress bar and results list
e. UI → Persistent Storage: saves last‐used paths on exit or after file selection
Architectural Patterns & Principles
• Event‐Driven / Asynchronous: GUI remains responsive by delegating compute to a worker thread
• MVC‐Lite:
– View: PyQt6 widgets
– Controller: main.py logic wiring UI events to worker thread
– Model: ML model + image data
• Single‐Process Desktop App: all components live in one process but logically separated
Technologies
– PyQt6 for GUI
– TensorFlow or TFLite Runtime for inference
– NumPy + Pillow for image preprocessing
– Python 3.7+ runtime
– QSettings or local config for path persistence
Detail Without Overthinking
– Capture each technology (PyQt6, TensorFlow, NumPy, Pillow) next to its component.