Graduate

Modify distance logic

...@@ -130,7 +130,7 @@ async def thread(websocket, path): ...@@ -130,7 +130,7 @@ async def thread(websocket, path):
130 db_embedding = np.frombuffer(row_data['embedding'], dtype=np.float32) 130 db_embedding = np.frombuffer(row_data['embedding'], dtype=np.float32)
131 db_embedding = db_embedding.reshape((1,512)) 131 db_embedding = db_embedding.reshape((1,512))
132 distance = await get_distance(embedding, db_embedding) 132 distance = await get_distance(embedding, db_embedding)
133 - if (distance < 0.4): 133 + if (distance < distance_min):
134 verified_id = row_data['student_id'] 134 verified_id = row_data['student_id']
135 distance_min = distance 135 distance_min = distance
136 break 136 break
......