Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import requests
|
2 |
import pyrebase
|
3 |
-
import os
|
4 |
import urllib
|
5 |
from retinaface import RetinaFace
|
6 |
from deepface import DeepFace
|
@@ -14,14 +13,14 @@ def read_root():
|
|
14 |
|
15 |
@app.get("/verify/")
|
16 |
def verify_image(url1):
|
17 |
-
firebaseConfig =
|
18 |
-
"apiKey":
|
19 |
-
"authDomain":
|
20 |
-
"projectId":
|
21 |
-
"storageBucket":
|
22 |
-
"messagingSenderId":
|
23 |
-
"appId":
|
24 |
-
"databaseURL":
|
25 |
"serviceAccount":"Firebase_Service_Account_Keys.json"
|
26 |
};
|
27 |
firebase = pyrebase.initialize_app(firebaseConfig)
|
@@ -43,15 +42,9 @@ def verify_image(url1):
|
|
43 |
end_index = file.name.rfind('$')
|
44 |
if start_index != -1 and end_index != -1:
|
45 |
name = file.name[start_index + 1:end_index]
|
46 |
-
path = f"{name}/"
|
47 |
-
files_username = storage.bucket.list_blobs(prefix=path)
|
48 |
-
for file_username in files_username:
|
49 |
-
if (file_username.name.endswith(".json")):
|
50 |
-
url_username = storage.child(f"{file_username.name}").get_url(None)
|
51 |
-
with requests.get(url_username) as response_username:
|
52 |
-
metadata = response_username.json()
|
53 |
return {"username": name}
|
54 |
|
|
|
55 |
if flag == False:
|
56 |
print("Not Verified")
|
57 |
return {"username": "Not Found"}
|
|
|
1 |
import requests
|
2 |
import pyrebase
|
|
|
3 |
import urllib
|
4 |
from retinaface import RetinaFace
|
5 |
from deepface import DeepFace
|
|
|
13 |
|
14 |
@app.get("/verify/")
|
15 |
def verify_image(url1):
|
16 |
+
firebaseConfig ={
|
17 |
+
"apiKey": "AIzaSyClnRJAnrJgAgkYjuYnlvu-CJ6Cxyklebo",
|
18 |
+
"authDomain": "socioverse-2025.firebaseapp.com",
|
19 |
+
"projectId": "socioverse-2025",
|
20 |
+
"storageBucket": "socioverse-2025.appspot.com",
|
21 |
+
"messagingSenderId": "689574504641",
|
22 |
+
"appId": "1:689574504641:web:a22f6a2fa343e4221acc40",
|
23 |
+
"databaseURL": "https://console.firebase.google.com/project/socioverse-2025/storage/socioverse-2025.appspot.com/files",
|
24 |
"serviceAccount":"Firebase_Service_Account_Keys.json"
|
25 |
};
|
26 |
firebase = pyrebase.initialize_app(firebaseConfig)
|
|
|
42 |
end_index = file.name.rfind('$')
|
43 |
if start_index != -1 and end_index != -1:
|
44 |
name = file.name[start_index + 1:end_index]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
return {"username": name}
|
46 |
|
47 |
+
|
48 |
if flag == False:
|
49 |
print("Not Verified")
|
50 |
return {"username": "Not Found"}
|