Refactor into standard Python package with uv

- Move all code into src/mouse_control/ following the src-layout convention,
  with model/collect/train/visualize/inference as separate modules and
  SimpleNet extracted into model.py
- Add hatchling-based pyproject.toml with three CLI entry points
  (mouse-collect, mouse-train, mouse-visualize) and bundle the trained
  ONNX model as a package resource under assets/
- Move training data to data/, delete superseded show.py, remove dead
  imports (numpy, onnxruntime, onnx, onnxsim) and the unused
  visualize_path() helper
- Fix crashes in the collector: guard against destroyed-widget access
  after the n==100 destroy(), and skip save_to_csv when recording is
  off or the path is too short to derive 10 keypoints
- Switch ONNX export to external_data=False so the model ships as a
  single self-contained 19KB file
- Bytes-load the bundled model via importlib.resources so packaging
  remains correct under zip-safe distributions
- Rewrite README around the new layout, commands, and public API
This commit is contained in:
2026-05-12 00:30:08 +08:00
parent 2c482150d4
commit de602365e9
19 changed files with 2170 additions and 299 deletions

1167
uv.lock generated Normal file

File diff suppressed because it is too large Load Diff