Update 'face_recognition/app/app.py'
This commit is contained in:
		@@ -44,6 +44,15 @@ def new_face():
 | 
				
			|||||||
        pickle.dump(face_encoding, file)
 | 
					        pickle.dump(face_encoding, file)
 | 
				
			||||||
    minioClient.fput_object('users', str(id), '/tmp/'+str(id)+'.pkl')
 | 
					    minioClient.fput_object('users', str(id), '/tmp/'+str(id)+'.pkl')
 | 
				
			||||||
    return str(id) + str(upload_id)
 | 
					    return str(id) + str(upload_id)
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					@app.route('/check_face')
 | 
				
			||||||
 | 
					#call like https://face.sguba.de/check_face?id=123&upload_id=123
 | 
				
			||||||
 | 
					def check_face():
 | 
				
			||||||
 | 
					    id  = request.args.get('id', None)
 | 
				
			||||||
 | 
					    upload_id  = request.args.get('upload_id', None)
 | 
				
			||||||
 | 
					    minioClient.fget_object('uploads', upload_id, '/tmp/'+str(upload_id))
 | 
				
			||||||
 | 
					    face = face_recognition.load_image_file('/tmp/'+str(upload_id))
 | 
				
			||||||
 | 
					    face_encoding = face_recognition.face_encodings(face)[0]
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
def check_id(id):
 | 
					def check_id(id):
 | 
				
			||||||
    #return True -> id bereits verwendet
 | 
					    #return True -> id bereits verwendet
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user