-
大小: 5.8MB文件类型: .zip金币: 2下载: 0 次发布日期: 2023-11-17
- 语言: Python
- 标签: OCR python开发 js+css+html
资源简介
这是一个用ANN(人工神经网络)对手写数字进行识别的程序。
有以下一些特性:
1)前端(网页)用JavaScript,html 5,css开发;
2)后端(服务器)用python写的(2.7版本);
3)功能:#支持在网页画布上(用鼠标)写数字,并会返回预测结果;
#支持重置网页画布;
#支持向服务器发送训练样本;
#支持图片预览,图片上传;
#支持对上传的图片中英文字母的识别。
这是一个非常酷的程序,C/S架构,代码也不是很复杂,而且设计了一些很有趣的知识(机器学习,神经网络,http数据传递,前后端开发等等)。感兴趣的同学可以下载下来看一看,有不懂的可以评论留言。

代码片段和文件信息
“““
In order to decide how many hidden nodes the hidden layer should have
split up the data set into training and testing data and create networks
with various hidden node counts (5 10 15 ... 45) testing the performance
for each.
The best-performing node count is used in the actual system. If multiple counts
perform similarly choose the smallest count for a smaller network with fewer computations.
“““
import numpy as np
from ocr import OCRNeuralNetwork
from sklearn.cross_validation import train_test_split
def test(data_matrix data_labels test_indices nn):
avg_sum = 0
for j in xrange(100):
correct_guess_count = 0
for i in test_indices:
test = data_matrix[i]
prediction = nn.predict(test)
if data_labels[i] == prediction:
correct_guess_count += 1
avg_sum += (correct_guess_count / float(len(test_indices)))
return avg_sum / 100
# Load data samples and labels into matrix
data_matrix = np.loadtxt(open(‘data.csv‘ ‘rb‘) delimiter = ‘‘).tolist()
data_labels = np.loadtxt(open(‘dataLabels.csv‘ ‘rb‘)).tolist()
# Create training and testing sets.
train_indices test_indices = train_test_split(list(range(5000)))
print “PERFORMANCE“
print “-----------“
# Try various number of hidden nodes and see what performs best
# for i in xrange(5 50 5):
i=100
nn = OCRNeuralNetwork(i data_matrix data_labels train_indices False)
performance = str(test(data_matrix data_labels test_indices nn))
print “{i} Hidden Nodes: {val}“.format(i=i val=performance)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 26337792 2018-06-29 08:14 data.csv
文件 10000 2018-06-29 08:07 dataLabels.csv
文件 248949 2018-07-02 17:53 jquery.js
文件 1564 2018-07-02 16:56 neural_network_design.py
文件 179055 2018-07-04 20:37 nn.json
文件 6062 2018-07-04 20:45 ocr.html
文件 10706 2018-07-04 20:44 ocr.js
文件 5270 2018-07-02 13:27 ocr.py
文件 3719 2018-07-04 15:10 server.py
相关资源
- Python-BDD100K大规模多样化驾驶视频数据
- Python开发的个人博客
- Python-直播答题助手自动检测出题搜索
- Python开发的全栈股票系统.zip
- Python-gzipencoding如何压缩HTTP请求发送到
- Python-DeepMoji模型的pyTorch实现
- Python-京东抢购助手包含登录查询商品
- Python-本项目基于yolo3与crnn实现中文自
- Python-PySimpleGUI一个建立在tkinter之上简
- Python-使用DeepFakes实现YouTube视频自动换
- Python-中国科学院大学教务抢课程序多
- Python-一系列高品质的动漫人脸数据集
- Python-Insightface人脸检测识别的最小化
- Python-自然场景文本检测PSENet的一个
- Python-在特征金字塔网络FPN的Pytorch实现
- Python-PyTorch实时多人姿态估计项目的实
- Python-用PyTorch10实现FasterRCNN和MaskRCNN比
- Python-心脏核磁共振MRI图像分割
- Python-基于YOLOv3的行人检测
- Python-数据结构与算法leetcodelintcode题解
- Python-RLSeq2Seq用于SequencetoSequence模型的
- Python-PyTorch对卷积CRF的参考实现
- Python-高效准确的EAST文本检测器的一个
- Python-BilibiliLiveBarrage实时监控B站直播
- Python-利用Python图虫网摄影作品
- Python-pytorch实现的人脸检测和人脸识别
- Python-UNet用于医学图像分割的嵌套UN
- Python-TensorFlow弱监督图像分割
- Python-基于tensorflow实现的用textcnn方法
- Python-Keras实现Inceptionv4InceptionResnetv1和
评论
共有 条评论