Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mtcnn_model_name="Onet",
factor=0.79,
min_face_size=10,
threshold=[0.8,0.8,0.6]):
model=[None,None,None]
if(mtcnn_model_name in ["Pnet","Rnet","Onet"]):
model[0]=MTCNN_model.Pnet_model
if(mtcnn_model_name in ["Rnet","Onet"]):
model[1]=MTCNN_model.Rnet_model
if(mtcnn_model_name=="Onet"):
model[2]=MTCNN_model.Onet_model
self.img_size_list = image_size
self.face_detector = mtcnn_detector.MTCNN_Detector(model,mtcnn_model_path,batch_size,factor,min_face_size,threshold)
self.recognizer = recognizer.Recognizer(arc_model_name, arc_model_path, size_to_predict, self.img_size_list)
self.image_size = str(image_size[0]) + "," + str(image_size[1])
self.database = database
db = pymysql.connect(host=host, user=user, password=password, port=port, charset="utf8" )
self.cursor = db.cursor()
self.cursor.execute("USE %s;"%(database))
self.cursor.execute("ALTER DATABASE %s character SET gbk;"%(database))