Spaces:
Running
Running
minor chnage
Browse files- .gitignore +1 -0
- app.py +8 -2
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
docker-compose.yml
|
app.py
CHANGED
|
@@ -19,6 +19,12 @@ def verify(v: Verify) -> bool:
|
|
| 19 |
selfie = data["image"]
|
| 20 |
gallery = data["images"]
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
true_count = 0
|
| 23 |
for image in gallery:
|
| 24 |
try:
|
|
@@ -26,7 +32,7 @@ def verify(v: Verify) -> bool:
|
|
| 26 |
if result.get("verified", False):
|
| 27 |
true_count += 1
|
| 28 |
if true_count >= 2:
|
| 29 |
-
return True
|
| 30 |
except Exception as e:
|
| 31 |
print(e)
|
| 32 |
-
return False
|
|
|
|
| 19 |
selfie = data["image"]
|
| 20 |
gallery = data["images"]
|
| 21 |
|
| 22 |
+
import requests
|
| 23 |
+
res = requests.get(gallery[0], stream=True)
|
| 24 |
+
with open("x.jpg", "wb") as out_file:
|
| 25 |
+
out_file.write(res.content)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
true_count = 0
|
| 29 |
for image in gallery:
|
| 30 |
try:
|
|
|
|
| 32 |
if result.get("verified", False):
|
| 33 |
true_count += 1
|
| 34 |
if true_count >= 2:
|
| 35 |
+
return True, image
|
| 36 |
except Exception as e:
|
| 37 |
print(e)
|
| 38 |
+
return False, None
|