Skip to content

Conversation

@suharvest
Copy link

add app to do face embeding

stevehuang82 and others added 20 commits January 17, 2025 15:48
- Add tflm_face_embedding scenario app for Grove Vision AI V2
- SCRFD-500M-KPS face detection with 5-point landmarks (160x160 input)
- MobileFaceNet 128D face embedding (112x112 input)
- Support multiple camera sensors (OV5647, IMX219, IMX477, IMX708, HM0360)
- Serial protocol for real-time debug output
- Face alignment using affine transformation

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- SCRFD face detection model conversion (PTQ and QAT)
  - PyTorch model definition and weight loading
  - QAT training with MS1M-ArcFace dataset
  - Vela compilation for Ethos-U55 NPU
- MobileFaceNet 128D embedding model conversion
  - ONNX to TFLite INT8 quantization
  - QAT optimization with knowledge distillation
- GhostFaceNet 512D conversion (optional alternative)
- Calibration data preparation scripts
- Quantization validation tools

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Web-based debug frontend (JavaScript)
  - Real-time face detection visualization
  - Embedding similarity display
  - Face enrollment interface
- Python serial backend
  - Serial protocol parser
  - Face database management (SQLite)
  - REST API for frontend
- Support for live debugging of firmware

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add CLAUDE.md development guide
  - Hardware memory map and configuration
  - Build system documentation
  - One-click build and flash workflow
- Add build_and_flash.sh automation script
  - Build firmware with gmake
  - Generate bootable image
  - Flash firmware and models via xmodem

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Update .gitignore for Python, model, and build artifacts
- Update makefile with tflm_face_embedding as default app
- Update prebuilt libraries (CMSIS-NN, TFLM, TrustZone)
- Add JPEG encoder library

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add flash_only.sh for quick model/firmware flashing
  - --model-only: Flash models without firmware
  - --fw-only: Flash firmware without models
- Add development documentation
  - VISION_APP_DEVELOPMENT_GUIDE.md
  - face_recognition_data_path.md
  - people_counter_requirements.md

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Enable ENABLE_FACE_ALIGNMENT in common_config.h
- Fix BGR planar channel order (was incorrectly read as RGB)
- Remove incorrect 180-degree rotation in face alignment
- Add INT8 quantization conversion for aligned face path
- Fix SCRFD bbox to use anchor corner (consistent with landmarks)
- Update SCRFD_DECODING.md documentation

These fixes resolve the low similarity scores (~0.6) for same-person
recognition. After fixes, same-person similarity is ~0.85+ and
different-person similarity is <0.4.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add frame-to-frame embedding similarity tracking (frame_sim)
- Lower recognition threshold from 0.8 to 0.6
- Add detailed debug output for recognition comparisons
- Track embedding norm and first 3 values per frame

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Features merged:
- Face embedding firmware app (SCRFD + MobileFaceNet 128D)
- Model conversion and quantization tools
- Face recognition debug tools
- YOLOv8 gender classification example
- YOLO11n object detection example
- Documentation and build script updates
- Update README with complete documentation
- Add debug tools reference (tools/face_recognition_debug)
- Add output protocol format
- Add memory layout details
- Fix NPU acceleration rate to 100%
- Update model source to foamliu

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Comprehensive workload evaluation for integrating tflm_face_embedding
with the sscma framework:

- Architecture comparison (bare-metal vs FreeRTOS)
- 7 work modules breakdown (9-14 person-days estimate)
- Risk analysis (memory, dual-model, D-Cache)
- Alternative approaches (deep/lightweight/hybrid integration)
- Implementation phases and priorities

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Based on Vela 3.9.0 analysis:
- SCRFD: 201 KB actual (220 KB configured)
- MobileFaceNet: 600 KB actual (700 KB configured, was 1200 KB)
- Total: 920 KB (was 1420 KB), saving 500 KB SRAM

Updated README with accurate memory specs and inference times.

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants