Spaces:
Sleeping
Sleeping
Update flask/app.py
Browse files- flask/app.py +6 -6
flask/app.py
CHANGED
@@ -38,7 +38,6 @@ def activate_sdk():
|
|
38 |
ret = init_sdk(dict_path.encode('utf-8'), online_key.encode('utf-8'))
|
39 |
|
40 |
if ret == 0:
|
41 |
-
print_info(f"FR_LICENSE_KEY: {online_key}")
|
42 |
print_log("Successfully online init SDK!")
|
43 |
else:
|
44 |
print_error(f"Failed to online init SDK, Error code {ret}\n Trying offline init SDK...");
|
@@ -127,12 +126,13 @@ def decode_base64_image(base64_string: str) -> np.ndarray:
|
|
127 |
return image
|
128 |
except Exception as e:
|
129 |
raise ValueError(f"Failed to decode base64 image: {str(e)}")
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
image1: str,
|
134 |
image2: str
|
135 |
-
|
|
|
|
|
136 |
|
137 |
try:
|
138 |
image_mat1 = decode_base64_image(image1)
|
|
|
38 |
ret = init_sdk(dict_path.encode('utf-8'), online_key.encode('utf-8'))
|
39 |
|
40 |
if ret == 0:
|
|
|
41 |
print_log("Successfully online init SDK!")
|
42 |
else:
|
43 |
print_error(f"Failed to online init SDK, Error code {ret}\n Trying offline init SDK...");
|
|
|
126 |
return image
|
127 |
except Exception as e:
|
128 |
raise ValueError(f"Failed to decode base64 image: {str(e)}")
|
129 |
+
|
130 |
+
class CompareFaceRequest(BaseModel):
|
131 |
+
image1: str
|
|
|
132 |
image2: str
|
133 |
+
|
134 |
+
@app.post("/api/compare_face_base64")
|
135 |
+
async def compare_face_base64_api(request: CompareFaceRequest) -> JSONResponse:
|
136 |
|
137 |
try:
|
138 |
image_mat1 = decode_base64_image(image1)
|