Update 'face_recognition/app/app.py'
This commit is contained in:
		@@ -47,13 +47,13 @@ def new_face():
 | 
				
			|||||||
    #    file.write(bytearray(imgdata))
 | 
					    #    file.write(bytearray(imgdata))
 | 
				
			||||||
    save_img(img.encode(), '/tmp/'+str(id)+'.jpg')
 | 
					    save_img(img.encode(), '/tmp/'+str(id)+'.jpg')
 | 
				
			||||||
    #to debug send img
 | 
					    #to debug send img
 | 
				
			||||||
    minioClient.fput_object('users', str(id)+'.jpg', '/tmp/'+str(id)+'.jpg')
 | 
					    #minioClient.fput_object('users', str(id)+'.jpg', '/tmp/'+str(id)+'.jpg')
 | 
				
			||||||
    face = face_recognition.load_image_file('/tmp/'+str(id)+'.jpg')
 | 
					    #face = face_recognition.load_image_file('/tmp/'+str(id)+'.jpg')
 | 
				
			||||||
    face_encoding = face_recognition.face_encodings(face)[0]
 | 
					    #face_encoding = face_recognition.face_encodings(face)[0]
 | 
				
			||||||
    with open('/tmp/'+str(id)+'.pkl', 'wb') as file:
 | 
					    #with open('/tmp/'+str(id)+'.pkl', 'wb') as file:
 | 
				
			||||||
        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)
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
@app.route('/check_face')
 | 
					@app.route('/check_face')
 | 
				
			||||||
#call like https://face.sguba.de/check_face?id=123&encoded_string=abc
 | 
					#call like https://face.sguba.de/check_face?id=123&encoded_string=abc
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user