使用Python从SQL Server存储和检索.yml文件

2024-09-28 17:28:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我的问题是,我有一个Python脚本,它为面部识别创建了一个机器学习模型(cv2.face\u LBPHFaceRecognizer),我正在本地主机上以.yaml格式存储该模型(大小约为900KB到1MB)。我打算将其与模型ID一起存储在SQL Server的表中,并使用模型ID从SQL查询中检索模型

def store_model(file,model_id):
    #file is of type cv2.face_LBPHFaceRecognizer
    #code to store file and model_id in table

del retrieve_model(model_id):
    #code to return model pertaining to model_id
    return file

我需要有关创建表的查询的帮助,特别是关于存储模型的数据类型以及完成上述功能的帮助

多谢各位


Tags: tostore模型脚本机器idsqlmodel