Files
momentry_core/scripts/debug_face_registration.py
Warren 8f05a7c188 feat: update Python processors and add utility scripts
- Update ASR, face, OCR, pose processors
- Add release pre-flight check script
- Add synonym generation, chunk processing scripts
- Add face recognition, stamp search utilities
2026-04-30 15:07:49 +08:00

55 lines
1.3 KiB
Python

#!/opt/homebrew/bin/python3.11
"""
Debug script to test face registration with same arguments Rust uses
"""
import subprocess
import sys
import os
# Simulate what Rust would call
image_path = "/tmp/face_analysis_results/384b0ff44aaaa1f1_frame_019778.jpg"
output_path = "/tmp/face_registration_debug.json"
name = "Debug Person"
database_path = "/tmp/face_database.json"
# Create metadata file
metadata_path = "/tmp/face_metadata_debug.json"
import json
metadata = {"source": "debug", "test": True}
with open(metadata_path, "w") as f:
json.dump(metadata, f)
# Build command
cmd = [
"/opt/homebrew/bin/python3.11",
"scripts/face_registration.py",
image_path,
output_path,
name,
"--database",
database_path,
"--metadata",
metadata_path,
]
print(f"Running command: {' '.join(cmd)}")
print(f"Current directory: {os.getcwd()}")
# Run command
result = subprocess.run(cmd, capture_output=True, text=True)
print(f"Return code: {result.returncode}")
print(f"Stdout:\n{result.stdout}")
print(f"Stderr:\n{result.stderr}")
# Check if output file was created
if os.path.exists(output_path):
print(f"Output file exists: {output_path}")
with open(output_path, "r") as f:
content = f.read()
print(f"Output content: {content}")
else:
print(f"Output file does not exist: {output_path}")