Spaces:
Runtime error
Runtime error
Testing
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ app = Flask(__name__)
|
|
| 21 |
app.config['SITE'] = "http://0.0.0.0:8000/"
|
| 22 |
app.config['DEBUG'] = False
|
| 23 |
|
| 24 |
-
licenseKey = "
|
| 25 |
licensePath = "license.txt"
|
| 26 |
modelFolder = os.path.abspath(os.path.dirname(__file__)) + '/facewrapper/dict'
|
| 27 |
|
|
@@ -107,9 +107,9 @@ def compare_face():
|
|
| 107 |
|
| 108 |
similarity = ttv_compare_feature(feature1, feature2)
|
| 109 |
if similarity > 0.7:
|
| 110 |
-
result = "same
|
| 111 |
else:
|
| 112 |
-
result = "different
|
| 113 |
|
| 114 |
status = "ok"
|
| 115 |
response = jsonify(
|
|
@@ -191,11 +191,13 @@ def coompare_face_base64():
|
|
| 191 |
response.headers["Content-Type"] = "application/json; charset=utf-8"
|
| 192 |
return response
|
| 193 |
|
|
|
|
|
|
|
| 194 |
similarity = ttv_compare_feature(feature1, feature2)
|
| 195 |
if similarity > 0.7:
|
| 196 |
-
result = "same
|
| 197 |
else:
|
| 198 |
-
result = "different
|
| 199 |
|
| 200 |
status = "ok"
|
| 201 |
response = jsonify(
|
|
|
|
| 21 |
app.config['SITE'] = "http://0.0.0.0:8000/"
|
| 22 |
app.config['DEBUG'] = False
|
| 23 |
|
| 24 |
+
licenseKey = os.environ.get("LICENSE_KEY")
|
| 25 |
licensePath = "license.txt"
|
| 26 |
modelFolder = os.path.abspath(os.path.dirname(__file__)) + '/facewrapper/dict'
|
| 27 |
|
|
|
|
| 107 |
|
| 108 |
similarity = ttv_compare_feature(feature1, feature2)
|
| 109 |
if similarity > 0.7:
|
| 110 |
+
result = "same"
|
| 111 |
else:
|
| 112 |
+
result = "different"
|
| 113 |
|
| 114 |
status = "ok"
|
| 115 |
response = jsonify(
|
|
|
|
| 191 |
response.headers["Content-Type"] = "application/json; charset=utf-8"
|
| 192 |
return response
|
| 193 |
|
| 194 |
+
feature32 = np.frombuffer(feature1, dtype=np.float32, 512)
|
| 195 |
+
print(feature32)
|
| 196 |
similarity = ttv_compare_feature(feature1, feature2)
|
| 197 |
if similarity > 0.7:
|
| 198 |
+
result = "same"
|
| 199 |
else:
|
| 200 |
+
result = "different"
|
| 201 |
|
| 202 |
status = "ok"
|
| 203 |
response = jsonify(
|