diff --git a/Attendence/attendence.py b/Attendence/attendence.py index 87b4319..85adcc8 100644 --- a/Attendence/attendence.py +++ b/Attendence/attendence.py @@ -278,9 +278,7 @@ def submit(url_list): else: print ("pickle File not exist") print(name) - return "Please get registered with your Profile Picture",500 - # return "Face not found in profile (please change your profile)",500 - + return "Face not found in profile (please change your profile)" check_faces=People+"/" + y + "/" + y + ".jpg" print(check_faces) @@ -334,7 +332,7 @@ def submit(url_list): if (len(number_of_faces))>1: print("Group Photo") - return "Too Many Faces in Profile Picture",500 + return "Group Photo" elif (len(number_of_faces))==1: print("Single Photo") pass @@ -508,11 +506,10 @@ def detect(): try: results = pool.map(submit, url_list) except FileNotFoundError: - return 'please get registered with your PhotoID',500 + return 'plese get registered with your PhotoID' except IndexError: #return 'unable to recognize face' - #return 'failed',500 - return "Face does not Match with Profile Picture",500 + return 'failed' pool.close() @@ -539,23 +536,23 @@ def register(): # multiprocessing - #pool_size = multiprocessing.cpu_count() * 2 - #with multiprocessing.Pool(pool_size) as pool: - # try: - # results = pool.map(registered, url_list) - # except IndexError: - # pass - # print('face not found') - # except FileNotFoundError: - # pass + # pool_size = multiprocessing.cpu_count() * 2 + # with multiprocessing.Pool(pool_size) as pool: + # try: + # results = pool.map(registered, url_list) + # except IndexError: + # pass + # print('face not found') + # except FileNotFoundError: + # pass - #os.remove(img) - # return 'unable to recognize face' + # #os.remove(img) + # # return 'unable to recognize face' - # pool.close() + # pool.close() #return results[0] - result=registered(url_list) + result=registered(url_list) return 'Successfully saved encoding.........'