|
@@ -278,9 +278,7 @@ def submit(url_list):
|
278
|
278
|
else:
|
279
|
279
|
print ("pickle File not exist")
|
280
|
280
|
print(name)
|
281
|
|
- return "Please get registered with your Profile Picture",500
|
282
|
|
- # return "Face not found in profile (please change your profile)",500
|
283
|
|
-
|
|
281
|
+ return "Face not found in profile (please change your profile)"
|
284
|
282
|
|
285
|
283
|
check_faces=People+"/" + y + "/" + y + ".jpg"
|
286
|
284
|
print(check_faces)
|
|
@@ -334,7 +332,7 @@ def submit(url_list):
|
334
|
332
|
|
335
|
333
|
if (len(number_of_faces))>1:
|
336
|
334
|
print("Group Photo")
|
337
|
|
- return "Too Many Faces in Profile Picture",500
|
|
335
|
+ return "Group Photo"
|
338
|
336
|
elif (len(number_of_faces))==1:
|
339
|
337
|
print("Single Photo")
|
340
|
338
|
pass
|
|
@@ -508,11 +506,10 @@ def detect():
|
508
|
506
|
try:
|
509
|
507
|
results = pool.map(submit, url_list)
|
510
|
508
|
except FileNotFoundError:
|
511
|
|
- return 'please get registered with your PhotoID',500
|
|
509
|
+ return 'plese get registered with your PhotoID'
|
512
|
510
|
except IndexError:
|
513
|
511
|
#return 'unable to recognize face'
|
514
|
|
- #return 'failed',500
|
515
|
|
- return "Face does not Match with Profile Picture",500
|
|
512
|
+ return 'failed'
|
516
|
513
|
|
517
|
514
|
pool.close()
|
518
|
515
|
|
|
@@ -539,23 +536,23 @@ def register():
|
539
|
536
|
|
540
|
537
|
|
541
|
538
|
# multiprocessing
|
542
|
|
- #pool_size = multiprocessing.cpu_count() * 2
|
543
|
|
- #with multiprocessing.Pool(pool_size) as pool:
|
544
|
|
- # try:
|
545
|
|
- # results = pool.map(registered, url_list)
|
546
|
|
- # except IndexError:
|
547
|
|
- # pass
|
548
|
|
- # print('face not found')
|
549
|
|
- # except FileNotFoundError:
|
550
|
|
- # pass
|
|
539
|
+ # pool_size = multiprocessing.cpu_count() * 2
|
|
540
|
+ # with multiprocessing.Pool(pool_size) as pool:
|
|
541
|
+ # try:
|
|
542
|
+ # results = pool.map(registered, url_list)
|
|
543
|
+ # except IndexError:
|
|
544
|
+ # pass
|
|
545
|
+ # print('face not found')
|
|
546
|
+ # except FileNotFoundError:
|
|
547
|
+ # pass
|
551
|
548
|
|
552
|
549
|
|
553
|
|
- #os.remove(img)
|
554
|
|
- # return 'unable to recognize face'
|
|
550
|
+ # #os.remove(img)
|
|
551
|
+ # # return 'unable to recognize face'
|
555
|
552
|
|
556
|
|
- # pool.close()
|
|
553
|
+ # pool.close()
|
557
|
554
|
#return results[0]
|
558
|
|
- result=registered(url_list)
|
|
555
|
+ result=registered(url_list)
|
559
|
556
|
return 'Successfully saved encoding.........'
|
560
|
557
|
|
561
|
558
|
|