Merge branch 'main' of 10.10.10.201:/Users/accusys/momentry_core_0.1/

This commit is contained in:
M5Max128
2026-05-25 03:59:54 +08:00
3 changed files with 10 additions and 10 deletions

View File

@@ -274,7 +274,7 @@ async fn match_from_trace(
// 1. Get 3 best face embeddings from this trace at different angles
// Divide trace frame range into 3 segments, pick best face from each
let fd_table = schema::table_name("face_detections");
let all_faces: Vec<(Vec<f32>, i64)> = sqlx::query_as::<_, (Vec<f32>, i64)>(&format!(
let all_faces: Vec<(Vec<f32>, i32)> = sqlx::query_as::<_, (Vec<f32>, i32)>(&format!(
"SELECT embedding, frame_number FROM {} \
WHERE file_uuid = $1 AND trace_id = $2 AND embedding IS NOT NULL \
ORDER BY frame_number ASC",
@@ -311,7 +311,7 @@ async fn match_from_trace(
let mut query_embeddings: Vec<Vec<f32>> = Vec::new();
// Get width*height info if available (not all pipelines store it)
let face_sizes: Vec<(i64, i32)> = sqlx::query_as::<_, (i64, i32)>(&format!(
let face_sizes: Vec<(i32, i32)> = sqlx::query_as::<_, (i32, i32)>(&format!(
"SELECT frame_number, COALESCE(width, 0) * COALESCE(height, 0) AS area \
FROM {} WHERE file_uuid = $1 AND trace_id = $2 AND embedding IS NOT NULL \
ORDER BY frame_number ASC",
@@ -323,7 +323,7 @@ async fn match_from_trace(
.await
.unwrap_or_default();
let face_sizes_map: std::collections::HashMap<i64, i32> = face_sizes.into_iter().collect();
let face_sizes_map: std::collections::HashMap<i32, i32> = face_sizes.into_iter().collect();
for (start, end) in segments {
let seg_start = start.min(total - 1);

View File

@@ -77,7 +77,7 @@ pub async fn bind_identity(
})?;
// Get identity_id from identity_uuid
let identity_row: Option<(i64, String)> = sqlx::query_as(&format!(
let identity_row: Option<(i32, String)> = sqlx::query_as(&format!(
"SELECT id, name FROM {} WHERE uuid = $1::uuid",
id_table
))
@@ -234,7 +234,7 @@ pub async fn merge_identities(
})?;
// Get IDs for both identities
let from_row: Option<(i64, String)> = sqlx::query_as(&format!(
let from_row: Option<(i32, String)> = sqlx::query_as(&format!(
"SELECT id, name FROM {} WHERE uuid = $1::uuid",
id_table
))
@@ -252,7 +252,7 @@ pub async fn merge_identities(
Json(serde_json::json!({"error": "Source identity not found"})),
))?;
let into_row: Option<(i64, String)> = sqlx::query_as(&format!(
let into_row: Option<(i32, String)> = sqlx::query_as(&format!(
"SELECT id, name FROM {} WHERE uuid = $1::uuid",
id_table
))
@@ -405,8 +405,8 @@ pub async fn bind_identity_trace(
)
})?;
let identity_row: Option<(i64, String)> = sqlx::query_as(&format!(
"SELECT id::bigint, name FROM {} WHERE uuid = $1::uuid",
let identity_row: Option<(i32, String)> = sqlx::query_as(&format!(
"SELECT id, name FROM {} WHERE uuid = $1::uuid",
id_table
))
.bind(&identity_uuid)

View File

@@ -758,7 +758,7 @@ impl QdrantDb {
vector: &[f32],
file_uuid: &str,
trace_id: i32,
frame_number: i64,
frame_number: i32,
) -> Result<()> {
let url = format!(
"{}/collections/{}/points?wait=true",
@@ -889,7 +889,7 @@ pub async fn sync_face_embeddings(file_uuid: &str) -> Result<()> {
for row in &rows {
let id: i32 = row.get(0);
let trace_id: Option<i32> = row.get(1);
let frame_number: i64 = row.get(2);
let frame_number: i32 = row.get(2);
let embedding: Option<Vec<f32>> = row.get(3);
if let (Some(emb), Some(tid)) = (embedding, trace_id) {