├── .gitattributes ├── .gitignore ├── ChineseNumberIdentify.py ├── log.txt ├── new_samples ├── 0.1.bmp ├── 0.2.bmp ├── 0.3.bmp ├── 0.bmp ├── 1.1.bmp ├── 1.2.bmp ├── 1.3.bmp ├── 1.bmp ├── 2.1.bmp ├── 2.2.bmp ├── 2.3.bmp ├── 2.bmp ├── 3.1.bmp ├── 3.2.bmp ├── 3.3.bmp ├── 3.bmp ├── 4.1.bmp ├── 4.2.bmp ├── 4.3.bmp ├── 4.bmp ├── 5.1.bmp ├── 5.2.bmp ├── 5.3.bmp ├── 5.bmp ├── 6.1.bmp ├── 6.2.bmp ├── 6.3.bmp ├── 6.bmp ├── 7.1.bmp ├── 7.2.bmp ├── 7.3.bmp ├── 7.bmp ├── 8.1.bmp ├── 8.2.bmp ├── 8.3.bmp ├── 8.bmp ├── 9.1.bmp ├── 9.2.bmp ├── 9.3.bmp └── 9.bmp ├── new_test ├── 0.bmp ├── 1.2.bmp ├── 1.bmp ├── 2.2.bmp ├── 2.bmp ├── 3.2.bmp ├── 3.bmp ├── 4.2.bmp ├── 4.bmp ├── 5.2.bmp ├── 5.bmp ├── 6.bmp ├── 7.bmp ├── 8.bmp ├── 9.bmp └── a.bmp ├── readme.txt ├── results ├── 400-100-10new.txt ├── 400-200-10new.txt └── 400-300-10new.txt └── save ├── 400-100-10new.cPickle ├── 400-200-10new.cPickle └── 400-300-10new.cPickle /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | 5 | *.pydevproject 6 | .project 7 | .metadata 8 | bin/ 9 | tmp/ 10 | *.tmp 11 | *.bak 12 | *.swp 13 | *~.nib 14 | local.properties 15 | .classpath 16 | .settings/ 17 | .loadpath 18 | 19 | # External tool builders 20 | .externalToolBuilders/ 21 | 22 | # Locally stored "Eclipse launch configurations" 23 | *.launch 24 | 25 | # CDT-specific 26 | .cproject 27 | 28 | # PDT-specific 29 | .buildpath 30 | 31 | 32 | ################# 33 | ## Visual Studio 34 | ################# 35 | 36 | ## Ignore Visual Studio temporary files, build results, and 37 | ## files generated by popular Visual Studio add-ons. 38 | 39 | # User-specific files 40 | *.suo 41 | *.user 42 | *.sln.docstates 43 | 44 | # Build results 45 | [Dd]ebug/ 46 | [Rr]elease/ 47 | *_i.c 48 | *_p.c 49 | *.ilk 50 | *.meta 51 | *.obj 52 | *.pch 53 | *.pdb 54 | *.pgc 55 | *.pgd 56 | *.rsp 57 | *.sbr 58 | *.tlb 59 | *.tli 60 | *.tlh 61 | *.tmp 62 | *.vspscc 63 | .builds 64 | *.dotCover 65 | 66 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 67 | #packages/ 68 | 69 | # Visual C++ cache files 70 | ipch/ 71 | *.aps 72 | *.ncb 73 | *.opensdf 74 | *.sdf 75 | 76 | # Visual Studio profiler 77 | *.psess 78 | *.vsp 79 | 80 | # ReSharper is a .NET coding add-in 81 | _ReSharper* 82 | 83 | # Installshield output folder 84 | [Ee]xpress 85 | 86 | # DocProject is a documentation generator add-in 87 | DocProject/buildhelp/ 88 | DocProject/Help/*.HxT 89 | DocProject/Help/*.HxC 90 | DocProject/Help/*.hhc 91 | DocProject/Help/*.hhk 92 | DocProject/Help/*.hhp 93 | DocProject/Help/Html2 94 | DocProject/Help/html 95 | 96 | # Click-Once directory 97 | publish 98 | 99 | # Others 100 | [Bb]in 101 | [Oo]bj 102 | sql 103 | TestResults 104 | *.Cache 105 | ClientBin 106 | stylecop.* 107 | ~$* 108 | *.dbmdl 109 | Generated_Code #added for RIA/Silverlight projects 110 | 111 | # Backup & report files from converting an old project file to a newer 112 | # Visual Studio version. Backup files are not needed, because we have git ;-) 113 | _UpgradeReport_Files/ 114 | Backup*/ 115 | UpgradeLog*.XML 116 | 117 | 118 | 119 | ############ 120 | ## Windows 121 | ############ 122 | 123 | # Windows image file caches 124 | Thumbs.db 125 | 126 | # Folder config file 127 | Desktop.ini 128 | 129 | 130 | ############# 131 | ## Python 132 | ############# 133 | 134 | *.py[co] 135 | 136 | # Packages 137 | *.egg 138 | *.egg-info 139 | dist 140 | build 141 | eggs 142 | parts 143 | bin 144 | var 145 | sdist 146 | develop-eggs 147 | .installed.cfg 148 | 149 | # Installer logs 150 | pip-log.txt 151 | 152 | # Unit test / coverage reports 153 | .coverage 154 | .tox 155 | 156 | #Translations 157 | *.mo 158 | 159 | #Mr Developer 160 | .mr.developer.cfg 161 | 162 | # Mac crap 163 | .DS_Store 164 | /.vs 165 | /.vscode 166 | -------------------------------------------------------------------------------- /ChineseNumberIdentify.py: -------------------------------------------------------------------------------- 1 | #-*- coding:utf-8 -*- 2 | from pybrain.tools.shortcuts import buildNetwork 3 | from pybrain.datasets import SupervisedDataSet 4 | from pybrain.supervised.trainers import BackpropTrainer 5 | from pybrain.structure import TanhLayer 6 | 7 | import numpy as np 8 | #import os,image as Image 9 | import os 10 | from PIL import Image 11 | import cPickle 12 | #import copy_reg, copy, pickle 13 | import datetime 14 | 15 | def get_train_samples(input_num,output_num): 16 | ''' 17 | 从new_samples文件夹中读图,根据输入数和输出数制作样本,每一原始样本加入随机噪音生成100个样本 18 | ''' 19 | print('getsample start.') 20 | sam_path='./new_samples' 21 | samples = SupervisedDataSet(input_num,output_num) 22 | nlist = os.listdir(sam_path) 23 | t=int(np.sqrt(input_num)) 24 | for n in nlist: 25 | file = os.path.join(sam_path,n) 26 | im = Image.open(file) 27 | im = im.convert('L') 28 | im = im.resize((t,t),Image.BILINEAR) 29 | buf = np.array(im).reshape(input_num,1) 30 | buf = buf<200 31 | buf = tuple(buf) 32 | buf1=int(n.split('.')[0]) 33 | buf2=range(output_num) 34 | for i in range(len(buf2)): 35 | buf2[i] = 0 36 | buf2[buf1]=1 37 | buf2 = tuple(buf2) 38 | samples.addSample(buf,buf2) 39 | for i in range(100): 40 | buf3 = list(buf) 41 | for j in range(len(buf)/20): 42 | buf3[np.random.randint(len(buf))] = bool(np.random.randint(2)) 43 | samples.addSample(tuple(buf3),buf2) 44 | return samples 45 | 46 | def get_test_samples(input_num): 47 | ''' 48 | 从new_test文件夹读取测试数据 49 | ''' 50 | print('Get test samples start.') 51 | test_path='./new_test' 52 | samples = SupervisedDataSet(input_num,1) 53 | nlist = os.listdir(test_path) 54 | t=int(np.sqrt(input_num)) 55 | for n in nlist: 56 | file = os.path.join(test_path,n) 57 | im = Image.open(file) 58 | im = im.convert('L') 59 | im = im.resize((t,t),Image.BILINEAR) 60 | buf = np.array(im).reshape(input_num,1) 61 | buf = buf<200 62 | buf = tuple(buf) 63 | samples.addSample(buf,1) 64 | return samples 65 | 66 | 67 | 68 | 69 | class net(object): 70 | ''' 71 | 网络的定义 72 | ''' 73 | def __init__(self,input_num,hide_node_num,output_num): 74 | ''' 75 | 根据参数初始化网络 76 | ''' 77 | self.input_num = input_num 78 | self.hide_node_num = hide_node_num 79 | self.output_num = output_num 80 | self.network = buildNetwork(input_num,hide_node_num,output_num,bias=True) #响应函数和层数可在此调 81 | 82 | def train(self,samples,epsilon): 83 | ''' 84 | 训练函数 85 | ''' 86 | print('Train start.') 87 | trainer = BackpropTrainer(self.network,samples) #学习率可在此调 88 | e = 100 89 | n=0 90 | while e>epsilon: 91 | e=trainer.train() 92 | n+=1 93 | print(n,' done,e=',e) 94 | if not n%10: 95 | self.save() 96 | if n>=100:break 97 | self.save() 98 | print('Train end.') 99 | return e 100 | 101 | def run(self,samples): 102 | ''' 103 | 测试 104 | ''' 105 | print('Test start.') 106 | result = [] 107 | for sample in samples['input']: 108 | buf = self.network.activate(sample) 109 | buf= list(buf) 110 | result.append(buf.index(max(buf))) 111 | print('Result ',result) 112 | result_path = './results/' 113 | filename = str(self.input_num)+'-'+str(self.hide_node_num)+'-'+str(self.output_num)+'new.txt' 114 | with open(result_path+filename,'w') as f: 115 | result = str(result) 116 | f.write(result) 117 | 118 | def save(self): 119 | ''' 120 | 保存训练好的网络 121 | ''' 122 | print('saving') 123 | save_path = './save/' 124 | filename = str(self.input_num)+'-'+str(self.hide_node_num)+'-'+str(self.output_num)+'new.cPickle' 125 | with open(save_path+filename,'wb') as f: 126 | cPickle.dump(self.network,f) 127 | print('done') 128 | 129 | def load(self): 130 | ''' 131 | 从存档中加载训练好的网络 132 | ''' 133 | print('loading') 134 | save_path ='./save/' 135 | filename = str(self.input_num)+'-'+str(self.hide_node_num)+'-'+str(self.output_num)+'new.cPickle' 136 | if filename in os.listdir('./save/'): 137 | with open(save_path+filename,'r') as f: 138 | self.network = cPickle.load(f) 139 | print('done') 140 | 141 | 142 | def main(): 143 | ''' 144 | 主函数,定义程序运行过程 145 | ''' 146 | start=datetime.datetime.now() 147 | output_num = 10 148 | epsilon = 0.01 149 | input_num=20*20 150 | hide_node_num = 200 151 | filename = str(input_num)+'-'+str(hide_node_num)+'-'+str(output_num)+'new.cPickle' 152 | net1 = net(input_num,hide_node_num,output_num) 153 | if filename in os.listdir('./save/'): 154 | net1.load() 155 | else: 156 | samples = get_train_samples(input_num,output_num) 157 | net1.train(samples,epsilon) 158 | net1.save() 159 | net1.run(get_test_samples(input_num)) 160 | end =datetime.datetime.now() 161 | print('Time ',end-start) 162 | 163 | main() 164 | -------------------------------------------------------------------------------- /log.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/log.txt -------------------------------------------------------------------------------- /new_samples/0.1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/0.1.bmp -------------------------------------------------------------------------------- /new_samples/0.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/0.2.bmp -------------------------------------------------------------------------------- /new_samples/0.3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/0.3.bmp -------------------------------------------------------------------------------- /new_samples/0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/0.bmp -------------------------------------------------------------------------------- /new_samples/1.1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/1.1.bmp -------------------------------------------------------------------------------- /new_samples/1.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/1.2.bmp -------------------------------------------------------------------------------- /new_samples/1.3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/1.3.bmp -------------------------------------------------------------------------------- /new_samples/1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/1.bmp -------------------------------------------------------------------------------- /new_samples/2.1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/2.1.bmp -------------------------------------------------------------------------------- /new_samples/2.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/2.2.bmp -------------------------------------------------------------------------------- /new_samples/2.3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/2.3.bmp -------------------------------------------------------------------------------- /new_samples/2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/2.bmp -------------------------------------------------------------------------------- /new_samples/3.1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/3.1.bmp -------------------------------------------------------------------------------- /new_samples/3.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/3.2.bmp -------------------------------------------------------------------------------- /new_samples/3.3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/3.3.bmp -------------------------------------------------------------------------------- /new_samples/3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/3.bmp -------------------------------------------------------------------------------- /new_samples/4.1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/4.1.bmp -------------------------------------------------------------------------------- /new_samples/4.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/4.2.bmp -------------------------------------------------------------------------------- /new_samples/4.3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/4.3.bmp -------------------------------------------------------------------------------- /new_samples/4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/4.bmp -------------------------------------------------------------------------------- /new_samples/5.1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/5.1.bmp -------------------------------------------------------------------------------- /new_samples/5.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/5.2.bmp -------------------------------------------------------------------------------- /new_samples/5.3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/5.3.bmp -------------------------------------------------------------------------------- /new_samples/5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/5.bmp -------------------------------------------------------------------------------- /new_samples/6.1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/6.1.bmp -------------------------------------------------------------------------------- /new_samples/6.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/6.2.bmp -------------------------------------------------------------------------------- /new_samples/6.3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/6.3.bmp -------------------------------------------------------------------------------- /new_samples/6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/6.bmp -------------------------------------------------------------------------------- /new_samples/7.1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/7.1.bmp -------------------------------------------------------------------------------- /new_samples/7.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/7.2.bmp -------------------------------------------------------------------------------- /new_samples/7.3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/7.3.bmp -------------------------------------------------------------------------------- /new_samples/7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/7.bmp -------------------------------------------------------------------------------- /new_samples/8.1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/8.1.bmp -------------------------------------------------------------------------------- /new_samples/8.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/8.2.bmp -------------------------------------------------------------------------------- /new_samples/8.3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/8.3.bmp -------------------------------------------------------------------------------- /new_samples/8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/8.bmp -------------------------------------------------------------------------------- /new_samples/9.1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/9.1.bmp -------------------------------------------------------------------------------- /new_samples/9.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/9.2.bmp -------------------------------------------------------------------------------- /new_samples/9.3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/9.3.bmp -------------------------------------------------------------------------------- /new_samples/9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_samples/9.bmp -------------------------------------------------------------------------------- /new_test/0.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/0.bmp -------------------------------------------------------------------------------- /new_test/1.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/1.2.bmp -------------------------------------------------------------------------------- /new_test/1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/1.bmp -------------------------------------------------------------------------------- /new_test/2.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/2.2.bmp -------------------------------------------------------------------------------- /new_test/2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/2.bmp -------------------------------------------------------------------------------- /new_test/3.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/3.2.bmp -------------------------------------------------------------------------------- /new_test/3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/3.bmp -------------------------------------------------------------------------------- /new_test/4.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/4.2.bmp -------------------------------------------------------------------------------- /new_test/4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/4.bmp -------------------------------------------------------------------------------- /new_test/5.2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/5.2.bmp -------------------------------------------------------------------------------- /new_test/5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/5.bmp -------------------------------------------------------------------------------- /new_test/6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/6.bmp -------------------------------------------------------------------------------- /new_test/7.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/7.bmp -------------------------------------------------------------------------------- /new_test/8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/8.bmp -------------------------------------------------------------------------------- /new_test/9.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/9.bmp -------------------------------------------------------------------------------- /new_test/a.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zwy1135/ChineseNumberIdentify/af7b351a1ca769b880bbe76e10cca74262955cbc/new_test/a.bmp -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | ``` 2 | 这是一个用python编写的神经网络程序,用以从图片中识别单个中文数字(零~九)。 3 | 使用了pybrain,以及作为其基础的numpy和scipy这两个包,PIL包,和python的标准库。 4 | 这个程序原本是用来交课堂作业的,但是想到一定有人和我一样在查找资料时一无所获很头疼,所以就发上来了。大家有爱自取。 5 | 除引用的内容(即以上提到的引用包)外,其余代码的著作权归作者(z wy)所有。你可以: 6 | 7 | 下载、保存以及打印本程序代码。 8 | 网络链接、转载本程序的部分或者全部内容,但是必须在明显处提供读者访问本程序发布网站的链接。 9 | 在你的程序中任意使用本程序代码,但是由本程序所引起的任何问题,作者不承担任何责任。 10 | ``` 11 | 12 | # Py2 13 | 14 | 输入: new_test目录下的图片 15 | 输出: results目录下对应的文本 16 | -------------------------------------------------------------------------------- /results/400-100-10new.txt: -------------------------------------------------------------------------------- 1 | [0, 1, 1, 1, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 1] -------------------------------------------------------------------------------- /results/400-200-10new.txt: -------------------------------------------------------------------------------- 1 | [0, 1, 1, 2, 2, 3, 2, 4, 4, 5, 5, 6, 4, 8, 9, 4] -------------------------------------------------------------------------------- /results/400-300-10new.txt: -------------------------------------------------------------------------------- 1 | [0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 5] --------------------------------------------------------------------------------