Graduate

Modify distance logic

...@@ -130,12 +130,12 @@ async def thread(websocket, path): ...@@ -130,12 +130,12 @@ 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 < distance_min): 133 + if (distance < 0.4):
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 137
137 # 출석 데이터 전송 138 # 출석 데이터 전송
138 - print('[debug] distance:', distance_min)
139 send = '' 139 send = ''
140 if distance_min < 0.4: 140 if distance_min < 0.4:
141 # 인증 성공 141 # 인증 성공
......