Update 'Attendence/attendence.py'
This commit is contained in:
+17
-20
@@ -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,23 +536,23 @@ 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:
|
||||||
# pass
|
# pass
|
||||||
# print('face not found')
|
# print('face not found')
|
||||||
# except FileNotFoundError:
|
# except FileNotFoundError:
|
||||||
# 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]
|
||||||
result=registered(url_list)
|
result=registered(url_list)
|
||||||
return 'Successfully saved encoding.........'
|
return 'Successfully saved encoding.........'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user