Rockk08 commited on
Commit
5f521ca
·
verified ·
1 Parent(s): 67a1cbf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -16
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": f'{os.getenv("API_KEY")}',
19
- "authDomain": f'{os.getenv("AUTH_DOMAIN")}',
20
- "projectId": f'{os.getenv("PROJECT_ID")}',
21
- "storageBucket": f'{os.getenv("STORAGE_BKT")}',
22
- "messagingSenderId": f'{os.getenv("S_ID")}',
23
- "appId": f'{os.getenv("APP_ID")}',
24
- "databaseURL": f'{os.getenv("DBMS_URL")}',
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"}