Shekarss commited on
Commit
30e115d
·
verified ·
1 Parent(s): a8cdc05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
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
- # Convert NumPy array to PIL Image
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"))