Update 'Attendence/attendence.py'

Этот коммит содержится в:
2024-01-10 12:33:08 +00:00
родитель 90f8344ab3
Коммит ff2ec9ff9e
+6 -9
Просмотреть файл
@@ -278,9 +278,7 @@ def submit(url_list):
else: else:
print ("pickle File not exist") print ("pickle File not exist")
print(name) print(name)
return "Please get registered with your Profile Picture",500 return "Face not found in profile (please change your profile)"
# return "Face not found in profile (please change your profile)",500
check_faces=People+"/" + y + "/" + y + ".jpg" check_faces=People+"/" + y + "/" + y + ".jpg"
print(check_faces) print(check_faces)
@@ -334,7 +332,7 @@ def submit(url_list):
if (len(number_of_faces))>1: if (len(number_of_faces))>1:
print("Group Photo") print("Group Photo")
return "Too Many Faces in Profile Picture",500 return "Group Photo"
elif (len(number_of_faces))==1: elif (len(number_of_faces))==1:
print("Single Photo") print("Single Photo")
pass pass
@@ -508,11 +506,10 @@ def detect():
try: try:
results = pool.map(submit, url_list) results = pool.map(submit, url_list)
except FileNotFoundError: except FileNotFoundError:
return 'please get registered with your PhotoID',500 return 'plese get registered with your PhotoID'
except IndexError: except IndexError:
#return 'unable to recognize face' #return 'unable to recognize face'
#return 'failed',500 return 'failed'
return "Face does not Match with Profile Picture",500
pool.close() pool.close()
@@ -550,8 +547,8 @@ def register():
# pass # pass
#os.remove(img) # #os.remove(img)
# return 'unable to recognize face' # # return 'unable to recognize face'
# pool.close() # pool.close()
#return results[0] #return results[0]