8 Commits

Author SHA1 Message Date
be4bd617c3 fix: eliminate QTextCursor cross-thread signal warning on inference stop
Three related fixes to the QObject::connect / QTextCursor warning that
appeared when stopping inference:

1. StdoutCapture: replace signal emission with queue.Queue.put_nowait()
   so non-Qt SDK threads (Kneron shutdown) never touch Qt signal machinery.
   DeploymentWorker.stdout_captured signal removed; worker now accepts a
   stdout_queue and passes it to StdoutCapture.

2. start_deployment: create QTimer (100 ms) on main thread to drain the
   stdout queue via _drain_stdout_queue(). Connect worker.finished to
   _on_worker_finished to stop the timer and flush remaining output.

3. stop_deployment / wait_for_stop: the background thread was calling
   QTextEdit.append() and other widget methods directly, which internally
   creates QTextCursor queued connections — the real trigger of the
   warning. Fixed by having wait_for_stop emit _stop_done signal only;
   all UI updates moved to _on_stop_done slot (main thread).

Also adds QTextCursor import in main.py to pre-register the type with
Qt's meta-type system as a belt-and-suspenders measure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 17:56:02 +08:00
6e9885404c fix: resolve 3 runtime errors in inference and UI
- result_handler: add _InferenceResultEncoder to handle dataclass objects
  (ObjectDetectionResult, ClassificationResult) in JSON serialization;
  fixes "Object of type ObjectDetectionResult is not JSON serializable"

- deployment: replace textCursor().movePosition() with toPlainText/setPlainText
  for log trimming; eliminates QTextCursor cross-thread Qt warning

- main: remove duplicate setAttribute(AA_EnableHighDpiScaling) call in
  setup_application() which ran after QApplication was already created;
  fixes "Attribute Qt::AA_EnableHighDpiScaling must be set before
  QCoreApplication is created"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 19:32:30 +08:00
55040733fe feat: implement Phase 1-4 performance visualization and device management
Phase 1 — Performance Benchmarking:
- PerformanceBenchmarker: sequential vs parallel benchmark with injectable runner
- PerformanceHistory: JSON-backed benchmark history with regression support
- PerformanceDashboard: real-time FPS/latency display widget
- BenchmarkDialog: one-click benchmark with 3-phase progress bar

Phase 2 — Device Management:
- DeviceManager: NPU dongle scan, assign/unassign, load balance recommendation
- DeviceManagementPanel: live device status cards with auto-refresh
- BottleneckAlert: dataclass for pipeline bottleneck detection

Phase 3 — Advanced Features:
- OptimizationEngine: 3 optimization rules (rebalance/adjust_queue/add_devices)
- TemplateManager: 3 built-in pipeline templates (YOLOv5, fire detection, dual-model)

Phase 4 — Report Export:
- ReportExporter: PDF (reportlab, optional) and CSV export
- ExportReportDialog: format selection + path picker UI

192 unit tests, all passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 19:32:05 +08:00
ccd7cdd6b9 feat: Reorganize test scripts and improve YOLOv5 postprocessing
- Move test scripts to tests/ directory for better organization
- Add improved YOLOv5 postprocessing with reference implementation
- Update gitignore to exclude *.mflow files and include main.spec
- Add debug capabilities and coordinate scaling improvements
- Enhance multi-series support with proper validation
- Add AGENTS.md documentation and example utilities

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-11 19:23:59 +08:00
1781a05269 feat: Add multi-series configuration testing and debugging tools
- Add comprehensive test scripts for multi-series dongle configuration
- Add debugging tools for deployment and flow testing
- Add configuration verification and guide utilities
- Fix stdout/stderr handling in deployment dialog for PyInstaller builds
- Includes port ID configuration tests and multi-series config validation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-21 00:31:45 +08:00
2fea1eceec fix: Resolve multi-series initialization and validation issues
- Fix mflow_converter to properly handle multi-series configuration creation
- Update InferencePipeline to correctly initialize MultiDongle with multi-series config
- Add comprehensive multi-series configuration validation in mflow_converter
- Enhance deployment dialog to display multi-series configuration details
- Improve analysis and configuration tabs to show proper multi-series info

This resolves the issue where multi-series mode was falling back to single-series
during inference initialization, ensuring proper multi-series dongle support.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-14 16:33:22 +08:00
Mason
92f9d956af Remove cluster4npu_ui package prefix and remove export/analysis buttons
- Update all imports to use relative imports instead of cluster4npu_ui.* prefix
- Remove export configuration functionality from dashboard menu
- Remove performance analysis action from pipeline menu
- Update dependencies in pyproject.toml to include NodeGraphQt and PyQt5
- Maintain clean import structure across all modules

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 12:17:59 +08:00
Mason
1ad614289b remove redundant file 2025-08-04 22:40:22 +08:00