Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,11 +14,9 @@ from PIL import Image
|
|
| 14 |
|
| 15 |
def register_user(name, image):
|
| 16 |
if image is None or not name.strip():
|
| 17 |
-
return "❌ Please provide a name and photo."
|
| 18 |
|
| 19 |
-
|
| 20 |
-
image = Image.fromarray(image.astype("uint8"))
|
| 21 |
-
|
| 22 |
user_path = os.path.join(registration_dir, name)
|
| 23 |
os.makedirs(user_path, exist_ok=True)
|
| 24 |
image.save(os.path.join(user_path, f"{name}_1.jpg"))
|
|
|
|
| 14 |
|
| 15 |
def register_user(name, image):
|
| 16 |
if image is None or not name.strip():
|
| 17 |
+
return "❌ Please provide a name and webcam photo."
|
| 18 |
|
| 19 |
+
image = Image.fromarray(image.astype("uint8")) # Ensure PIL format
|
|
|
|
|
|
|
| 20 |
user_path = os.path.join(registration_dir, name)
|
| 21 |
os.makedirs(user_path, exist_ok=True)
|
| 22 |
image.save(os.path.join(user_path, f"{name}_1.jpg"))
|