Files
momentry_core/test_single_frame_fs_config.sh
T
Accusys 31d1b4050f fix: correct face detection threshold defaults
- Changed min_confidence from 50.0 to 0.5 (Vision uses 0.0-1.0 range)
- Changed min_size from 32 to 1 (was filtering out all small faces)
- Changed min_capture_quality from 25.0 to 0.25
- Fixes issue where all videos showed 0 faces detected

Root cause: admin_config.rs used wrong defaults (50.0/32) instead of
config.rs constants (0.5/1), causing Vision framework to filter out
ALL faces because confidence threshold exceeded valid range.

Verified: IMG_9449 now correctly detects 191 faces (was 0).
2026-09-18 02:42:21 +08:00

75 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# Single Frame FS Configuration Test Script
FILE_UUID="4655a0ab3c077e30c12b2298c2750650"
API_KEY="muser_68600856036340bcafc01930eb4bd839_1774418104_97221b69"
API_URL="http://localhost:3002"
echo "=============================================="
echo " Single Frame FS Configuration Test"
echo "=============================================="
echo ""
echo "【Test 1: Get Face Groups (default config)】"
echo "Expected: 5 multi-trace groups, 10 single-trace groups filtered"
curl -s -H "Authorization: Bearer $API_KEY" \
"$API_URL/api/v1/file/$FILE_UUID/face-groups" | python3 -m json.tool
echo ""
echo "【Test 2: Disable single trace group filter】"
echo "Updating face_filter..."
PG_BIN="/opt/homebrew/opt/libpq/bin"
$PG_BIN/psql -U accusys -d momentry -h localhost << SQL
UPDATE videos
SET face_filter = jsonb_set(
face_filter,
'{single_trace_group_filter_enabled}', 'false'
)
WHERE file_uuid = '$FILE_UUID';
SQL
echo ""
echo "Expected: All 15 groups (including single-trace groups)"
curl -s -H "Authorization: Bearer $API_KEY" \
"$API_URL/api/v1/file/$FILE_UUID/face-groups" | python3 -m json.tool
echo ""
echo "【Test 3: Disable single frame trace from groups】"
$PG_BIN/psql -U accusys -d momentry -h localhost << SQL
UPDATE videos
SET face_filter = jsonb_set(
jsonb_set(
face_filter,
'{single_trace_group_filter_enabled}', 'true'
),
'{single_frame_trace_group_enabled}', 'false'
)
WHERE file_uuid = '$FILE_UUID';
SQL
echo ""
echo "Expected: Fewer groups (single frame traces excluded)"
curl -s -H "Authorization: Bearer $API_KEY" \
"$API_URL/api/v1/file/$FILE_UUID/face-groups" | python3 -m json.tool
echo ""
echo "【Test 4: Check unassigned traces】"
echo "Restoring default config..."
$PG_BIN/psql -U accusys -d momentry -h localhost << SQL
UPDATE videos
SET face_filter = jsonb_set(
face_filter,
'{single_frame_trace_group_enabled}', 'true'
)
WHERE file_uuid = '$FILE_UUID';
SQL
echo ""
echo "Getting unassigned traces..."
curl -s -H "Authorization: Bearer $API_KEY" \
"$API_URL/api/v1/traces/unassigned?file_uuid=$FILE_UUID" | python3 -m json.tool | head -50
echo ""
echo "✅ Test Complete"