Husseinfo / tracker

Face recognition based attendance system

Home Page:https://husseinfo.github.io/tracker/

Repository from Github https://github.comHusseinfo/trackerRepository from Github https://github.comHusseinfo/tracker

No go to recogniser after click "Recognise" button.

YuHengKit opened this issue · comments

Just direct propmt this without any recognization.
image
Try to add some print inside the recogniser and realise the program do not enter the recognizer.

def receive_recognize(request):
if not request.user.is_authenticated():
return redirect(login)
if not request.is_ajax():
return redirect(handler404)
photos = request.POST.getlist('photos[]')
paths = []
for i, photo in enumerate(photos):
ext, img = photo.split(';base64,')
ext = ext.split('/')[-1]
name = 'static/temp/rec' + str(i) + '.' + ext
fh = open(name, 'wb')
fh.write(base64.b64decode(img))
fh.close()
paths.append('static/temp/rec' + str(i) + '.' + ext)
utility.crop_photos(paths=paths)
user_id, percentage = face_recognizer.get_image_label(*paths)
name = 'Unknown' if user_id in (-1, None) else User.objects.get(id=user_id).first_name + ' ' + User
.objects.get(id=user_id).last_name
data_rec = {'user': user_id, 'date': datetime.datetime.now(), 'inout': None}
serializer = AttendanceSerializer(data=data_rec)
if serializer.is_valid() and percentage == 100:
serializer.save()
return JsonResponse({'id': user_id, 'name': name, 'percentage': percentage})

I found here have some mistake.