Update 'Attendence/attendence.py'

This commit is contained in:
2024-01-10 12:33:08 +00:00
parent 90f8344ab3
commit ff2ec9ff9e
+8 -11
View File
@@ -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()
@@ -539,8 +536,8 @@ def register():
# multiprocessing # multiprocessing
#pool_size = multiprocessing.cpu_count() * 2 # pool_size = multiprocessing.cpu_count() * 2
#with multiprocessing.Pool(pool_size) as pool: # with multiprocessing.Pool(pool_size) as pool:
# try: # try:
# results = pool.map(registered, url_list) # results = pool.map(registered, url_list)
# except IndexError: # except IndexError:
@@ -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]