Spaces:
Runtime error
Runtime error
File size: 627 Bytes
3e07cca 16b6642 3e07cca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
#initialte the app
# Use the private key file of the service account directly.
cred = credentials.Certificate("./aiml-iit-ropar-56bc742ad36f.json")
app = firebase_admin.initialize_app(cred)
firestore_client = firestore.client()
# def upload(image,name):
# with open(image, "rb") as img_file:
# res = base64.b64encode(img_file.read())
# doc_ref = firestore_client.collection("faces").document(name)
# doc_ref.set(
# {
# "name": name,
# "img": res,
# }
# )
|