feat: face clustering pipeline improvements and Rust/Swift face processing
- Add Rust face processor module (detection, embedding, tracking, qdrant) - Add Facenet CoreML/ONNX conversion scripts and tests - Refactor swift_face into Sources/swift_face with ArgumentParser support - Update store_traced_faces to handle face.json correctly - Fix ASRX parsing and TKG bbox reading from Qdrant - Improve admin_config and trace_agent APIs - Add M4 workspace docs for face clustering, dedup, and Facenet validation - Fix worker heartbeat TTL (poll_interval x 3, min 60s) for offline detection
This commit is contained in:
Executable
+64
@@ -0,0 +1,64 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Quick test for face clustering
|
||||
# Usage: ./scripts/test_face_cluster.sh <video_path>
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <video_path>"
|
||||
echo "Example: $0 /Users/accusys/momentry/input/test.mp4"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VIDEO_PATH="$1"
|
||||
UUID=$(basename "$VIDEO_PATH" .mp4)
|
||||
OUTPUT_PATH="/tmp/${UUID}_face_cluster_test.json"
|
||||
|
||||
echo "=== Testing Face Clustering ==="
|
||||
echo ""
|
||||
echo "Video: $VIDEO_PATH"
|
||||
echo "UUID: $UUID"
|
||||
echo "Output: $OUTPUT_PATH"
|
||||
echo ""
|
||||
|
||||
# Check if Rust binary exists
|
||||
RUST_BIN="/Users/accusys/momentry_core/tools/cli/rust/target/release/rust_face_cluster"
|
||||
|
||||
if [ ! -f "$RUST_BIN" ]; then
|
||||
echo "❌ Rust binary not found: $RUST_BIN"
|
||||
echo "Run: cd /Users/accusys/momentry_core/tools/cli/rust && cargo build --release"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Running face clustering..."
|
||||
echo ""
|
||||
|
||||
$RUST_BIN "$VIDEO_PATH" "$OUTPUT_PATH" --uuid "$UUID" 2>&1 | head -30
|
||||
|
||||
echo ""
|
||||
|
||||
if [ ! -f "$OUTPUT_PATH" ]; then
|
||||
echo "❌ Output file not generated"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Output file generated"
|
||||
echo ""
|
||||
|
||||
echo "=== Results ==="
|
||||
echo ""
|
||||
|
||||
echo "Clusters count:"
|
||||
jq '.clusters | length' "$OUTPUT_PATH"
|
||||
|
||||
echo ""
|
||||
echo "Threshold:"
|
||||
jq '.clusters[0].similarity.threshold' "$OUTPUT_PATH"
|
||||
|
||||
echo ""
|
||||
echo "Cluster details:"
|
||||
jq '.clusters[] | {cluster_id, face_count, threshold: .similarity.threshold}' "$OUTPUT_PATH"
|
||||
|
||||
echo ""
|
||||
echo "✅ Test completed successfully"
|
||||
Reference in New Issue
Block a user