Spaces:
Runtime error
Runtime error
Testing
Browse files
app.py
CHANGED
@@ -105,8 +105,10 @@ def compare_face():
|
|
105 |
response.headers["Content-Type"] = "application/json; charset=utf-8"
|
106 |
return response
|
107 |
|
108 |
-
feature32_1 =
|
109 |
-
|
|
|
|
|
110 |
print('===========================', (1 + np.dot(feature32_1, feature32_2)) / 2)
|
111 |
feature32 = np.frombuffer(feature1, dtype=np.float32, count=512)
|
112 |
|
|
|
105 |
response.headers["Content-Type"] = "application/json; charset=utf-8"
|
106 |
return response
|
107 |
|
108 |
+
feature32_1 = feature1.view(dtype=np.float32)
|
109 |
+
feature32_1 = feature32_1 / np.linalg.norm(feature32_1)
|
110 |
+
feature32_2 = feature2.view(dtype=np.float32)
|
111 |
+
feature32_2 = feature32_2 / np.linalg.norm(feature32_2)
|
112 |
print('===========================', (1 + np.dot(feature32_1, feature32_2)) / 2)
|
113 |
feature32 = np.frombuffer(feature1, dtype=np.float32, count=512)
|
114 |
|