Spaces:
Runtime error
Runtime error
Update
Browse files
app.py
CHANGED
@@ -118,8 +118,8 @@ def compare_face():
|
|
118 |
"data": {
|
119 |
"result": result,
|
120 |
"similarity": float(similarity),
|
121 |
-
"face1": {"x1": int(faceRect1[0]), "y1": int(faceRect1[
|
122 |
-
"face2": {"x1": int(faceRect2[0]), "y1": int(faceRect2[
|
123 |
}
|
124 |
})
|
125 |
|
@@ -192,7 +192,7 @@ def coompare_face_base64():
|
|
192 |
return response
|
193 |
|
194 |
similarity = ttv_compare_feature(feature1, feature2)
|
195 |
-
if similarity > 0.
|
196 |
result = "same person!"
|
197 |
else:
|
198 |
result = "different person!"
|
@@ -204,8 +204,8 @@ def coompare_face_base64():
|
|
204 |
"data": {
|
205 |
"result": result,
|
206 |
"similarity": float(similarity),
|
207 |
-
"face1": {"x1": int(faceRect1[0]), "y1": int(faceRect1[
|
208 |
-
"face2": {"x1": int(faceRect2[0]), "y1": int(faceRect2[
|
209 |
}
|
210 |
})
|
211 |
response.status_code = 200
|
|
|
118 |
"data": {
|
119 |
"result": result,
|
120 |
"similarity": float(similarity),
|
121 |
+
"face1": {"x1": int(faceRect1[0]), "y1": int(faceRect1[2]), "x2": int(faceRect1[1]), "y2" : int(faceRect1[3])},
|
122 |
+
"face2": {"x1": int(faceRect2[0]), "y1": int(faceRect2[2]), "x2": int(faceRect2[1]), "y2" : int(faceRect2[3])},
|
123 |
}
|
124 |
})
|
125 |
|
|
|
192 |
return response
|
193 |
|
194 |
similarity = ttv_compare_feature(feature1, feature2)
|
195 |
+
if similarity > 0.7:
|
196 |
result = "same person!"
|
197 |
else:
|
198 |
result = "different person!"
|
|
|
204 |
"data": {
|
205 |
"result": result,
|
206 |
"similarity": float(similarity),
|
207 |
+
"face1": {"x1": int(faceRect1[0]), "y1": int(faceRect1[2]), "x2": int(faceRect1[1]), "y2" : int(faceRect1[3])},
|
208 |
+
"face2": {"x1": int(faceRect2[0]), "y1": int(faceRect2[2]), "x2": int(faceRect2[1]), "y2" : int(faceRect2[3])},
|
209 |
}
|
210 |
})
|
211 |
response.status_code = 200
|