Update app.py
Browse files
app.py
CHANGED
@@ -74,9 +74,9 @@ def save_to_database(name, roll_no, image_path):
|
|
74 |
conn.close()
|
75 |
|
76 |
def save_image_to_hugging_face(image, name, roll_no):
|
77 |
-
""" Saves the image locally and uploads it to Hugging Face. """
|
78 |
filename = f"{name}_{roll_no}.jpg"
|
79 |
-
local_path = os.path.join(KNOWN_FACES_DIR, filename)
|
80 |
image.save(local_path)
|
81 |
|
82 |
try:
|
@@ -87,6 +87,7 @@ def save_image_to_hugging_face(image, name, roll_no):
|
|
87 |
|
88 |
return local_path
|
89 |
|
|
|
90 |
# Initialize the database when the app starts
|
91 |
initialize_database()
|
92 |
|
|
|
74 |
conn.close()
|
75 |
|
76 |
def save_image_to_hugging_face(image, name, roll_no):
|
77 |
+
""" Saves the image locally to the KNOWN_FACES_DIR and uploads it to Hugging Face. """
|
78 |
filename = f"{name}_{roll_no}.jpg"
|
79 |
+
local_path = os.path.join(KNOWN_FACES_DIR, filename) # Ensure it's saved in the known_faces directory
|
80 |
image.save(local_path)
|
81 |
|
82 |
try:
|
|
|
87 |
|
88 |
return local_path
|
89 |
|
90 |
+
|
91 |
# Initialize the database when the app starts
|
92 |
initialize_database()
|
93 |
|