最新Python实现简单可学习的手写体识别_pynq上手写体识别

dim2 int not null,
dim3 int not null,
dim4 int not null,
dim5 int not null,
dim6 int not null,
dim7 int not null,
dim8 int not null)

drop table table5
create table table5
(dim0 int not null,
dim1 int not null,
dim2 int not null,
dim3 int not null,
dim4 int not null,
dim5 int not null,
dim6 int not null,
dim7 int not null,
dim8 int not null)

drop table table6
create table table6
(dim0 int not null,
dim1 int not null,
dim2 int not null,
dim3 int not null,
dim4 int not null,
dim5 int not null,
dim6 int not null,
dim7 int not null,
dim8 int not null)

drop table table7
create table table7
(dim0 int not null,
dim1 int not null,
dim2 int not null,
dim3 int not null,
dim4 int not null,
dim5 int not null,
dim6 int not null,
dim7 int not null,
dim8 int not null)

drop table table8
create table table8
(dim0 int not null,
dim1 int not null,
dim2 int not null,
dim3 int not null,
dim4 int not null,
dim5 int not null,
dim6 int not null,
dim7 int not null,
dim8 int not null)

drop table table9
create table table9
(dim0 int not null,
dim1 int not null,
dim2 int not null,
dim3 int not null,
dim4 int not null,
dim5 int not null,
dim6 int not null,
dim7 int not null,
dim8 int not null)


LearningDB.py程序如下:



‘’’
LearningDB类
功能:定义数据库类,包含一个学习函数learn_data和一个识别函数identify_data
作者:PyLearn
博客: http://www.cnblogs.com/PyLearn/
最后修改日期: 2017/10/18
‘’’
import math
import pymssql

class LearningDB():

def \_\_init\_\_(self):
    self.conn = pymssql.connect(host='127.0.0.1',
                                user='sa',
                                password='123',
                                database='PyLearningDB',
                                charset='utf8')
    self.cursor = self.conn.cursor()
    self.sql = ''
    self.distance = 0.0
    self.conn.close()

def learn\_data(self, table, dim):
    '''

学习数据,将数据存到对应的数据库
table指定哪个表,dim是维度数组
‘’’
learn_result = False

    try:
        if table < 0 or table > 9:
            raise Exception("错误!table的值为%d!" % table)
        for num in dim:
            if num < 0:
      
  • 28
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值