PrintGuard 2.0 发布:基于ShuffleNetV2的少样本检测器以5MB TFLite运行,无需修改即可在浏览器和CPython中使用
英文摘要
PrintGuard 2.0, an open-source FDM failure detector, reuses the same ShuffleNetV2 encoder with nearest-prototype classification but completely rewrites the runtime. The model is exported as a ~5 MB TFLite file via LiteRT, enabling deployment on CPython (hub mode) and in the browser (Pyodide + LiteRT.js WASM) from a single codebase. A Platform abstraction layer isolates all non-portable operations (inference, camera discovery, image encoding), so the Python engine runs unchanged in both environments. The system introduces a dynamic fairness-aware inference scheduler that uses smoothed latency estimates and max-min fairness to allocate inference capacity across cameras. A fail-safe design gates inference based on printer state, stopping only when positively not printing, and watchdog monitors camera feeds and printer services for dropouts.
中文摘要
PrintGuard 2.0 是一个开源的FDM故障检测器,沿用原有的ShuffleNetV2编码器与最近原型分类,但完全重写了运行时环境。模型通过LiteRT导出为约5MB的TFLite文件,可在CPython(hub模式)和浏览器(Pyodide + LiteRT.js WASM)上从同一代码库部署。Platform抽象层隔离了所有不可移植操作(推理、摄像头发现、图像编码),使Python引擎在两种环境下无需修改即可运行。系统引入了动态公平感知调度器,利用平滑延迟估计和最大最小公平算法在多摄像头间分配推理能力。故障安全设计根据打印机状态控制推理启停,仅在明确不打印时才停止监控,同时看门狗持续监测摄像头流和打印机服务的异常。
关键要点
Model is unchanged ShuffleNetV2 + prototypical network, now exported as ~5 MB TFLite via LiteRT for efficient on-device inference.
模型仍为ShuffleNetV2 + 原型网络,现通过LiteRT导出为约5MB TFLite文件,用于高效的端侧推理。
Single Python engine runs unmodified on both CPython (hub mode) and browser (Pyodide + LiteRT.js WASM) through a platform abstraction layer.
通过平台抽象层,同一个Python引擎无需修改即可在CPython(hub模式)和浏览器(Pyodide + LiteRT.js WASM)中运行。
Dynamic, fairness-aware scheduler uses inferred latency to water-fill capacity across cameras with max-min fairness, respecting each camera's native frame rate.
动态公平感知调度器根据推理延迟估计,以最大最小公平方式在多摄像头间分配推理容量,并遵循各摄像头的原生帧率。
Fail-safe design monitors printer state; inference stops only when a printer is positively not printing, with watchdog alerts on camera drop, feed freeze, or service failure.
故障安全设计根据打印机状态决定推理启停,仅在明确不打印时停止,并通过看门狗对摄像头断开、流冻结或服务故障发出告警。