├── .idea
├── OCR.iml
├── misc.xml
├── modules.xml
└── workspace.xml
├── AboutDialog.py
├── BankCardRecognize.py
├── BasicRecognize.py
├── CarCardRecognize.py
├── DriveCardRecognize.py
├── HomePageWidget.py
├── IDCardRecognize.py
├── MainWindow.py
├── MainWindow.spec
├── PlateRecognize.py
├── README.md
├── RecognizeDialog.py___jb_tmp___
├── RecordDetail.py
├── RecordDetail_id.py
├── RecordsViewer.py
├── __pycache__
├── AboutDialog.cpython-36.pyc
├── BankCardRecognize.cpython-36.pyc
├── BasicRecognize.cpython-36.pyc
├── CarCardRecognize.cpython-36.pyc
├── DriveCardRecognize.cpython-36.pyc
├── HomePageWidget.cpython-36.pyc
├── IDCardRecognize.cpython-36.pyc
├── MainWindow.cpython-36.pyc
├── PlateRecognize.cpython-36.pyc
├── RecordDetail.cpython-36.pyc
├── RecordDetail_id.cpython-36.pyc
└── RecordsViewer.cpython-36.pyc
├── db
├── myOCR.db
└── myPet.db
├── images
├── QQ截图20181127222748.jpg
├── bankcard_test.jpg
├── basic_test.jpg
├── carcard_test.jpg
├── drivecard_test.jpg
├── icon.png
├── plate_test.jpg
├── title.png
├── 下载.jpg
├── 下载1.jpg
├── 下载2.jpg
└── 下载3.jpg
└── venv
├── Lib
└── tcl8.6
│ └── init.tcl
├── Scripts
├── Activate.ps1
├── _asyncio.pyd
├── _bz2.pyd
├── _ctypes.pyd
├── _ctypes_test.pyd
├── _decimal.pyd
├── _elementtree.pyd
├── _hashlib.pyd
├── _lzma.pyd
├── _msi.pyd
├── _multiprocessing.pyd
├── _overlapped.pyd
├── _socket.pyd
├── _sqlite3.pyd
├── _ssl.pyd
├── _testbuffer.pyd
├── _testcapi.pyd
├── _testconsole.pyd
├── _testimportmultiple.pyd
├── _testmultiphase.pyd
├── _tkinter.pyd
├── activate
├── activate.bat
├── api-ms-win-core-console-l1-1-0.dll
├── api-ms-win-core-datetime-l1-1-0.dll
├── api-ms-win-core-debug-l1-1-0.dll
├── api-ms-win-core-errorhandling-l1-1-0.dll
├── api-ms-win-core-file-l1-1-0.dll
├── api-ms-win-core-file-l1-2-0.dll
├── api-ms-win-core-file-l2-1-0.dll
├── api-ms-win-core-handle-l1-1-0.dll
├── api-ms-win-core-heap-l1-1-0.dll
├── api-ms-win-core-interlocked-l1-1-0.dll
├── api-ms-win-core-libraryloader-l1-1-0.dll
├── api-ms-win-core-localization-l1-2-0.dll
├── api-ms-win-core-memory-l1-1-0.dll
├── api-ms-win-core-namedpipe-l1-1-0.dll
├── api-ms-win-core-processenvironment-l1-1-0.dll
├── api-ms-win-core-processthreads-l1-1-0.dll
├── api-ms-win-core-processthreads-l1-1-1.dll
├── api-ms-win-core-profile-l1-1-0.dll
├── api-ms-win-core-rtlsupport-l1-1-0.dll
├── api-ms-win-core-string-l1-1-0.dll
├── api-ms-win-core-synch-l1-1-0.dll
├── api-ms-win-core-synch-l1-2-0.dll
├── api-ms-win-core-sysinfo-l1-1-0.dll
├── api-ms-win-core-timezone-l1-1-0.dll
├── api-ms-win-core-util-l1-1-0.dll
├── api-ms-win-crt-conio-l1-1-0.dll
├── api-ms-win-crt-convert-l1-1-0.dll
├── api-ms-win-crt-environment-l1-1-0.dll
├── api-ms-win-crt-filesystem-l1-1-0.dll
├── api-ms-win-crt-heap-l1-1-0.dll
├── api-ms-win-crt-locale-l1-1-0.dll
├── api-ms-win-crt-math-l1-1-0.dll
├── api-ms-win-crt-multibyte-l1-1-0.dll
├── api-ms-win-crt-private-l1-1-0.dll
├── api-ms-win-crt-process-l1-1-0.dll
├── api-ms-win-crt-runtime-l1-1-0.dll
├── api-ms-win-crt-stdio-l1-1-0.dll
├── api-ms-win-crt-string-l1-1-0.dll
├── api-ms-win-crt-time-l1-1-0.dll
├── api-ms-win-crt-utility-l1-1-0.dll
├── concrt140.dll
├── deactivate.bat
├── msvcp140.dll
├── pyexpat.pyd
├── python.exe
├── python3.dll
├── python3.exe
├── python36.dll
├── python_conda.exe
├── pythonw.exe
├── select.pyd
├── sqlite3.dll
├── tcl86t.dll
├── tk86t.dll
├── ucrtbase.dll
├── unicodedata.pyd
├── vccorlib140.dll
├── vcomp140.dll
├── vcruntime140.dll
├── winsound.pyd
├── xlwings32-0.11.5.dll
└── xlwings64-0.11.5.dll
└── pyvenv.cfg
/.idea/OCR.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 | 1542535976257
320 |
321 |
322 | 1542535976257
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 |
466 |
467 |
468 |
469 |
470 |
471 |
472 |
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 |
481 |
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 |
514 |
515 |
516 |
517 |
518 |
519 |
520 |
521 |
522 |
523 |
524 |
525 |
526 |
527 |
528 |
529 |
530 |
531 |
532 |
533 |
534 |
535 |
536 |
537 |
538 |
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 |
557 |
558 |
559 |
560 |
561 |
562 |
563 |
564 |
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 |
589 |
590 |
591 |
592 |
593 |
594 |
595 |
596 |
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 |
613 |
614 |
615 |
616 |
617 |
618 |
619 |
620 |
621 |
622 |
623 |
624 |
625 |
626 |
627 |
628 |
629 |
630 |
631 |
632 |
633 |
634 |
635 |
636 |
637 |
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 |
646 |
647 |
648 |
649 |
650 |
651 |
652 |
653 |
654 |
655 |
656 |
657 |
658 |
659 |
660 |
661 |
662 |
663 |
664 |
665 |
666 |
667 |
668 |
669 |
670 |
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
722 |
723 |
724 |
725 |
726 |
727 |
728 |
729 |
730 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
764 |
765 |
766 |
767 |
768 |
769 |
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 |
778 |
779 |
780 |
--------------------------------------------------------------------------------
/AboutDialog.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from PyQt5.QtWidgets import (QDialog,QApplication,QLabel,QVBoxLayout,
3 | QHBoxLayout)
4 | import qdarkstyle
5 | from PyQt5.QtGui import QIcon,QFont
6 | from PyQt5.Qt import Qt
7 |
8 | class AboutDialog(QDialog):
9 | def __init__(self):
10 | super(AboutDialog,self).__init__()
11 | self.setWindowModality (Qt.WindowModal)
12 | self.initUI()
13 |
14 | def initUI(self):
15 | self.resize(600,400)
16 | self.setWindowTitle("myOCR——关于")
17 | self.setWindowIcon(QIcon("./images/Icon.png"))
18 | self.setStyleSheet (qdarkstyle.load_stylesheet_pyqt5 ())
19 |
20 | self.tlabel = QLabel(self)
21 | self.tlabel.setText("myOCR")
22 | self.tlabel.setFont (QFont ("Mlungker", 90))
23 | self.h1box = QHBoxLayout()
24 | self.h1box.addStretch(1)
25 | self.h1box.addWidget(self.tlabel)
26 | self.h1box.addStretch(1)
27 |
28 | self.textlabel = QLabel(self)
29 | self.textlabel.setText(" 本程序为华东理工大学信息与工程学院创新\n"
30 | "育人项目 图片文字识别(OCR)系统研究与实现\n"
31 | "课程设计。\n\n"
32 | " 当前版本: 1 . 0 . 0\n"
33 | " 开发工具: Python3 \n"
34 | " 开发库: PyQt5 aip\n"
35 | " 开发人员:计162 徐涣 10161762")
36 | self.textlabel.setFont(QFont("北岸钢笔楷书书法字体",15))
37 | self.h2box = QHBoxLayout()
38 | self.h2box.addStretch(1)
39 | self.h2box.addWidget(self.textlabel)
40 | self.h2box.addStretch(1)
41 |
42 | self.vbox = QVBoxLayout()
43 | self.vbox.addStretch(1)
44 | self.vbox.addLayout(self.h1box)
45 | self.vbox.addStretch(1)
46 | self.vbox.addLayout(self.h2box)
47 | self.vbox.addStretch(1)
48 | self.setLayout(self.vbox)
49 |
50 | if __name__ == '__main__':
51 | app = QApplication(sys.argv)
52 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
53 | aboutWindow = AboutDialog()
54 | aboutWindow.show()
55 | sys.exit(app.exec_())
--------------------------------------------------------------------------------
/BankCardRecognize.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import time
3 | import random
4 | from aip import AipOcr
5 | from PyQt5.QtWidgets import (QDialog,QApplication,QLabel,QPushButton,
6 | QFileDialog,QMessageBox,QPlainTextEdit,QHBoxLayout,
7 | QVBoxLayout)
8 | from PyQt5.QtGui import QIcon,QFont
9 | from PyQt5.QtSql import QSqlQuery,QSqlDatabase
10 | import qdarkstyle
11 | from PyQt5 import QtGui
12 |
13 | APP_ID = '14868017'
14 | API_KEY = '6epPHS8EPX1k8GjdCzez7OLT'
15 | SECRET_KEY = 'onZaVAlgYzEBchooR91xQf8j7kgoFG4W'
16 | aipOcr = AipOcr(APP_ID, API_KEY, SECRET_KEY)
17 | options = {
18 | 'detect_direction': 'true',
19 | 'language_type': 'CHN_ENG',
20 | }
21 |
22 | class BankCardRecognize(QDialog):
23 | def __init__(self):
24 | super(BankCardRecognize,self).__init__()
25 | self.text = ""
26 | self.strTime = ""
27 | self.bankid = ""
28 | self.filePath = ""
29 | self.initUI()
30 |
31 | def initUI(self):
32 | self.resize(700,600)
33 | self.setWindowTitle("myOCR——银行卡识别")
34 | self.setWindowIcon(QIcon("./images/Icon.png"))
35 |
36 | self.plabel = QLabel(self)
37 | self.plabel.setFixedSize(400,300)
38 |
39 | self.obtn = QPushButton(self)
40 | self.obtn.setText("打开本地图片")
41 | self.obtn.setFont(QFont("苏新诗柳楷繁", 15))
42 | self.obtn.clicked.connect(self.openimage)
43 | self.obtn.setFixedSize(180,40)
44 | self.sbtn = QPushButton(self)
45 | self.sbtn.setText("开 始 识 别")
46 | self.sbtn.setFont(QFont("苏新诗柳楷繁", 15))
47 | self.sbtn.clicked.connect(self.recognize)
48 | self.sbtn.setFixedSize(180,40)
49 |
50 | self.v1box = QVBoxLayout()
51 | self.v1box.addWidget(self.obtn)
52 | self.v1box.addWidget(self.sbtn)
53 |
54 | self.h1box = QHBoxLayout()
55 | self.h1box.addWidget(self.plabel)
56 | self.h1box.addLayout(self.v1box)
57 |
58 | self.tlabel = QLabel(self)
59 | self.tlabel.setText("识\n别\n结\n果")
60 | self.tlabel.setFont(QFont("苏新诗柳楷繁", 15))
61 | self.tlabel.resize(200, 50)
62 |
63 | self.tedit = QPlainTextEdit(self)
64 | self.tedit.setFont(QFont("宋体",10))
65 | self.tedit.setFixedSize(600,350)
66 |
67 | self.h2box = QHBoxLayout()
68 | self.h2box.addStretch(1)
69 | self.h2box.addWidget(self.tlabel)
70 | self.h2box.addStretch(1)
71 | self.h2box.addWidget(self.tedit)
72 | self.h2box.addStretch(1)
73 |
74 | self.vbox = QVBoxLayout()
75 | self.vbox.addLayout(self.h1box)
76 | self.vbox.addStretch(1)
77 | self.vbox.addLayout(self.h2box)
78 | self.setLayout(self.vbox)
79 |
80 |
81 | def openimage(self):
82 | self.filePath, imgType = QFileDialog.getOpenFileName(self, "打开本地图片", "", "*.jpg;;*.png;;All Files(*)")
83 | self.jpg = QtGui.QPixmap(self.filePath).scaled(self.plabel.width(), self.plabel.height())
84 | self.plabel.setPixmap(self.jpg)
85 |
86 | def recognize(self):
87 | if(self.filePath == ""):
88 | print(QMessageBox.warning(self, "警告", "请插入图片", QMessageBox.Yes, QMessageBox.Yes))
89 | return
90 | now = int(time.time())
91 | timeStruct = time.localtime(now)
92 | self.strTime = time.strftime("%Y/%m/%d %H:%M", timeStruct)
93 | self.bankid = 'k' + str(time.strftime("%g%m%d")) + str(random.randint(0, 9999)).zfill(4)
94 | db = QSqlDatabase.addDatabase("QSQLITE")
95 | db.setDatabaseName('./db/myOCR.db')
96 | db.open()
97 | query = QSqlQuery()
98 | sql = "select * from records where RecordId = '%s'"%(self.bankid)
99 | query.exec_(sql)
100 | if (query.next()):
101 | print(QMessageBox.warning(self, "警告", "系统错误,请重新提交", QMessageBox.Yes, QMessageBox.Yes))
102 | return
103 | result = aipOcr.bankcard(self.get_file_content(self.filePath),options)
104 | number = result['result']['bank_card_number']
105 | date = result['result']['valid_date']
106 | type = result['result']['bank_card_type']
107 | name = result['result']['bank_name']
108 | if(type == 1):
109 | type = "借记卡"
110 | else:
111 | type = "信用卡"
112 | self.text = "卡号:" + number + "\n发卡行:" + name + "\n卡片类型:" + type + "\n有效期:" + date
113 | sql = "insert into records values('%s','%s','%s','银行卡识别','%s','')"%(
114 | self.bankid,self.filePath,self.strTime,self.text)
115 | query.exec_(sql)
116 | db.commit()
117 | db.close()
118 | print(QMessageBox.information(self, "提醒", "您已成功识别银行卡!", QMessageBox.Yes, QMessageBox.Yes))
119 | self.tedit.setPlainText(self.text)
120 |
121 | def get_file_content(self,filePath):
122 | with open(filePath, 'rb') as fp:
123 | return fp.read()
124 |
125 |
126 | if __name__ == '__main__':
127 | app = QApplication(sys.argv)
128 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
129 | bankrecognizeWindow = BankCardRecognize()
130 | bankrecognizeWindow.show()
131 | sys.exit(app.exec_())
--------------------------------------------------------------------------------
/BasicRecognize.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import time
3 | import random
4 | from aip import AipOcr
5 | from PyQt5.QtWidgets import (QDialog,QApplication,QLabel,QPushButton,
6 | QFileDialog,QMessageBox,QPlainTextEdit,QHBoxLayout,
7 | QVBoxLayout)
8 | from PyQt5.QtGui import QIcon,QFont
9 | from PyQt5.QtSql import QSqlQuery,QSqlDatabase
10 | import qdarkstyle
11 | from PyQt5 import QtGui
12 |
13 | APP_ID = '14868017'
14 | API_KEY = '6epPHS8EPX1k8GjdCzez7OLT'
15 | SECRET_KEY = 'onZaVAlgYzEBchooR91xQf8j7kgoFG4W'
16 | aipOcr = AipOcr(APP_ID, API_KEY, SECRET_KEY)
17 | options = {
18 | 'detect_direction': 'true',
19 | 'language_type': 'CHN_ENG',
20 | }
21 |
22 | class BasicRecognize(QDialog):
23 | def __init__(self):
24 | super(BasicRecognize,self).__init__()
25 | self.text = ""
26 | self.strTime = ""
27 | self.basicid = ""
28 | self.filePath = ""
29 | self.initUI()
30 |
31 | def initUI(self):
32 | self.resize(700,600)
33 | self.setWindowTitle("myOCR——普通文字识别")
34 | self.setWindowIcon(QIcon("./images/Icon.png"))
35 |
36 | self.plabel = QLabel(self)
37 | self.plabel.setFixedSize(400,300)
38 |
39 | self.obtn = QPushButton(self)
40 | self.obtn.setText("打开本地图片")
41 | self.obtn.setFont(QFont("苏新诗柳楷繁", 15))
42 | self.obtn.clicked.connect(self.openimage)
43 | self.obtn.setFixedSize(180,40)
44 | self.sbtn = QPushButton(self)
45 | self.sbtn.setText("开 始 识 别")
46 | self.sbtn.setFont(QFont("苏新诗柳楷繁", 15))
47 | self.sbtn.clicked.connect(self.recognize)
48 | self.sbtn.setFixedSize(180,40)
49 |
50 | self.v1box = QVBoxLayout()
51 | self.v1box.addWidget(self.obtn)
52 | self.v1box.addWidget(self.sbtn)
53 |
54 | self.h1box = QHBoxLayout()
55 | self.h1box.addWidget(self.plabel)
56 | self.h1box.addLayout(self.v1box)
57 |
58 | self.tlabel = QLabel(self)
59 | self.tlabel.setText("识\n别\n结\n果")
60 | self.tlabel.setFont(QFont("苏新诗柳楷繁", 15))
61 | self.tlabel.resize(200, 50)
62 |
63 | self.tedit = QPlainTextEdit(self)
64 | self.tedit.setFont(QFont("宋体",10))
65 | self.tedit.setFixedSize(600,350)
66 |
67 | self.h2box = QHBoxLayout()
68 | self.h2box.addStretch(1)
69 | self.h2box.addWidget(self.tlabel)
70 | self.h2box.addStretch(1)
71 | self.h2box.addWidget(self.tedit)
72 | self.h2box.addStretch(1)
73 |
74 | self.vbox = QVBoxLayout()
75 | self.vbox.addLayout(self.h1box)
76 | self.vbox.addStretch(1)
77 | self.vbox.addLayout(self.h2box)
78 | self.setLayout(self.vbox)
79 |
80 |
81 | def openimage(self):
82 | self.filePath, imgType = QFileDialog.getOpenFileName(self, "打开本地图片", "", "*.jpg;;*.png;;All Files(*)")
83 | self.jpg = QtGui.QPixmap(self.filePath).scaled(self.plabel.width(), self.plabel.height())
84 | self.plabel.setPixmap(self.jpg)
85 |
86 | def recognize(self):
87 | if(self.filePath == ""):
88 | print(QMessageBox.warning(self, "警告", "请插入图片", QMessageBox.Yes, QMessageBox.Yes))
89 | return
90 | now = int(time.time())
91 | timeStruct = time.localtime(now)
92 | self.strTime = time.strftime("%Y/%m/%d %H:%M", timeStruct)
93 | self.basicid = 'b' + str(time.strftime("%g%m%d")) + str(random.randint(0, 9999)).zfill(4)
94 | db = QSqlDatabase.addDatabase("QSQLITE")
95 | db.setDatabaseName('./db/myOCR.db')
96 | db.open()
97 | query = QSqlQuery()
98 | sql = "select * from records where RecordId = '%s'"%(self.basicid)
99 | query.exec_(sql)
100 | if (query.next()):
101 | print(QMessageBox.warning(self, "警告", "系统错误,请重新提交", QMessageBox.Yes, QMessageBox.Yes))
102 | return
103 | result = aipOcr.basicAccurate(self.get_file_content(self.filePath), options)
104 | words_result = result['words_result']
105 | for i in range(len(words_result)):
106 | self.text = self.text + words_result[i]['words']
107 | sql = "insert into records values('%s','%s','%s','普通文字识别','%s','')"%(
108 | self.basicid,self.filePath,self.strTime,self.text)
109 | query.exec_(sql)
110 | db.commit()
111 | db.close()
112 | print(QMessageBox.information(self, "提醒", "您已成功识别文字!", QMessageBox.Yes, QMessageBox.Yes))
113 | self.tedit.setPlainText(self.text)
114 |
115 | def get_file_content(self,filePath):
116 | with open(filePath, 'rb') as fp:
117 | return fp.read()
118 |
119 |
120 |
121 | if __name__ == '__main__':
122 | app = QApplication(sys.argv)
123 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
124 | basicrecognizeWindow = BasicRecognize()
125 | basicrecognizeWindow.show()
126 | sys.exit(app.exec_())
--------------------------------------------------------------------------------
/CarCardRecognize.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import time
3 | import random
4 | from aip import AipOcr
5 | from PyQt5.QtWidgets import (QDialog,QApplication,QLabel,QPushButton,
6 | QFileDialog,QMessageBox,QPlainTextEdit,QHBoxLayout,
7 | QVBoxLayout)
8 | from PyQt5.QtGui import QIcon,QFont
9 | from PyQt5.QtSql import QSqlQuery,QSqlDatabase
10 | import qdarkstyle
11 | from PyQt5 import QtGui
12 |
13 | APP_ID = '14868017'
14 | API_KEY = '6epPHS8EPX1k8GjdCzez7OLT'
15 | SECRET_KEY = 'onZaVAlgYzEBchooR91xQf8j7kgoFG4W'
16 | aipOcr = AipOcr(APP_ID, API_KEY, SECRET_KEY)
17 | options = {
18 | 'detect_direction': 'true',
19 | 'language_type': 'CHN_ENG',
20 | }
21 |
22 | class CarCardRecognize(QDialog):
23 | def __init__(self):
24 | super(CarCardRecognize,self).__init__()
25 | self.text = ""
26 | self.strTime = ""
27 | self.carid = ""
28 | self.filePath = ""
29 | self.initUI()
30 |
31 | def initUI(self):
32 | self.resize(700,600)
33 | self.setWindowTitle("myOCR——行驶证识别")
34 | self.setWindowIcon(QIcon("./images/Icon.png"))
35 |
36 | self.plabel = QLabel(self)
37 | self.plabel.setFixedSize(400,300)
38 |
39 | self.obtn = QPushButton(self)
40 | self.obtn.setText("打开本地图片")
41 | self.obtn.setFont(QFont("苏新诗柳楷繁", 15))
42 | self.obtn.clicked.connect(self.openimage)
43 | self.obtn.setFixedSize(180,40)
44 | self.sbtn = QPushButton(self)
45 | self.sbtn.setText("开 始 识 别")
46 | self.sbtn.setFont(QFont("苏新诗柳楷繁", 15))
47 | self.sbtn.clicked.connect(self.recognize)
48 | self.sbtn.setFixedSize(180,40)
49 |
50 | self.v1box = QVBoxLayout()
51 | self.v1box.addWidget(self.obtn)
52 | self.v1box.addWidget(self.sbtn)
53 |
54 | self.h1box = QHBoxLayout()
55 | self.h1box.addWidget(self.plabel)
56 | self.h1box.addLayout(self.v1box)
57 |
58 | self.tlabel = QLabel(self)
59 | self.tlabel.setText("识\n别\n结\n果")
60 | self.tlabel.setFont(QFont("苏新诗柳楷繁", 15))
61 | self.tlabel.resize(200, 50)
62 |
63 | self.tedit = QPlainTextEdit(self)
64 | self.tedit.setFont(QFont("宋体",10))
65 | self.tedit.setFixedSize(600,350)
66 |
67 | self.h2box = QHBoxLayout()
68 | self.h2box.addStretch(1)
69 | self.h2box.addWidget(self.tlabel)
70 | self.h2box.addStretch(1)
71 | self.h2box.addWidget(self.tedit)
72 | self.h2box.addStretch(1)
73 |
74 | self.vbox = QVBoxLayout()
75 | self.vbox.addLayout(self.h1box)
76 | self.vbox.addStretch(1)
77 | self.vbox.addLayout(self.h2box)
78 | self.setLayout(self.vbox)
79 |
80 |
81 | def openimage(self):
82 | self.filePath, imgType = QFileDialog.getOpenFileName(self, "打开本地图片", "", "*.jpg;;*.png;;All Files(*)")
83 | self.jpg = QtGui.QPixmap(self.filePath).scaled(self.plabel.width(), self.plabel.height())
84 | self.plabel.setPixmap(self.jpg)
85 |
86 | def recognize(self):
87 | if(self.filePath == ""):
88 | print(QMessageBox.warning(self, "警告", "请插入图片", QMessageBox.Yes, QMessageBox.Yes))
89 | return
90 | now = int(time.time())
91 | timeStruct = time.localtime(now)
92 | self.strTime = time.strftime("%Y/%m/%d %H:%M", timeStruct)
93 | self.carid = 'c' + str(time.strftime("%g%m%d")) + str(random.randint(0, 9999)).zfill(4)
94 | db = QSqlDatabase.addDatabase("QSQLITE")
95 | db.setDatabaseName('./db/myOCR.db')
96 | db.open()
97 | query = QSqlQuery()
98 | sql = "select * from records where RecordId = '%s'"%(self.carid)
99 | query.exec_(sql)
100 | if (query.next()):
101 | print(QMessageBox.warning(self, "警告", "系统错误,请重新提交", QMessageBox.Yes, QMessageBox.Yes))
102 | return
103 | result = aipOcr.vehicleLicense(self.get_file_content(self.filePath),options)
104 | type = result['words_result']['品牌型号']['words']
105 | date = result['words_result']['发证日期']['words']
106 | property = result['words_result']['使用性质']['words']
107 | id = result['words_result']['发动机号码']['words']
108 | carid = result['words_result']['号牌号码']['words']
109 | person = result['words_result']['所有人']['words']
110 | address = result['words_result']['住址']['words']
111 | setup = result['words_result']['注册日期']['words']
112 | reco = result['words_result']['车辆识别代号']['words']
113 | car_type = result['words_result']['车辆类型']['words']
114 | self.text = "中华人民共和国机动车行驶证\n号牌号码:" + carid + " 车辆类型:" \
115 | + car_type + "\n所有人:" + person + "\n住址:" + address + "\n\n使用性质:" \
116 | + property + " 品牌型号:" + type + "\n车辆识别代码:" + reco + "\n发动机号码:" \
117 | + id + "\n注册日期:" + setup + " 发证日期:" + date
118 | sql = "insert into records values('%s','%s','%s','行驶证识别','%s','')"%(
119 | self.carid,self.filePath,self.strTime,self.text)
120 | query.exec_(sql)
121 | db.commit()
122 | db.close()
123 | print(QMessageBox.information(self, "提醒", "您已成功识别行驶证!", QMessageBox.Yes, QMessageBox.Yes))
124 | self.tedit.setPlainText(self.text)
125 |
126 | def get_file_content(self,filePath):
127 | with open(filePath, 'rb') as fp:
128 | return fp.read()
129 |
130 |
131 | if __name__ == '__main__':
132 | app = QApplication(sys.argv)
133 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
134 | carrecognizeWindow = CarCardRecognize()
135 | carrecognizeWindow.show()
136 | sys.exit(app.exec_())
--------------------------------------------------------------------------------
/DriveCardRecognize.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import time
3 | import random
4 | from aip import AipOcr
5 | from PyQt5.QtWidgets import (QDialog,QApplication,QLabel,QPushButton,
6 | QFileDialog,QMessageBox,QPlainTextEdit,QHBoxLayout,
7 | QVBoxLayout)
8 | from PyQt5.QtGui import QIcon,QFont
9 | from PyQt5.QtSql import QSqlQuery,QSqlDatabase
10 | import qdarkstyle
11 | from PyQt5 import QtGui
12 |
13 | APP_ID = '14868017'
14 | API_KEY = '6epPHS8EPX1k8GjdCzez7OLT'
15 | SECRET_KEY = 'onZaVAlgYzEBchooR91xQf8j7kgoFG4W'
16 | aipOcr = AipOcr(APP_ID, API_KEY, SECRET_KEY)
17 | options = {
18 | 'detect_direction': 'true',
19 | 'language_type': 'CHN_ENG',
20 | }
21 |
22 | class DriveCardRecognize(QDialog):
23 | def __init__(self):
24 | super(DriveCardRecognize,self).__init__()
25 | self.text = ""
26 | self.strTime = ""
27 | self.driveid = ""
28 | self.filePath = ""
29 | self.initUI()
30 |
31 | def initUI(self):
32 | self.resize(700,600)
33 | self.setWindowTitle("myOCR——驾驶证识别")
34 | self.setWindowIcon(QIcon("./images/Icon.png"))
35 |
36 | self.plabel = QLabel(self)
37 | self.plabel.setFixedSize(400,300)
38 |
39 | self.obtn = QPushButton(self)
40 | self.obtn.setText("打开本地图片")
41 | self.obtn.setFont(QFont("苏新诗柳楷繁", 15))
42 | self.obtn.clicked.connect(self.openimage)
43 | self.obtn.setFixedSize(180,40)
44 | self.sbtn = QPushButton(self)
45 | self.sbtn.setText("开 始 识 别")
46 | self.sbtn.setFont(QFont("苏新诗柳楷繁", 15))
47 | self.sbtn.clicked.connect(self.recognize)
48 | self.sbtn.setFixedSize(180,40)
49 |
50 | self.v1box = QVBoxLayout()
51 | self.v1box.addWidget(self.obtn)
52 | self.v1box.addWidget(self.sbtn)
53 |
54 | self.h1box = QHBoxLayout()
55 | self.h1box.addWidget(self.plabel)
56 | self.h1box.addLayout(self.v1box)
57 |
58 | self.tlabel = QLabel(self)
59 | self.tlabel.setText("识\n别\n结\n果")
60 | self.tlabel.setFont(QFont("苏新诗柳楷繁", 15))
61 | self.tlabel.resize(200, 50)
62 |
63 | self.tedit = QPlainTextEdit(self)
64 | self.tedit.setFont(QFont("宋体",10))
65 | self.tedit.setFixedSize(600,350)
66 |
67 | self.h2box = QHBoxLayout()
68 | self.h2box.addStretch(1)
69 | self.h2box.addWidget(self.tlabel)
70 | self.h2box.addStretch(1)
71 | self.h2box.addWidget(self.tedit)
72 | self.h2box.addStretch(1)
73 |
74 | self.vbox = QVBoxLayout()
75 | self.vbox.addLayout(self.h1box)
76 | self.vbox.addStretch(1)
77 | self.vbox.addLayout(self.h2box)
78 | self.setLayout(self.vbox)
79 |
80 |
81 | def openimage(self):
82 | self.filePath, imgType = QFileDialog.getOpenFileName(self, "打开本地图片", "", "*.jpg;;*.png;;All Files(*)")
83 | self.jpg = QtGui.QPixmap(self.filePath).scaled(self.plabel.width(), self.plabel.height())
84 | self.plabel.setPixmap(self.jpg)
85 |
86 | def recognize(self):
87 | if(self.filePath == ""):
88 | print(QMessageBox.warning(self, "警告", "请插入图片", QMessageBox.Yes, QMessageBox.Yes))
89 | return
90 | now = int(time.time())
91 | timeStruct = time.localtime(now)
92 | self.strTime = time.strftime("%Y/%m/%d %H:%M", timeStruct)
93 | self.driveid = 'd' + str(time.strftime("%g%m%d")) + str(random.randint(0, 9999)).zfill(4)
94 | db = QSqlDatabase.addDatabase("QSQLITE")
95 | db.setDatabaseName('./db/myOCR.db')
96 | db.open()
97 | query = QSqlQuery()
98 | sql = "select * from records where RecordId = '%s'"%(self.driveid)
99 | query.exec_(sql)
100 | if (query.next()):
101 | print(QMessageBox.warning(self, "警告", "系统错误,请重新提交", QMessageBox.Yes, QMessageBox.Yes))
102 | return
103 |
104 | result = aipOcr.drivingLicense(self.get_file_content(self.filePath),options)
105 | id = result['words_result']['证号']['words']
106 | deadline = result['words_result']['有效期限']['words']
107 | type = result['words_result']['准驾车型']['words']
108 | address = result['words_result']['住址']['words']
109 | to = result['words_result']['至']['words']
110 | name = result['words_result']['姓名']['words']
111 | nation = result['words_result']['国籍']['words']
112 | birthday = result['words_result']['出生日期']['words']
113 | sex = result['words_result']['性别']['words']
114 | first = result['words_result']['初次领证日期']['words']
115 | self.text = "中华人民共和国机动车驾驶证\n证号:" + id + "\n姓名:" + name \
116 | + " 性别:" + sex + " 国籍:" + nation + "\n住址:" + address \
117 | + "\n\n出生日期:" + birthday + "\n初次领证日期:" + first \
118 | + "\n准驾车型:" + type + "\n有效期限:" + deadline + "至" + to
119 | sql = "insert into records values('%s','%s','%s','驾驶证识别','%s','')"%(
120 | self.driveid,self.filePath,self.strTime,self.text)
121 | query.exec_(sql)
122 | db.commit()
123 | db.close()
124 | print(QMessageBox.information(self, "提醒", "您已成功识别驾驶证!", QMessageBox.Yes, QMessageBox.Yes))
125 | self.tedit.setPlainText(self.text)
126 |
127 | def get_file_content(self,filePath):
128 | with open(filePath, 'rb') as fp:
129 | return fp.read()
130 |
131 |
132 | if __name__ == '__main__':
133 | app = QApplication(sys.argv)
134 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
135 | driverecognizeWindow = DriveCardRecognize()
136 | driverecognizeWindow.show()
137 | sys.exit(app.exec_())
--------------------------------------------------------------------------------
/HomePageWidget.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from PyQt5.QtWidgets import (QPushButton,QLabel,QWidget,QApplication,
3 | QHBoxLayout,QVBoxLayout)
4 | from PyQt5.QtGui import QPixmap,QIcon,QFont
5 | from PyQt5.QtCore import QCoreApplication
6 | from AboutDialog import AboutDialog
7 | from BasicRecognize import BasicRecognize
8 | from RecordsViewer import RecordsViewer
9 | from IDCardRecognize import IDCardRecognize
10 | from BankCardRecognize import BankCardRecognize
11 | from DriveCardRecognize import DriveCardRecognize
12 | from CarCardRecognize import CarCardRecognize
13 | from PlateRecognize import PlateRecognize
14 | import qdarkstyle
15 |
16 | class HomePageWidget(QWidget):
17 | def __init__(self):
18 | super(HomePageWidget,self).__init__()
19 | self.initUI()
20 |
21 | def initUI(self):
22 | self.resize(800,600)
23 | self.setWindowIcon(QIcon('./images/icon.png'))
24 | self.setWindowTitle('myOCR——启动界面')
25 |
26 | self.titleLabel = QLabel(self)
27 | pixmap = QPixmap('./images/title.png')
28 | self.titleLabel.setPixmap(pixmap)
29 | self.h1box = QHBoxLayout()
30 | self.h1box.addStretch(1)
31 | self.h1box.addWidget(self.titleLabel)
32 | self.h1box.addStretch(1)
33 |
34 | self.basicbtn = QPushButton(self)
35 | self.basicbtn.setText("普通文字识别")
36 | self.basicbtn.setFont(QFont("苏新诗柳楷繁", 15))
37 | self.basicbtn.setFixedSize(180,45)
38 | self.basicbtn.clicked.connect(self.basicrecognizedialog)
39 | self.idcardbtn = QPushButton(self)
40 | self.idcardbtn.setText("身份证识别")
41 | self.idcardbtn.setFont(QFont("苏新诗柳楷繁", 15))
42 | self.idcardbtn.setFixedSize(180, 45)
43 | self.idcardbtn.clicked.connect(self.idcardrecognizedialog)
44 | self.bankcardbtn = QPushButton(self)
45 | self.bankcardbtn.setText("银行卡识别")
46 | self.bankcardbtn.setFont(QFont("苏新诗柳楷繁", 15))
47 | self.bankcardbtn.setFixedSize(180, 45)
48 | self.bankcardbtn.clicked.connect(self.bankcardrecognizedialog)
49 | self.h2box = QHBoxLayout()
50 | self.h2box.addStretch(1)
51 | self.h2box.addWidget(self.basicbtn)
52 | self.h2box.addStretch(1)
53 | self.h2box.addWidget(self.idcardbtn)
54 | self.h2box.addStretch(1)
55 | self.h2box.addWidget(self.bankcardbtn)
56 | self.h2box.addStretch(1)
57 |
58 | self.drivecardbtn = QPushButton(self)
59 | self.drivecardbtn.setText("驾驶证识别")
60 | self.drivecardbtn.setFont(QFont("苏新诗柳楷繁", 15))
61 | self.drivecardbtn.setFixedSize(180, 45)
62 | self.drivecardbtn.clicked.connect(self.drivecardrecognizedialog)
63 | self.carcardbtn = QPushButton(self)
64 | self.carcardbtn.setText("行驶证识别")
65 | self.carcardbtn.setFont(QFont("苏新诗柳楷繁", 15))
66 | self.carcardbtn.setFixedSize(180, 45)
67 | self.carcardbtn.clicked.connect(self.carcardrecognizedialog)
68 | self.platecardbtn = QPushButton(self)
69 | self.platecardbtn.setText("车牌识别")
70 | self.platecardbtn.setFont(QFont("苏新诗柳楷繁", 15))
71 | self.platecardbtn.setFixedSize(180, 45)
72 | self.platecardbtn.clicked.connect(self.platecardrecognize)
73 | self.h3box = QHBoxLayout()
74 | self.h3box.addStretch(1)
75 | self.h3box.addWidget(self.drivecardbtn)
76 | self.h3box.addStretch(1)
77 | self.h3box.addWidget(self.carcardbtn)
78 | self.h3box.addStretch(1)
79 | self.h3box.addWidget(self.platecardbtn)
80 | self.h3box.addStretch(1)
81 |
82 | self.hbtn = QPushButton(self)
83 | self.hbtn.setText("我的识别历史")
84 | self.hbtn.setFont(QFont("苏新诗柳楷繁", 15))
85 | self.hbtn.clicked.connect(self.myhistorydialog)
86 | self.hbtn.setFixedSize(160, 40)
87 | self.abtn = QPushButton(self)
88 | self.abtn.setText("关 于")
89 | self.abtn.setFont(QFont("苏新诗柳楷繁", 15))
90 | self.abtn.clicked.connect(self.aboutdialog)
91 | self.abtn.setFixedSize(160,40)
92 | self.qbtn = QPushButton(self)
93 | self.qbtn.setText("退 出")
94 | self.qbtn.setFont(QFont("苏新诗柳楷繁", 15))
95 | self.qbtn.clicked.connect(QCoreApplication.instance().quit)
96 | self.qbtn.setFixedSize(160, 40)
97 | self.hbbox = QHBoxLayout()
98 | self.hbbox.addStretch(1)
99 | self.hbbox.addWidget(self.hbtn)
100 | self.hbbox.addStretch(1)
101 | self.hbbox.addWidget(self.abtn)
102 | self.hbbox.addStretch(1)
103 | self.hbbox.addWidget(self.qbtn)
104 | self.hbbox.addStretch(1)
105 |
106 | self.vbox = QVBoxLayout()
107 | self.vbox.addStretch(1)
108 | self.vbox.addLayout(self.h1box)
109 | self.vbox.addStretch(1)
110 | self.vbox.addLayout(self.h2box)
111 | self.vbox.addStretch(1)
112 | self.vbox.addLayout(self.h3box)
113 | self.vbox.addStretch(1)
114 | self.vbox.addLayout(self.hbbox)
115 | self.vbox.addStretch(1)
116 | self.setLayout(self.vbox)
117 |
118 | def aboutdialog(self):
119 | aboutdialogWindow = AboutDialog()
120 | aboutdialogWindow.show()
121 | aboutdialogWindow.exec_()
122 |
123 | def basicrecognizedialog(self):
124 | basicrecognize = BasicRecognize()
125 | basicrecognize.show()
126 | basicrecognize.exec_()
127 |
128 | def myhistorydialog(self):
129 | recordsviewer = RecordsViewer()
130 | recordsviewer.show()
131 | recordsviewer.exec_()
132 |
133 | def idcardrecognizedialog(self):
134 | idcardrecognize = IDCardRecognize()
135 | idcardrecognize.show()
136 | idcardrecognize.exec_()
137 |
138 | def bankcardrecognizedialog(self):
139 | bankcardrecognize = BankCardRecognize()
140 | bankcardrecognize.show()
141 | bankcardrecognize.exec_()
142 |
143 | def drivecardrecognizedialog(self):
144 | drivecardrecognize = DriveCardRecognize()
145 | drivecardrecognize.show()
146 | drivecardrecognize.exec_()
147 |
148 | def carcardrecognizedialog(self):
149 | carcardrecognize = CarCardRecognize()
150 | carcardrecognize.show()
151 | carcardrecognize.exec_()
152 |
153 | def platecardrecognize(self):
154 | platecardrecognize = PlateRecognize()
155 | platecardrecognize.show()
156 | platecardrecognize.exec_()
157 |
158 |
159 | if __name__ == '__main__':
160 | app = QApplication(sys.argv)
161 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
162 | HomePageWidget = HomePageWidget()
163 | HomePageWidget.show()
164 | sys.exit(app.exec_())
--------------------------------------------------------------------------------
/IDCardRecognize.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import time
3 | import random
4 | from aip import AipOcr
5 | from PyQt5.QtWidgets import (QDialog,QApplication,QLabel,QPushButton,
6 | QFileDialog,QMessageBox,QPlainTextEdit,QHBoxLayout,
7 | QVBoxLayout)
8 | from PyQt5.QtGui import QIcon,QFont
9 | from PyQt5.QtSql import QSqlQuery,QSqlDatabase
10 | import qdarkstyle
11 | from PyQt5 import QtGui
12 |
13 | APP_ID = '14868017'
14 | API_KEY = '6epPHS8EPX1k8GjdCzez7OLT'
15 | SECRET_KEY = 'onZaVAlgYzEBchooR91xQf8j7kgoFG4W'
16 | aipOcr = AipOcr(APP_ID, API_KEY, SECRET_KEY)
17 | options = {
18 | 'detect_direction': 'true',
19 | 'language_type': 'CHN_ENG',
20 | }
21 |
22 | class IDCardRecognize(QDialog):
23 | def __init__(self):
24 | super(IDCardRecognize,self).__init__()
25 | self.filePath_f = ""
26 | self.filePath_b = ""
27 | self.initUI()
28 |
29 | def initUI(self):
30 | self.resize(1200,600)
31 | self.setWindowTitle("myOCR——身份证识别")
32 | self.setWindowIcon(QIcon("./images/Icon.png"))
33 | self.plabel_f = QLabel(self)
34 | self.plabel_f.setFixedSize(350,280)
35 | self.plabel_b = QLabel(self)
36 | self.plabel_b.setFixedSize(350,280)
37 | self.v1box = QVBoxLayout()
38 | self.v1box.addWidget(self.plabel_f)
39 | self.v1box.addWidget(self.plabel_b)
40 |
41 | self.fbutton = QPushButton(self)
42 | self.fbutton.setText("上传身份证正面")
43 | self.fbutton.setFont(QFont("苏新诗柳楷繁", 15))
44 | self.fbutton.setFixedSize(180,35)
45 | self.fbutton.clicked.connect(self.openImage_f)
46 | self.bbutton = QPushButton(self)
47 | self.bbutton.setText("上传身份证背面")
48 | self.bbutton.setFont(QFont("苏新诗柳楷繁", 15))
49 | self.bbutton.setFixedSize(180,35)
50 | self.bbutton.clicked.connect(self.openImage_b)
51 | self.rbutton = QPushButton(self)
52 | self.rbutton.setText("开始识别")
53 | self.rbutton.setFont(QFont("苏新诗柳楷繁", 15))
54 | self.rbutton.setFixedSize(180,35)
55 | self.rbutton.clicked.connect(self.recognize)
56 | self.v2box = QVBoxLayout()
57 | self.v2box.addWidget(self.fbutton)
58 | self.v2box.addWidget(self.bbutton)
59 | self.v2box.addWidget(self.rbutton)
60 |
61 | self.tlabel = QLabel(self)
62 | self.tlabel.setText("识别结果")
63 | self.tlabel.setFont(QFont("苏新诗柳楷繁", 15))
64 | self.tedit = QPlainTextEdit(self)
65 | self.tedit.setFont(QFont("宋体",10))
66 | self.tedit.setFixedSize(400,400)
67 | self.v3box = QVBoxLayout()
68 | self.v3box.addStretch(1)
69 | self.v3box.addWidget(self.tlabel)
70 | self.v3box.addStretch(1)
71 | self.v3box.addWidget(self.tedit)
72 | self.v3box.addStretch(1)
73 |
74 | self.hbox = QHBoxLayout()
75 | self.hbox.addLayout(self.v1box)
76 | self.hbox.addLayout(self.v2box)
77 | self.hbox.addLayout(self.v3box)
78 | self.setLayout(self.hbox)
79 |
80 | def openImage_f(self):
81 | self.filePath_f, imgType = QFileDialog.getOpenFileName(self, "打开本地图片", "", "*.jpg;;*.png;;All Files(*)")
82 | self.jpg_f = QtGui.QPixmap(self.filePath_f).scaled(self.plabel_f.width(), self.plabel_f.height())
83 | self.plabel_f.setPixmap(self.jpg_f)
84 |
85 | def openImage_b(self):
86 | self.filePath_b, imgType = QFileDialog.getOpenFileName(self, "打开本地图片", "", "*.jpg;;*.png;;All Files(*)")
87 | self.jpg_b = QtGui.QPixmap(self.filePath_b).scaled(self.plabel_b.width(), self.plabel_b.height())
88 | self.plabel_b.setPixmap(self.jpg_b)
89 |
90 | def recognize(self):
91 | if(self.filePath_f == "" or self.filePath_b == ""):
92 | print(QMessageBox.warning(self, "警告", "请将身份证正反面上传", QMessageBox.Yes, QMessageBox.Yes))
93 | return
94 | now = int(time.time())
95 | timeStruct = time.localtime(now)
96 | self.strTime = time.strftime("%Y/%m/%d %H:%M", timeStruct)
97 | self.cardid = 'i' + str(time.strftime("%g%m%d")) + str(random.randint(0, 9999)).zfill(4)
98 | db = QSqlDatabase.addDatabase("QSQLITE")
99 | db.setDatabaseName('./db/myOCR.db')
100 | db.open()
101 | query = QSqlQuery()
102 | sql = "select * from records where RecordId = '%s'" % (self.cardid)
103 | query.exec_(sql)
104 | if (query.next()):
105 | print(QMessageBox.warning(self, "警告", "系统错误,请重新提交", QMessageBox.Yes, QMessageBox.Yes))
106 | return
107 | result = aipOcr.idcard(self.get_file_content(self.filePath_f),"front",options)
108 | address = result['words_result']['住址']['words']
109 | birthday = result['words_result']['出生']['words']
110 | year_i = birthday[0:4]
111 | month_i = birthday[4:6]
112 | day_i = birthday[6:8]
113 | name = result['words_result']['姓名']['words']
114 | id = result['words_result']['公民身份号码']['words']
115 | sex = result['words_result']['性别']['words']
116 | nation =result['words_result']['民族']['words']
117 | result = aipOcr.idcard(self.get_file_content(self.filePath_b), "back", options)
118 | date_q = result['words_result']['签发日期']['words']
119 | date_q_y = date_q[0:4]
120 | date_q_m = date_q[4:6]
121 | date_q_d = date_q[6:8]
122 | office = result['words_result']['签发机关']['words']
123 | date_s = result['words_result']['失效日期']['words']
124 | date_s_y = date_s[0:4]
125 | date_s_m = date_s[4:6]
126 | date_s_d = date_s[6:8]
127 | self.text = "姓名:" + name + "\n性别:" + sex + " 民族:" + nation \
128 | + "\n出生:" + year_i + "年" + month_i + "月" + day_i + "日\n住址:" \
129 | + address + "\n公民身份号码:" + id + "\n\n签发日期:" + date_q_y \
130 | + "年" + date_q_m + "月" + date_q_d + "日\n签发机关:" + office \
131 | + "\n失效日期:" + date_s_y + "年" + date_s_m + "月" + date_s_d + "日"
132 | sql = "insert into records values('%s','%s','%s','身份证识别','%s','%s')" % (
133 | self.cardid, self.filePath_f, self.strTime, self.text,self.filePath_b)
134 | query.exec_(sql)
135 | db.commit()
136 | db.close()
137 | print(QMessageBox.information(self, "提醒", "您已成功识别身份证!", QMessageBox.Yes, QMessageBox.Yes))
138 | self.tedit.setPlainText(self.text)
139 |
140 | def get_file_content(self,filePath):
141 | with open(filePath, 'rb') as fp:
142 | return fp.read()
143 |
144 | if __name__ == '__main__':
145 | app = QApplication(sys.argv)
146 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
147 | idcardrecognizeWindow = IDCardRecognize()
148 | idcardrecognizeWindow.show()
149 | sys.exit(app.exec_())
--------------------------------------------------------------------------------
/MainWindow.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from PyQt5.QtWidgets import QApplication,QDesktopWidget,QMainWindow
3 | from PyQt5.QtGui import QIcon
4 | from HomePageWidget import HomePageWidget
5 | import qdarkstyle
6 |
7 |
8 | class MainWindow(QMainWindow):
9 | def __init__(self):
10 | super(MainWindow,self).__init__()
11 | self.initUI()
12 |
13 | def initUI(self):
14 | self.resize(800, 600)
15 | self.setWindowTitle("myOCR——免费的OCR文字识别系统")
16 | self.setWindowIcon(QIcon('./images/icon.png'))
17 | self.center()
18 |
19 | self.widget = HomePageWidget()
20 | self.setCentralWidget(self.widget)
21 |
22 | def center(self):
23 | qr = self.frameGeometry()
24 | cp = QDesktopWidget().availableGeometry().center()
25 | qr.moveCenter(cp)
26 | self.move(qr.topLeft())
27 |
28 |
29 | if __name__ == '__main__':
30 | app = QApplication(sys.argv)
31 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
32 | mainWindow = MainWindow()
33 | mainWindow.show()
34 | sys.exit(app.exec_())
35 |
--------------------------------------------------------------------------------
/MainWindow.spec:
--------------------------------------------------------------------------------
1 | # -*- mode: python -*-
2 |
3 | block_cipher = None
4 |
5 |
6 | a = Analysis(['MainWindow.py'],
7 | pathex=['G:\\OCR'],
8 | binaries=[],
9 | datas=[],
10 | hiddenimports=[],
11 | hookspath=[],
12 | runtime_hooks=[],
13 | excludes=[],
14 | win_no_prefer_redirects=False,
15 | win_private_assemblies=False,
16 | cipher=block_cipher,
17 | noarchive=False)
18 | pyz = PYZ(a.pure, a.zipped_data,
19 | cipher=block_cipher)
20 | exe = EXE(pyz,
21 | a.scripts,
22 | a.binaries,
23 | a.zipfiles,
24 | a.datas,
25 | [],
26 | name='MainWindow',
27 | debug=False,
28 | bootloader_ignore_signals=False,
29 | strip=False,
30 | upx=True,
31 | runtime_tmpdir=None,
32 | console=True )
33 |
--------------------------------------------------------------------------------
/PlateRecognize.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import time
3 | import random
4 | from aip import AipOcr
5 | from PyQt5.QtWidgets import (QDialog,QApplication,QLabel,QPushButton,
6 | QFileDialog,QMessageBox,QPlainTextEdit,QHBoxLayout,
7 | QVBoxLayout)
8 | from PyQt5.QtGui import QIcon,QFont
9 | from PyQt5.QtSql import QSqlQuery,QSqlDatabase
10 | import qdarkstyle
11 | from PyQt5 import QtGui
12 |
13 | APP_ID = '14868017'
14 | API_KEY = '6epPHS8EPX1k8GjdCzez7OLT'
15 | SECRET_KEY = 'onZaVAlgYzEBchooR91xQf8j7kgoFG4W'
16 | aipOcr = AipOcr(APP_ID, API_KEY, SECRET_KEY)
17 | options = {
18 | 'detect_direction': 'true',
19 | 'language_type': 'CHN_ENG',
20 | }
21 |
22 | class PlateRecognize(QDialog):
23 | def __init__(self):
24 | super(PlateRecognize,self).__init__()
25 | self.text = ""
26 | self.strTime = ""
27 | self.plateid = ""
28 | self.filePath = ""
29 | self.initUI()
30 |
31 | def initUI(self):
32 | self.resize(700,600)
33 | self.setWindowTitle("myOCR——车牌识别")
34 | self.setWindowIcon(QIcon("./images/Icon.png"))
35 |
36 | self.plabel = QLabel(self)
37 | self.plabel.setFixedSize(400,300)
38 |
39 | self.obtn = QPushButton(self)
40 | self.obtn.setText("打开本地图片")
41 | self.obtn.setFont(QFont("苏新诗柳楷繁", 15))
42 | self.obtn.clicked.connect(self.openimage)
43 | self.obtn.setFixedSize(180,40)
44 | self.sbtn = QPushButton(self)
45 | self.sbtn.setText("开 始 识 别")
46 | self.sbtn.setFont(QFont("苏新诗柳楷繁", 15))
47 | self.sbtn.clicked.connect(self.recognize)
48 | self.sbtn.setFixedSize(180,40)
49 |
50 | self.v1box = QVBoxLayout()
51 | self.v1box.addWidget(self.obtn)
52 | self.v1box.addWidget(self.sbtn)
53 |
54 | self.h1box = QHBoxLayout()
55 | self.h1box.addWidget(self.plabel)
56 | self.h1box.addLayout(self.v1box)
57 |
58 | self.tlabel = QLabel(self)
59 | self.tlabel.setText("识\n别\n结\n果")
60 | self.tlabel.setFont(QFont("苏新诗柳楷繁", 15))
61 | self.tlabel.resize(200, 50)
62 |
63 | self.tedit = QPlainTextEdit(self)
64 | self.tedit.setFont(QFont("宋体",10))
65 | self.tedit.setFixedSize(600,350)
66 |
67 | self.h2box = QHBoxLayout()
68 | self.h2box.addStretch(1)
69 | self.h2box.addWidget(self.tlabel)
70 | self.h2box.addStretch(1)
71 | self.h2box.addWidget(self.tedit)
72 | self.h2box.addStretch(1)
73 |
74 | self.vbox = QVBoxLayout()
75 | self.vbox.addLayout(self.h1box)
76 | self.vbox.addStretch(1)
77 | self.vbox.addLayout(self.h2box)
78 | self.setLayout(self.vbox)
79 |
80 |
81 | def openimage(self):
82 | self.filePath, imgType = QFileDialog.getOpenFileName(self, "打开本地图片", "", "*.jpg;;*.png;;All Files(*)")
83 | self.jpg = QtGui.QPixmap(self.filePath).scaled(self.plabel.width(), self.plabel.height())
84 | self.plabel.setPixmap(self.jpg)
85 |
86 | def recognize(self):
87 | if(self.filePath == ""):
88 | print(QMessageBox.warning(self, "警告", "请插入图片", QMessageBox.Yes, QMessageBox.Yes))
89 | return
90 | now = int(time.time())
91 | timeStruct = time.localtime(now)
92 | self.strTime = time.strftime("%Y/%m/%d %H:%M", timeStruct)
93 | self.plateid = 'p' + str(time.strftime("%g%m%d")) + str(random.randint(0, 9999)).zfill(4)
94 | db = QSqlDatabase.addDatabase("QSQLITE")
95 | db.setDatabaseName('./db/myOCR.db')
96 | db.open()
97 | query = QSqlQuery()
98 | sql = "select * from records where RecordId = '%s'"%(self.plateid)
99 | query.exec_(sql)
100 | if (query.next()):
101 | print(QMessageBox.warning(self, "警告", "系统错误,请重新提交", QMessageBox.Yes, QMessageBox.Yes))
102 | return
103 | result = aipOcr.licensePlate(self.get_file_content(self.filePath),options)
104 | plate = result['words_result']['number']
105 | self.text = "车牌号码:" + plate
106 | sql = "insert into records values('%s','%s','%s','车牌识别','%s','')"%(
107 | self.plateid,self.filePath,self.strTime,self.text)
108 | query.exec_(sql)
109 | db.commit()
110 | db.close()
111 | print(QMessageBox.information(self, "提醒", "您已成功识别车牌!", QMessageBox.Yes, QMessageBox.Yes))
112 | self.tedit.setPlainText(self.text)
113 |
114 | def get_file_content(self,filePath):
115 | with open(filePath, 'rb') as fp:
116 | return fp.read()
117 |
118 |
119 | if __name__ == '__main__':
120 | app = QApplication(sys.argv)
121 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
122 | platerecognizeWindow = PlateRecognize()
123 | platerecognizeWindow.show()
124 | platerecognizeWindow.exec_()
125 | sys.exit(app.exec_())
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # myOCR
2 | 使用PyQt5接口百度AI文字识别服务,使用SQLite为数据库引擎,开发实现普通文字识别、身份证识别、银行卡识别、驾驶证识别、行驶证识别和车牌识别的集成系统。
3 |
--------------------------------------------------------------------------------
/RecognizeDialog.py___jb_tmp___:
--------------------------------------------------------------------------------
1 | import sys
2 | from aip import AipOcr
3 | from PyQt5.QtWidgets import (QDialog,QApplication,QLabel,QPushButton,
4 | QFileDialog,QComboBox,QTextBrowser,QHBoxLayout,
5 | QVBoxLayout)
6 | from PyQt5.QtGui import QIcon,QFont
7 | import qdarkstyle
8 | from PyQt5 import QtGui
9 |
10 | APP_ID = '14868017'
11 | API_KEY = '6epPHS8EPX1k8GjdCzez7OLT'
12 | SECRET_KEY = 'onZaVAlgYzEBchooR91xQf8j7kgoFG4W'
13 | aipOcr = AipOcr(APP_ID, API_KEY, SECRET_KEY)
14 | options = {
15 | 'detect_direction': 'true',
16 | 'language_type': 'CHN_ENG',
17 | }
18 |
19 | class RecognizeDialog(QDialog):
20 | def __init__(self):
21 | super(RecognizeDialog,self).__init__()
22 | self.text = ""
23 | self.initUI()
24 |
25 | def initUI(self):
26 | self.resize(700,600)
27 | self.setWindowTitle("myOCR——识别界面")
28 | self.setWindowIcon(QIcon("./images/Icon.png"))
29 |
30 | self.plabel = QLabel(self)
31 | self.plabel.setFixedSize(400,300)
32 |
33 | self.obtn = QPushButton(self)
34 | self.obtn.setText("打开本地图片")
35 | self.obtn.setFont(QFont("苏新诗柳楷繁", 15))
36 | self.obtn.clicked.connect(self.openimage)
37 | self.obtn.setFixedSize(180,40)
38 | self.condisionComboBox = QComboBox(self)
39 | searchCondision = ['通用文字识别', '身份证识别', '银行卡识别', '行驶证识别', '驾驶证识别','车牌识别','营业执照识别']
40 | self.condisionComboBox.addItems(searchCondision)
41 | self.condisionComboBox.setFont(QFont("苏新诗柳楷繁", 15))
42 | self.condisionComboBox.setFixedSize(180,40)
43 | self.sbtn = QPushButton(self)
44 | self.sbtn.setText("开 始 识 别")
45 | self.sbtn.setFont(QFont("苏新诗柳楷繁", 15))
46 | self.sbtn.clicked.connect(self.recognize)
47 | self.sbtn.setFixedSize(180,40)
48 |
49 | self.v1box = QVBoxLayout()
50 | self.v1box.addWidget(self.obtn)
51 | self.v1box.addWidget(self.condisionComboBox)
52 | self.v1box.addWidget(self.sbtn)
53 |
54 | self.h1box = QHBoxLayout()
55 | self.h1box.addWidget(self.plabel)
56 | self.h1box.addLayout(self.v1box)
57 |
58 | self.tlabel = QLabel(self)
59 | self.tlabel.setText("识\n别\n结\n果")
60 | self.tlabel.setFont(QFont("苏新诗柳楷繁", 15))
61 | self.tlabel.resize(200, 50)
62 |
63 | self.tbrowser = QTextBrowser(self)
64 | self.tbrowser.setFont(QFont("宋体",10))
65 | self.tbrowser.setFixedSize(600,350)
66 |
67 | self.h2box = QHBoxLayout()
68 | self.h2box.addStretch(1)
69 | self.h2box.addWidget(self.tlabel)
70 | self.h2box.addStretch(1)
71 | self.h2box.addWidget(self.tbrowser)
72 | self.h2box.addStretch(1)
73 |
74 | self.vbox = QVBoxLayout()
75 | self.vbox.addLayout(self.h1box)
76 | self.vbox.addStretch(1)
77 | self.vbox.addLayout(self.h2box)
78 | self.setLayout(self.vbox)
79 |
80 |
81 | def openimage(self):
82 | self.filePath, imgType = QFileDialog.getOpenFileName(self, "打开本地图片", "", "*.jpg;;*.png;;All Files(*)")
83 | self.jpg = QtGui.QPixmap(self.filePath).scaled(self.plabel.width(), self.plabel.height())
84 | self.plabel.setPixmap(self.jpg)
85 |
86 | def recognize(self):
87 | choice = self.condisionComboBox.currentText()
88 | if(choice == "通用文字识别"):
89 | result = aipOcr.basicAccurate(self.get_file_content(self.filePath), options)
90 | words_result = result['words_result']
91 | for i in range(len(words_result)):
92 | self.text = self.text + words_result[i]['words']
93 | self.tbrowser.append(self.text)
94 | elif(choice == "身份证识别"):
95 | result = aipOcr.idcard(self.get_file_content(self.filePath),'front')
96 | print(result)
97 |
98 | def get_file_content(self,filePath):
99 | with open(filePath, 'rb') as fp:
100 | return fp.read()
101 |
102 | if __name__ == '__main__':
103 | app = QApplication(sys.argv)
104 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
105 | aboutWindow = RecognizeDialog()
106 | aboutWindow.show()
107 | sys.exit(app.exec_())
--------------------------------------------------------------------------------
/RecordDetail.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import qdarkstyle
3 | from PyQt5.QtWidgets import (QDialog,QApplication,QHBoxLayout,QLabel,
4 | QVBoxLayout,QPlainTextEdit)
5 | from PyQt5.QtGui import QIcon,QPixmap,QFont
6 | from PyQt5.QtSql import QSqlDatabase,QSqlQuery
7 |
8 |
9 | class RecordDetailDialog(QDialog):
10 | def __init__(self,RecordId):
11 | super(RecordDetailDialog,self).__init__()
12 | self.str = RecordId
13 | self.resize(500,700)
14 | self.setWindowTitle("myOCR——识别详情")
15 | self.setWindowIcon(QIcon('./images/icon.png'))
16 | self.initUI()
17 |
18 | def initUI(self):
19 | self.db = QSqlDatabase.addDatabase("QSQLITE")
20 | self.db.setDatabaseName('./db/myOCR.db')
21 | self.db.open()
22 | self.query = QSqlQuery()
23 | sql = "select RecordId,RecordPath,RecordTime,RecordType,RecordText " \
24 | "from records where RecordId = '%s'" %(self.str)
25 | self.query.exec_(sql)
26 | self.query.next()
27 | id = self.query.value(0)
28 | path = self.query.value(1)
29 | time = self.query.value(2)
30 | type = self.query.value(3)
31 | text = self.query.value(4)
32 |
33 | self.labeltitle = QLabel(self)
34 | self.imagetitle = QPixmap()
35 | self.imagetitle.load(path)
36 | self.labeltitle.setFixedSize(500, 350)
37 | self.labeltitle.setPixmap(self.imagetitle.scaled(self.labeltitle.width(), self.labeltitle.height()))
38 | self.h1box = QHBoxLayout()
39 | self.h1box.addStretch(1)
40 | self.h1box.addWidget(self.labeltitle)
41 | self.h1box.addStretch(1)
42 |
43 | self.idlabel = QLabel()
44 | self.idlabel.setText('识别编号:')
45 | self.idlabel.setFont(QFont("苏新诗柳楷繁", 13))
46 | self.idlabel_ = QLabel()
47 | self.idlabel_.setFont(QFont("苏新诗柳楷繁", 13))
48 | self.idlabel_.setText(id)
49 | self.h2box = QHBoxLayout()
50 | self.h2box.addStretch(1)
51 | self.h2box.addWidget(self.idlabel)
52 | self.h2box.addWidget(self.idlabel_)
53 | self.h2box.addStretch(1)
54 |
55 | self.typelabel = QLabel()
56 | self.typelabel.setText('识别类型:')
57 | self.typelabel.setFont(QFont("苏新诗柳楷繁", 13))
58 | self.typelabel_ = QLabel()
59 | self.typelabel_.setFont(QFont("苏新诗柳楷繁", 13))
60 | self.typelabel_.setText(type)
61 | self.h3box = QHBoxLayout()
62 | self.h3box.addStretch(1)
63 | self.h3box.addWidget(self.typelabel)
64 | self.h3box.addWidget(self.typelabel_)
65 | self.h3box.addStretch(1)
66 |
67 | self.timelabel = QLabel()
68 | self.timelabel.setText('识别时间:')
69 | self.timelabel.setFont(QFont("苏新诗柳楷繁", 13))
70 | self.timelabel_ = QLabel()
71 | self.timelabel_.setFont(QFont("苏新诗柳楷繁", 13))
72 | self.timelabel_.setText(time)
73 | self.h4box = QHBoxLayout()
74 | self.h4box.addStretch(1)
75 | self.h4box.addWidget(self.timelabel)
76 | self.h4box.addWidget(self.timelabel_)
77 | self.h4box.addStretch(1)
78 |
79 | self.text = QPlainTextEdit(self)
80 | self.text.setFixedSize(500,200)
81 | self.text.setFont(QFont("苏新诗柳楷繁", 12))
82 | self.text.setPlainText(text)
83 | self.h5box = QHBoxLayout()
84 | self.h5box.addWidget(self.text)
85 |
86 | self.vbox = QVBoxLayout()
87 | self.vbox.addLayout(self.h1box)
88 | self.vbox.addLayout(self.h2box)
89 | self.vbox.addLayout(self.h3box)
90 | self.vbox.addLayout(self.h4box)
91 | self.vbox.addLayout(self.h5box)
92 | self.setLayout(self.vbox)
93 |
94 |
95 | if __name__ == '__main__':
96 | app = QApplication(sys.argv)
97 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
98 | recorddetailDialog = RecordDetailDialog("d1811273490")
99 | recorddetailDialog.show()
100 | recorddetailDialog.exec_()
101 |
--------------------------------------------------------------------------------
/RecordDetail_id.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import qdarkstyle
3 | from PyQt5.QtWidgets import (QDialog,QApplication,QHBoxLayout,QLabel,
4 | QVBoxLayout,QPlainTextEdit)
5 | from PyQt5.QtGui import QIcon,QPixmap,QFont
6 | from PyQt5.QtSql import QSqlDatabase,QSqlQuery
7 |
8 |
9 | class RecordDetailDialog_id(QDialog):
10 | def __init__(self,RecordId):
11 | super(RecordDetailDialog_id,self).__init__()
12 | self.str = RecordId
13 | self.resize(900,600)
14 | self.setWindowTitle("myOCR——识别详情")
15 | self.setWindowIcon(QIcon('./images/icon.png'))
16 | self.initUI()
17 |
18 | def initUI(self):
19 | self.db = QSqlDatabase.addDatabase("QSQLITE")
20 | self.db.setDatabaseName('./db/myOCR.db')
21 | self.db.open()
22 | self.query = QSqlQuery()
23 | sql = "select * from records where RecordId = '%s'" %(self.str)
24 | self.query.exec_(sql)
25 | self.query.next()
26 | id = self.query.value(0)
27 | path = self.query.value(1)
28 | time = self.query.value(2)
29 | type = self.query.value(3)
30 | text = self.query.value(4)
31 | path_1 = self.query.value(5)
32 |
33 | self.labeltitle = QLabel(self)
34 | self.imagetitle = QPixmap()
35 | self.imagetitle.load(path)
36 | self.labeltitle.setFixedSize(400,300)
37 | self.labeltitle.setPixmap(self.imagetitle.scaled(self.labeltitle.width(), self.labeltitle.height()))
38 |
39 | self.labeltitle_1 = QLabel(self)
40 | self.imagetitle_1 = QPixmap()
41 | self.imagetitle_1.load(path_1)
42 | self.labeltitle_1.setFixedSize(400,300)
43 | self.labeltitle_1.setPixmap(self.imagetitle_1.scaled(self.labeltitle_1.width(), self.labeltitle_1.height()))
44 |
45 | self.idlabel = QLabel()
46 | self.idlabel.setText('识别编号:')
47 | self.idlabel.setFont(QFont("苏新诗柳楷繁", 13))
48 | self.idlabel_ = QLabel()
49 | self.idlabel_.setFont(QFont("苏新诗柳楷繁", 13))
50 | self.idlabel_.setText(id)
51 | self.h2box = QHBoxLayout()
52 | self.h2box.addStretch(1)
53 | self.h2box.addWidget(self.idlabel)
54 | self.h2box.addWidget(self.idlabel_)
55 | self.h2box.addStretch(1)
56 |
57 | self.typelabel = QLabel()
58 | self.typelabel.setText('识别类型:')
59 | self.typelabel.setFont(QFont("苏新诗柳楷繁", 13))
60 | self.typelabel_ = QLabel()
61 | self.typelabel_.setFont(QFont("苏新诗柳楷繁", 13))
62 | self.typelabel_.setText(type)
63 | self.h3box = QHBoxLayout()
64 | self.h3box.addStretch(1)
65 | self.h3box.addWidget(self.typelabel)
66 | self.h3box.addWidget(self.typelabel_)
67 | self.h3box.addStretch(1)
68 |
69 | self.timelabel = QLabel()
70 | self.timelabel.setText('识别时间:')
71 | self.timelabel.setFont(QFont("苏新诗柳楷繁", 13))
72 | self.timelabel_ = QLabel()
73 | self.timelabel_.setFont(QFont("苏新诗柳楷繁", 13))
74 | self.timelabel_.setText(time)
75 | self.h4box = QHBoxLayout()
76 | self.h4box.addStretch(1)
77 | self.h4box.addWidget(self.timelabel)
78 | self.h4box.addWidget(self.timelabel_)
79 | self.h4box.addStretch(1)
80 |
81 | self.text = QPlainTextEdit(self)
82 | self.text.setFixedSize(400,400)
83 | self.text.setFont(QFont("苏新诗柳楷繁", 12))
84 | self.text.setPlainText(text)
85 | self.h5box = QHBoxLayout()
86 | self.h5box.addWidget(self.text)
87 |
88 | self.v1box = QVBoxLayout()
89 | self.v1box.addWidget(self.labeltitle)
90 | self.v1box.addWidget(self.labeltitle_1)
91 |
92 | self.v2box = QVBoxLayout()
93 | self.v2box.addStretch(1)
94 | self.v2box.addLayout(self.h2box)
95 | self.v2box.addStretch(1)
96 | self.v2box.addLayout(self.h3box)
97 | self.v2box.addStretch(1)
98 | self.v2box.addLayout(self.h4box)
99 | self.v2box.addStretch(1)
100 | self.v2box.addLayout(self.h5box)
101 | self.v2box.addStretch(1)
102 | self.hbox = QHBoxLayout()
103 | self.hbox.addStretch(1)
104 | self.hbox.addLayout(self.v1box)
105 | self.hbox.addStretch(1)
106 | self.hbox.addLayout(self.v2box)
107 | self.hbox.addStretch(1)
108 | self.setLayout(self.hbox)
109 |
110 |
111 | if __name__ == '__main__':
112 | app = QApplication(sys.argv)
113 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
114 | recorddetailDialog_id = RecordDetailDialog_id("i1811276394")
115 | recorddetailDialog_id.show()
116 | recorddetailDialog_id.exec_()
117 |
--------------------------------------------------------------------------------
/RecordsViewer.py:
--------------------------------------------------------------------------------
1 | import sys
2 | from PyQt5.QtWidgets import (QWidget, QApplication, QVBoxLayout, QHBoxLayout,
3 | QLineEdit, QPushButton, QComboBox, QLabel, QMessageBox,
4 | QTableView, QAbstractItemView, QDialog)
5 | from PyQt5.QtGui import QIcon, QFont
6 | from PyQt5.QtCore import Qt
7 | from PyQt5.QtSql import QSqlDatabase, QSqlQueryModel
8 | import qdarkstyle
9 | from RecordDetail import RecordDetailDialog
10 | from RecordDetail_id import RecordDetailDialog_id
11 |
12 |
13 | class RecordsViewer(QDialog):
14 | def __init__(self):
15 | super(RecordsViewer, self).__init__()
16 | self.resize(800, 500)
17 | self.setWindowTitle('myOCR——我的识别历史')
18 | self.setWindowIcon(QIcon('./images/icon.png'))
19 | self.queryModel = None
20 | self.tableView = None
21 | self.currentPage = 0
22 | self.totalPage = 0
23 | self.totalRecord = 0
24 | self.pageRecord = 10
25 | self.initUI()
26 |
27 | def initUI(self):
28 | self.vbox = QVBoxLayout()
29 | self.h1box = QHBoxLayout()
30 | self.h2box = QHBoxLayout()
31 |
32 | self.searchEdit = QLineEdit()
33 | self.searchEdit.setFixedHeight(32)
34 | self.searchEdit.setFont(QFont("苏新诗柳楷繁", 15))
35 |
36 | self.searchButton = QPushButton("查询")
37 | self.searchButton.setFixedHeight(32)
38 | self.searchButton.setFont(QFont("苏新诗柳楷繁", 15))
39 |
40 | self.condisionComboBox = QComboBox()
41 | searchCondision = ['按识别编号查询', '按识别时间查询', '按识别类型查询',
42 | '按识别文字查询']
43 | self.condisionComboBox.setFixedHeight(32)
44 | self.condisionComboBox.setFont(QFont("苏新诗柳楷繁", 15))
45 | self.condisionComboBox.addItems(searchCondision)
46 |
47 | self.h1box.addWidget(self.searchEdit)
48 | self.h1box.addWidget(self.condisionComboBox)
49 | self.h1box.addWidget(self.searchButton)
50 |
51 | self.jumpToLabel = QLabel(self)
52 | self.jumpToLabel.setText("跳转到第")
53 | self.jumpToLabel.setFont(QFont("苏新诗柳楷繁", 12))
54 | self.jumpToLabel.setFixedWidth(90)
55 | self.pageEdit = QLineEdit()
56 | self.pageEdit.setFixedWidth(30)
57 | self.pageEdit.setFont(QFont("苏新诗柳楷繁", 12))
58 | s = "/" + str(self.totalPage) + "页"
59 | self.pageLabel = QLabel(s)
60 | self.pageLabel.setFont(QFont("苏新诗柳楷繁", 12))
61 | self.pageLabel.setFixedWidth(40)
62 | self.jumpToButton = QPushButton(self)
63 | self.jumpToButton.setText("跳转")
64 | self.jumpToButton.setFont(QFont("苏新诗柳楷繁", 12))
65 | self.jumpToButton.setFixedHeight(30)
66 | self.jumpToButton.setFixedWidth(60)
67 | self.prevButton = QPushButton("前一页")
68 | self.prevButton.setFont(QFont("苏新诗柳楷繁", 12))
69 | self.prevButton.setFixedHeight(30)
70 | self.prevButton.setFixedWidth(80)
71 | self.backButton = QPushButton("后一页")
72 | self.backButton.setFont(QFont("苏新诗柳楷繁", 12))
73 | self.backButton.setFixedHeight(30)
74 | self.backButton.setFixedWidth(80)
75 |
76 | self.detailbutton = QPushButton(self)
77 | self.detailbutton.setText("详细信息")
78 | self.detailbutton.setFixedWidth(90)
79 | self.detailbutton.setFont(QFont("苏新诗柳楷繁", 12))
80 | self.detailbutton.clicked.connect(self.detailInfo)
81 |
82 | self.hbox = QHBoxLayout()
83 | self.hbox.addWidget(self.jumpToLabel)
84 | self.hbox.addWidget(self.pageEdit)
85 | self.hbox.addWidget(self.pageLabel)
86 | self.hbox.addWidget(self.jumpToButton)
87 | self.hbox.addStretch(1)
88 | self.hbox.addWidget(self.detailbutton)
89 | self.hbox.addStretch(1)
90 | self.hbox.addWidget(self.prevButton)
91 | self.hbox.addWidget(self.backButton)
92 | widget = QWidget()
93 | widget.setLayout(self.hbox)
94 | widget.setFixedWidth(600)
95 | self.h2box.addWidget(widget)
96 |
97 | self.db = QSqlDatabase.addDatabase("QSQLITE")
98 | self.db.setDatabaseName('./db/myOCR.db')
99 | self.db.open()
100 | self.tableView = QTableView()
101 | self.tableView.horizontalHeader().setStretchLastSection(True)
102 | self.tableView.setEditTriggers(QAbstractItemView.NoEditTriggers)
103 | self.tableView.setSelectionBehavior(QAbstractItemView.SelectRows)
104 | self.tableView.setFont(QFont("苏新诗柳楷繁", 12))
105 | self.tableView.horizontalHeader().setFont(QFont("苏新诗柳楷繁", 12))
106 | self.queryModel = QSqlQueryModel()
107 | self.searchButtonClicked()
108 | self.tableView.setModel(self.queryModel)
109 |
110 | self.queryModel.setHeaderData(0, Qt.Horizontal, "识别编号")
111 | self.queryModel.setHeaderData(1, Qt.Horizontal, "识别时间")
112 | self.queryModel.setHeaderData(2, Qt.Horizontal, "识别类型")
113 | self.queryModel.setHeaderData(3, Qt.Horizontal, "识别文字")
114 |
115 | self.vbox.addLayout(self.h1box)
116 | self.vbox.addWidget(self.tableView)
117 | self.vbox.addLayout(self.h2box)
118 | self.setLayout(self.vbox)
119 | self.searchButton.clicked.connect(self.searchButtonClicked)
120 | self.prevButton.clicked.connect(self.prevButtonClicked)
121 | self.backButton.clicked.connect(self.backButtonClicked)
122 | self.jumpToButton.clicked.connect(self.jumpToButtonClicked)
123 | self.searchEdit.returnPressed.connect(self.searchButtonClicked)
124 |
125 | def setButtonStatus(self):
126 | if (self.currentPage == self.totalPage):
127 | self.prevButton.setEnabled(True)
128 | self.backButton.setEnabled(False)
129 | if (self.currentPage == 1):
130 | self.backButton.setEnabled(True)
131 | self.prevButton.setEnabled(False)
132 | if (self.currentPage < self.totalPage and self.currentPage > 1):
133 | self.prevButton.setEnabled(True)
134 | self.backButton.setEnabled(True)
135 |
136 | def getTotalRecordCount(self):
137 | self.queryModel.setQuery("select RecordId,RecordTime,RecordType,RecordText from records")
138 | self.totalRecord = self.queryModel.rowCount()
139 | return
140 |
141 | def getPageCount(self):
142 | self.getTotalRecordCount()
143 | self.totalPage = int((self.totalRecord + self.pageRecord - 1) / self.pageRecord)
144 | return
145 |
146 | def recordQuery(self, index):
147 | conditionChoice = self.condisionComboBox.currentText()
148 | if (conditionChoice == "按识别编号查询"):
149 | conditionChoice = 'RecordId'
150 | elif (conditionChoice == "按识别时间查询"):
151 | conditionChoice = 'RecordTime'
152 | elif (conditionChoice == "按识别类型查询"):
153 | conditionChoice = 'RecordType'
154 | else:
155 | conditionChoice = 'RecordText'
156 |
157 |
158 | if (self.searchEdit.text() == ""):
159 | queryCondition = "select RecordId,RecordTime,RecordType,RecordText from records order by RecordTime DESC"
160 | self.queryModel.setQuery(queryCondition)
161 | self.totalRecord = self.queryModel.rowCount()
162 | self.totalPage = int((self.totalRecord + self.pageRecord - 1) / self.pageRecord)
163 | label = "/" + str(int(self.totalPage)) + "页"
164 | self.pageLabel.setText(label)
165 | queryCondition = ("select RecordId,RecordTime,RecordType,RecordText from records order by %s desc limit %d,%d " % (
166 | conditionChoice, index, self.pageRecord))
167 | self.queryModel.setQuery(queryCondition)
168 | self.setButtonStatus()
169 | return
170 |
171 | temp = self.searchEdit.text()
172 | s = '%'
173 | for i in range(0, len(temp)):
174 | s = s + temp[i] + "%"
175 | queryCondition = ("select RecordId,RecordTime,RecordType,RecordText from records where %s like '%s' order by %s desc" % (
176 | conditionChoice, s, conditionChoice))
177 | self.queryModel.setQuery(queryCondition)
178 | self.totalRecord = self.queryModel.rowCount()
179 | if (self.totalRecord == 0):
180 | print(QMessageBox.information(self, "提醒", "查询无记录", QMessageBox.Yes, QMessageBox.Yes))
181 | queryCondition = "select RecordId,RecordTime,RecordType,RecordText from records order by RecordTime DESC"
182 | self.queryModel.setQuery(queryCondition)
183 | self.totalRecord = self.queryModel.rowCount()
184 | self.totalPage = int((self.totalRecord + self.pageRecord - 1) / self.pageRecord)
185 | label = "/" + str(int(self.totalPage)) + "页"
186 | self.pageLabel.setText(label)
187 | queryCondition = ("select RecordId,RecordTime,RecordType,RecordText from records order by %s desc limit %d,%d " % (
188 | conditionChoice, index, self.pageRecord))
189 | self.queryModel.setQuery(queryCondition)
190 | self.setButtonStatus()
191 | return
192 | self.totalPage = int((self.totalRecord + self.pageRecord - 1) / self.pageRecord)
193 | label = "/" + str(int(self.totalPage)) + "页"
194 | self.pageLabel.setText(label)
195 | queryCondition = ("select RecordId,RecordTime,RecordType,RecordText from records where %s like '%s' order by %s desc limit %d,%d " % (
196 | conditionChoice, s, conditionChoice, index, self.pageRecord))
197 | self.queryModel.setQuery(queryCondition)
198 | self.setButtonStatus()
199 | return
200 |
201 | def searchButtonClicked(self):
202 | self.currentPage = 1
203 | self.pageEdit.setText(str(self.currentPage))
204 | self.getPageCount()
205 | s = "/" + str(int(self.totalPage)) + "页"
206 | self.pageLabel.setText(s)
207 | index = (self.currentPage - 1) * self.pageRecord
208 | self.recordQuery(index)
209 | return
210 |
211 | def prevButtonClicked(self):
212 | self.currentPage -= 1
213 | if (self.currentPage <= 1):
214 | self.currentPage = 1
215 | self.pageEdit.setText(str(self.currentPage))
216 | index = (self.currentPage - 1) * self.pageRecord
217 | self.recordQuery(index)
218 | return
219 |
220 | def backButtonClicked(self):
221 | self.currentPage += 1
222 | if (self.currentPage >= int(self.totalPage)):
223 | self.currentPage = int(self.totalPage)
224 | self.pageEdit.setText(str(self.currentPage))
225 | index = (self.currentPage - 1) * self.pageRecord
226 | self.recordQuery(index)
227 | return
228 |
229 | def jumpToButtonClicked(self):
230 | if (self.pageEdit.text().isdigit()):
231 | self.currentPage = int(self.pageEdit.text())
232 | if (self.currentPage > self.totalPage):
233 | self.currentPage = self.totalPage
234 | if (self.currentPage <= 1):
235 | self.currentPage = 1
236 | else:
237 | self.currentPage = 1
238 | index = (self.currentPage - 1) * self.pageRecord
239 | self.pageEdit.setText(str(self.currentPage))
240 | self.recordQuery(index)
241 | return
242 |
243 | def detailInfo(self):
244 | index_ = self.tableView.currentIndex().row()
245 | if (index_ == -1):
246 | print(QMessageBox.warning(self, "警告", "您没有选中任何记录", QMessageBox.Yes, QMessageBox.Yes))
247 | return
248 | else:
249 | str = self.queryModel.data(self.queryModel.index(index_, 0))
250 | type = self.queryModel.data(self.queryModel.index(index_, 2))
251 | if(type == '身份证识别'):
252 | self.recordDetail_id(str)
253 | else:
254 | self.recordDetail(str)
255 |
256 | def recordDetail(self, RecordId):
257 | recorddetaildialog = RecordDetailDialog(RecordId)
258 | recorddetaildialog.show()
259 | recorddetaildialog.exec_()
260 |
261 | def recordDetail_id(self,RecordId):
262 | recorddetail_id = RecordDetailDialog_id(RecordId)
263 | recorddetail_id.show()
264 | recorddetail_id.exec_()
265 |
266 |
267 | if __name__ == '__main__':
268 | app = QApplication(sys.argv)
269 | app.setStyleSheet(qdarkstyle.load_stylesheet_pyqt5())
270 | recordsWindow = RecordsViewer()
271 | recordsWindow.show()
272 | sys.exit(app.exec_())
--------------------------------------------------------------------------------
/__pycache__/AboutDialog.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/__pycache__/AboutDialog.cpython-36.pyc
--------------------------------------------------------------------------------
/__pycache__/BankCardRecognize.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/__pycache__/BankCardRecognize.cpython-36.pyc
--------------------------------------------------------------------------------
/__pycache__/BasicRecognize.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/__pycache__/BasicRecognize.cpython-36.pyc
--------------------------------------------------------------------------------
/__pycache__/CarCardRecognize.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/__pycache__/CarCardRecognize.cpython-36.pyc
--------------------------------------------------------------------------------
/__pycache__/DriveCardRecognize.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/__pycache__/DriveCardRecognize.cpython-36.pyc
--------------------------------------------------------------------------------
/__pycache__/HomePageWidget.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/__pycache__/HomePageWidget.cpython-36.pyc
--------------------------------------------------------------------------------
/__pycache__/IDCardRecognize.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/__pycache__/IDCardRecognize.cpython-36.pyc
--------------------------------------------------------------------------------
/__pycache__/MainWindow.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/__pycache__/MainWindow.cpython-36.pyc
--------------------------------------------------------------------------------
/__pycache__/PlateRecognize.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/__pycache__/PlateRecognize.cpython-36.pyc
--------------------------------------------------------------------------------
/__pycache__/RecordDetail.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/__pycache__/RecordDetail.cpython-36.pyc
--------------------------------------------------------------------------------
/__pycache__/RecordDetail_id.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/__pycache__/RecordDetail_id.cpython-36.pyc
--------------------------------------------------------------------------------
/__pycache__/RecordsViewer.cpython-36.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/__pycache__/RecordsViewer.cpython-36.pyc
--------------------------------------------------------------------------------
/db/myOCR.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/db/myOCR.db
--------------------------------------------------------------------------------
/db/myPet.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/db/myPet.db
--------------------------------------------------------------------------------
/images/QQ截图20181127222748.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/images/QQ截图20181127222748.jpg
--------------------------------------------------------------------------------
/images/bankcard_test.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/images/bankcard_test.jpg
--------------------------------------------------------------------------------
/images/basic_test.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/images/basic_test.jpg
--------------------------------------------------------------------------------
/images/carcard_test.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/images/carcard_test.jpg
--------------------------------------------------------------------------------
/images/drivecard_test.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/images/drivecard_test.jpg
--------------------------------------------------------------------------------
/images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/images/icon.png
--------------------------------------------------------------------------------
/images/plate_test.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/images/plate_test.jpg
--------------------------------------------------------------------------------
/images/title.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/images/title.png
--------------------------------------------------------------------------------
/images/下载.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/images/下载.jpg
--------------------------------------------------------------------------------
/images/下载1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/images/下载1.jpg
--------------------------------------------------------------------------------
/images/下载2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/images/下载2.jpg
--------------------------------------------------------------------------------
/images/下载3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/images/下载3.jpg
--------------------------------------------------------------------------------
/venv/Lib/tcl8.6/init.tcl:
--------------------------------------------------------------------------------
1 | # init.tcl --
2 | #
3 | # Default system startup file for Tcl-based applications. Defines
4 | # "unknown" procedure and auto-load facilities.
5 | #
6 | # Copyright (c) 1991-1993 The Regents of the University of California.
7 | # Copyright (c) 1994-1996 Sun Microsystems, Inc.
8 | # Copyright (c) 1998-1999 Scriptics Corporation.
9 | # Copyright (c) 2004 by Kevin B. Kenny. All rights reserved.
10 | #
11 | # See the file "license.terms" for information on usage and redistribution
12 | # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13 | #
14 |
15 | # This test intentionally written in pre-7.5 Tcl
16 | if {[info commands package] == ""} {
17 | error "version mismatch: library\nscripts expect Tcl version 7.5b1 or later but the loaded version is\nonly [info patchlevel]"
18 | }
19 | package require -exact Tcl 8.6.7
20 |
21 | # Compute the auto path to use in this interpreter.
22 | # The values on the path come from several locations:
23 | #
24 | # The environment variable TCLLIBPATH
25 | #
26 | # tcl_library, which is the directory containing this init.tcl script.
27 | # [tclInit] (Tcl_Init()) searches around for the directory containing this
28 | # init.tcl and defines tcl_library to that location before sourcing it.
29 | #
30 | # The parent directory of tcl_library. Adding the parent
31 | # means that packages in peer directories will be found automatically.
32 | #
33 | # Also add the directory ../lib relative to the directory where the
34 | # executable is located. This is meant to find binary packages for the
35 | # same architecture as the current executable.
36 | #
37 | # tcl_pkgPath, which is set by the platform-specific initialization routines
38 | # On UNIX it is compiled in
39 | # On Windows, it is not used
40 |
41 | if {![info exists auto_path]} {
42 | if {[info exists env(TCLLIBPATH)]} {
43 | set auto_path $env(TCLLIBPATH)
44 | } else {
45 | set auto_path ""
46 | }
47 | }
48 | namespace eval tcl {
49 | variable Dir
50 | foreach Dir [list $::tcl_library [file dirname $::tcl_library]] {
51 | if {$Dir ni $::auto_path} {
52 | lappend ::auto_path $Dir
53 | }
54 | }
55 | set Dir [file join [file dirname [file dirname \
56 | [info nameofexecutable]]] lib]
57 | if {$Dir ni $::auto_path} {
58 | lappend ::auto_path $Dir
59 | }
60 | catch {
61 | foreach Dir $::tcl_pkgPath {
62 | if {$Dir ni $::auto_path} {
63 | lappend ::auto_path $Dir
64 | }
65 | }
66 | }
67 |
68 | if {![interp issafe]} {
69 | variable Path [encoding dirs]
70 | set Dir [file join $::tcl_library encoding]
71 | if {$Dir ni $Path} {
72 | lappend Path $Dir
73 | encoding dirs $Path
74 | }
75 | }
76 |
77 | # TIP #255 min and max functions
78 | namespace eval mathfunc {
79 | proc min {args} {
80 | if {![llength $args]} {
81 | return -code error \
82 | "too few arguments to math function \"min\""
83 | }
84 | set val Inf
85 | foreach arg $args {
86 | # This will handle forcing the numeric value without
87 | # ruining the internal type of a numeric object
88 | if {[catch {expr {double($arg)}} err]} {
89 | return -code error $err
90 | }
91 | if {$arg < $val} {set val $arg}
92 | }
93 | return $val
94 | }
95 | proc max {args} {
96 | if {![llength $args]} {
97 | return -code error \
98 | "too few arguments to math function \"max\""
99 | }
100 | set val -Inf
101 | foreach arg $args {
102 | # This will handle forcing the numeric value without
103 | # ruining the internal type of a numeric object
104 | if {[catch {expr {double($arg)}} err]} {
105 | return -code error $err
106 | }
107 | if {$arg > $val} {set val $arg}
108 | }
109 | return $val
110 | }
111 | namespace export min max
112 | }
113 | }
114 |
115 | # Windows specific end of initialization
116 |
117 | if {(![interp issafe]) && ($tcl_platform(platform) eq "windows")} {
118 | namespace eval tcl {
119 | proc EnvTraceProc {lo n1 n2 op} {
120 | global env
121 | set x $env($n2)
122 | set env($lo) $x
123 | set env([string toupper $lo]) $x
124 | }
125 | proc InitWinEnv {} {
126 | global env tcl_platform
127 | foreach p [array names env] {
128 | set u [string toupper $p]
129 | if {$u ne $p} {
130 | switch -- $u {
131 | COMSPEC -
132 | PATH {
133 | set temp $env($p)
134 | unset env($p)
135 | set env($u) $temp
136 | trace add variable env($p) write \
137 | [namespace code [list EnvTraceProc $p]]
138 | trace add variable env($u) write \
139 | [namespace code [list EnvTraceProc $p]]
140 | }
141 | }
142 | }
143 | }
144 | if {![info exists env(COMSPEC)]} {
145 | set env(COMSPEC) cmd.exe
146 | }
147 | }
148 | InitWinEnv
149 | }
150 | }
151 |
152 | # Setup the unknown package handler
153 |
154 |
155 | if {[interp issafe]} {
156 | package unknown {::tcl::tm::UnknownHandler ::tclPkgUnknown}
157 | } else {
158 | # Set up search for Tcl Modules (TIP #189).
159 | # and setup platform specific unknown package handlers
160 | if {$tcl_platform(os) eq "Darwin"
161 | && $tcl_platform(platform) eq "unix"} {
162 | package unknown {::tcl::tm::UnknownHandler \
163 | {::tcl::MacOSXPkgUnknown ::tclPkgUnknown}}
164 | } else {
165 | package unknown {::tcl::tm::UnknownHandler ::tclPkgUnknown}
166 | }
167 |
168 | # Set up the 'clock' ensemble
169 |
170 | namespace eval ::tcl::clock [list variable TclLibDir $::tcl_library]
171 |
172 | proc ::tcl::initClock {} {
173 | # Auto-loading stubs for 'clock.tcl'
174 |
175 | foreach cmd {add format scan} {
176 | proc ::tcl::clock::$cmd args {
177 | variable TclLibDir
178 | source -encoding utf-8 [file join $TclLibDir clock.tcl]
179 | return [uplevel 1 [info level 0]]
180 | }
181 | }
182 |
183 | rename ::tcl::initClock {}
184 | }
185 | ::tcl::initClock
186 | }
187 |
188 | # Conditionalize for presence of exec.
189 |
190 | if {[namespace which -command exec] eq ""} {
191 |
192 | # Some machines do not have exec. Also, on all
193 | # platforms, safe interpreters do not have exec.
194 |
195 | set auto_noexec 1
196 | }
197 |
198 | # Define a log command (which can be overwitten to log errors
199 | # differently, specially when stderr is not available)
200 |
201 | if {[namespace which -command tclLog] eq ""} {
202 | proc tclLog {string} {
203 | catch {puts stderr $string}
204 | }
205 | }
206 |
207 | # unknown --
208 | # This procedure is called when a Tcl command is invoked that doesn't
209 | # exist in the interpreter. It takes the following steps to make the
210 | # command available:
211 | #
212 | # 1. See if the autoload facility can locate the command in a
213 | # Tcl script file. If so, load it and execute it.
214 | # 2. If the command was invoked interactively at top-level:
215 | # (a) see if the command exists as an executable UNIX program.
216 | # If so, "exec" the command.
217 | # (b) see if the command requests csh-like history substitution
218 | # in one of the common forms !!, !, or ^old^new. If
219 | # so, emulate csh's history substitution.
220 | # (c) see if the command is a unique abbreviation for another
221 | # command. If so, invoke the command.
222 | #
223 | # Arguments:
224 | # args - A list whose elements are the words of the original
225 | # command, including the command name.
226 |
227 | proc unknown args {
228 | variable ::tcl::UnknownPending
229 | global auto_noexec auto_noload env tcl_interactive errorInfo errorCode
230 |
231 | if {[info exists errorInfo]} {
232 | set savedErrorInfo $errorInfo
233 | }
234 | if {[info exists errorCode]} {
235 | set savedErrorCode $errorCode
236 | }
237 |
238 | set name [lindex $args 0]
239 | if {![info exists auto_noload]} {
240 | #
241 | # Make sure we're not trying to load the same proc twice.
242 | #
243 | if {[info exists UnknownPending($name)]} {
244 | return -code error "self-referential recursion\
245 | in \"unknown\" for command \"$name\""
246 | }
247 | set UnknownPending($name) pending
248 | set ret [catch {
249 | auto_load $name [uplevel 1 {::namespace current}]
250 | } msg opts]
251 | unset UnknownPending($name)
252 | if {$ret != 0} {
253 | dict append opts -errorinfo "\n (autoloading \"$name\")"
254 | return -options $opts $msg
255 | }
256 | if {![array size UnknownPending]} {
257 | unset UnknownPending
258 | }
259 | if {$msg} {
260 | if {[info exists savedErrorCode]} {
261 | set ::errorCode $savedErrorCode
262 | } else {
263 | unset -nocomplain ::errorCode
264 | }
265 | if {[info exists savedErrorInfo]} {
266 | set errorInfo $savedErrorInfo
267 | } else {
268 | unset -nocomplain errorInfo
269 | }
270 | set code [catch {uplevel 1 $args} msg opts]
271 | if {$code == 1} {
272 | #
273 | # Compute stack trace contribution from the [uplevel].
274 | # Note the dependence on how Tcl_AddErrorInfo, etc.
275 | # construct the stack trace.
276 | #
277 | set errInfo [dict get $opts -errorinfo]
278 | set errCode [dict get $opts -errorcode]
279 | set cinfo $args
280 | if {[string bytelength $cinfo] > 150} {
281 | set cinfo [string range $cinfo 0 150]
282 | while {[string bytelength $cinfo] > 150} {
283 | set cinfo [string range $cinfo 0 end-1]
284 | }
285 | append cinfo ...
286 | }
287 | set tail "\n (\"uplevel\" body line 1)\n invoked\
288 | from within\n\"uplevel 1 \$args\""
289 | set expect "$msg\n while executing\n\"$cinfo\"$tail"
290 | if {$errInfo eq $expect} {
291 | #
292 | # The stack has only the eval from the expanded command
293 | # Do not generate any stack trace here.
294 | #
295 | dict unset opts -errorinfo
296 | dict incr opts -level
297 | return -options $opts $msg
298 | }
299 | #
300 | # Stack trace is nested, trim off just the contribution
301 | # from the extra "eval" of $args due to the "catch" above.
302 | #
303 | set last [string last $tail $errInfo]
304 | if {$last + [string length $tail] != [string length $errInfo]} {
305 | # Very likely cannot happen
306 | return -options $opts $msg
307 | }
308 | set errInfo [string range $errInfo 0 $last-1]
309 | set tail "\"$cinfo\""
310 | set last [string last $tail $errInfo]
311 | if {$last + [string length $tail] != [string length $errInfo]} {
312 | return -code error -errorcode $errCode \
313 | -errorinfo $errInfo $msg
314 | }
315 | set errInfo [string range $errInfo 0 $last-1]
316 | set tail "\n invoked from within\n"
317 | set last [string last $tail $errInfo]
318 | if {$last + [string length $tail] == [string length $errInfo]} {
319 | return -code error -errorcode $errCode \
320 | -errorinfo [string range $errInfo 0 $last-1] $msg
321 | }
322 | set tail "\n while executing\n"
323 | set last [string last $tail $errInfo]
324 | if {$last + [string length $tail] == [string length $errInfo]} {
325 | return -code error -errorcode $errCode \
326 | -errorinfo [string range $errInfo 0 $last-1] $msg
327 | }
328 | return -options $opts $msg
329 | } else {
330 | dict incr opts -level
331 | return -options $opts $msg
332 | }
333 | }
334 | }
335 |
336 | if {([info level] == 1) && ([info script] eq "")
337 | && [info exists tcl_interactive] && $tcl_interactive} {
338 | if {![info exists auto_noexec]} {
339 | set new [auto_execok $name]
340 | if {$new ne ""} {
341 | set redir ""
342 | if {[namespace which -command console] eq ""} {
343 | set redir ">&@stdout <@stdin"
344 | }
345 | uplevel 1 [list ::catch \
346 | [concat exec $redir $new [lrange $args 1 end]] \
347 | ::tcl::UnknownResult ::tcl::UnknownOptions]
348 | dict incr ::tcl::UnknownOptions -level
349 | return -options $::tcl::UnknownOptions $::tcl::UnknownResult
350 | }
351 | }
352 | if {$name eq "!!"} {
353 | set newcmd [history event]
354 | } elseif {[regexp {^!(.+)$} $name -> event]} {
355 | set newcmd [history event $event]
356 | } elseif {[regexp {^\^([^^]*)\^([^^]*)\^?$} $name -> old new]} {
357 | set newcmd [history event -1]
358 | catch {regsub -all -- $old $newcmd $new newcmd}
359 | }
360 | if {[info exists newcmd]} {
361 | tclLog $newcmd
362 | history change $newcmd 0
363 | uplevel 1 [list ::catch $newcmd \
364 | ::tcl::UnknownResult ::tcl::UnknownOptions]
365 | dict incr ::tcl::UnknownOptions -level
366 | return -options $::tcl::UnknownOptions $::tcl::UnknownResult
367 | }
368 |
369 | set ret [catch {set candidates [info commands $name*]} msg]
370 | if {$name eq "::"} {
371 | set name ""
372 | }
373 | if {$ret != 0} {
374 | dict append opts -errorinfo \
375 | "\n (expanding command prefix \"$name\" in unknown)"
376 | return -options $opts $msg
377 | }
378 | # Filter out bogus matches when $name contained
379 | # a glob-special char [Bug 946952]
380 | if {$name eq ""} {
381 | # Handle empty $name separately due to strangeness
382 | # in [string first] (See RFE 1243354)
383 | set cmds $candidates
384 | } else {
385 | set cmds [list]
386 | foreach x $candidates {
387 | if {[string first $name $x] == 0} {
388 | lappend cmds $x
389 | }
390 | }
391 | }
392 | if {[llength $cmds] == 1} {
393 | uplevel 1 [list ::catch [lreplace $args 0 0 [lindex $cmds 0]] \
394 | ::tcl::UnknownResult ::tcl::UnknownOptions]
395 | dict incr ::tcl::UnknownOptions -level
396 | return -options $::tcl::UnknownOptions $::tcl::UnknownResult
397 | }
398 | if {[llength $cmds]} {
399 | return -code error "ambiguous command name \"$name\": [lsort $cmds]"
400 | }
401 | }
402 | return -code error -errorcode [list TCL LOOKUP COMMAND $name] \
403 | "invalid command name \"$name\""
404 | }
405 |
406 | # auto_load --
407 | # Checks a collection of library directories to see if a procedure
408 | # is defined in one of them. If so, it sources the appropriate
409 | # library file to create the procedure. Returns 1 if it successfully
410 | # loaded the procedure, 0 otherwise.
411 | #
412 | # Arguments:
413 | # cmd - Name of the command to find and load.
414 | # namespace (optional) The namespace where the command is being used - must be
415 | # a canonical namespace as returned [namespace current]
416 | # for instance. If not given, namespace current is used.
417 |
418 | proc auto_load {cmd {namespace {}}} {
419 | global auto_index auto_path
420 |
421 | if {$namespace eq ""} {
422 | set namespace [uplevel 1 [list ::namespace current]]
423 | }
424 | set nameList [auto_qualify $cmd $namespace]
425 | # workaround non canonical auto_index entries that might be around
426 | # from older auto_mkindex versions
427 | lappend nameList $cmd
428 | foreach name $nameList {
429 | if {[info exists auto_index($name)]} {
430 | namespace eval :: $auto_index($name)
431 | # There's a couple of ways to look for a command of a given
432 | # name. One is to use
433 | # info commands $name
434 | # Unfortunately, if the name has glob-magic chars in it like *
435 | # or [], it may not match. For our purposes here, a better
436 | # route is to use
437 | # namespace which -command $name
438 | if {[namespace which -command $name] ne ""} {
439 | return 1
440 | }
441 | }
442 | }
443 | if {![info exists auto_path]} {
444 | return 0
445 | }
446 |
447 | if {![auto_load_index]} {
448 | return 0
449 | }
450 | foreach name $nameList {
451 | if {[info exists auto_index($name)]} {
452 | namespace eval :: $auto_index($name)
453 | if {[namespace which -command $name] ne ""} {
454 | return 1
455 | }
456 | }
457 | }
458 | return 0
459 | }
460 |
461 | # auto_load_index --
462 | # Loads the contents of tclIndex files on the auto_path directory
463 | # list. This is usually invoked within auto_load to load the index
464 | # of available commands. Returns 1 if the index is loaded, and 0 if
465 | # the index is already loaded and up to date.
466 | #
467 | # Arguments:
468 | # None.
469 |
470 | proc auto_load_index {} {
471 | variable ::tcl::auto_oldpath
472 | global auto_index auto_path
473 |
474 | if {[info exists auto_oldpath] && ($auto_oldpath eq $auto_path)} {
475 | return 0
476 | }
477 | set auto_oldpath $auto_path
478 |
479 | # Check if we are a safe interpreter. In that case, we support only
480 | # newer format tclIndex files.
481 |
482 | set issafe [interp issafe]
483 | for {set i [expr {[llength $auto_path] - 1}]} {$i >= 0} {incr i -1} {
484 | set dir [lindex $auto_path $i]
485 | set f ""
486 | if {$issafe} {
487 | catch {source [file join $dir tclIndex]}
488 | } elseif {[catch {set f [open [file join $dir tclIndex]]}]} {
489 | continue
490 | } else {
491 | set error [catch {
492 | set id [gets $f]
493 | if {$id eq "# Tcl autoload index file, version 2.0"} {
494 | eval [read $f]
495 | } elseif {$id eq "# Tcl autoload index file: each line identifies a Tcl"} {
496 | while {[gets $f line] >= 0} {
497 | if {([string index $line 0] eq "#") \
498 | || ([llength $line] != 2)} {
499 | continue
500 | }
501 | set name [lindex $line 0]
502 | set auto_index($name) \
503 | "source [file join $dir [lindex $line 1]]"
504 | }
505 | } else {
506 | error "[file join $dir tclIndex] isn't a proper Tcl index file"
507 | }
508 | } msg opts]
509 | if {$f ne ""} {
510 | close $f
511 | }
512 | if {$error} {
513 | return -options $opts $msg
514 | }
515 | }
516 | }
517 | return 1
518 | }
519 |
520 | # auto_qualify --
521 | #
522 | # Compute a fully qualified names list for use in the auto_index array.
523 | # For historical reasons, commands in the global namespace do not have leading
524 | # :: in the index key. The list has two elements when the command name is
525 | # relative (no leading ::) and the namespace is not the global one. Otherwise
526 | # only one name is returned (and searched in the auto_index).
527 | #
528 | # Arguments -
529 | # cmd The command name. Can be any name accepted for command
530 | # invocations (Like "foo::::bar").
531 | # namespace The namespace where the command is being used - must be
532 | # a canonical namespace as returned by [namespace current]
533 | # for instance.
534 |
535 | proc auto_qualify {cmd namespace} {
536 |
537 | # count separators and clean them up
538 | # (making sure that foo:::::bar will be treated as foo::bar)
539 | set n [regsub -all {::+} $cmd :: cmd]
540 |
541 | # Ignore namespace if the name starts with ::
542 | # Handle special case of only leading ::
543 |
544 | # Before each return case we give an example of which category it is
545 | # with the following form :
546 | # (inputCmd, inputNameSpace) -> output
547 |
548 | if {[string match ::* $cmd]} {
549 | if {$n > 1} {
550 | # (::foo::bar , *) -> ::foo::bar
551 | return [list $cmd]
552 | } else {
553 | # (::global , *) -> global
554 | return [list [string range $cmd 2 end]]
555 | }
556 | }
557 |
558 | # Potentially returning 2 elements to try :
559 | # (if the current namespace is not the global one)
560 |
561 | if {$n == 0} {
562 | if {$namespace eq "::"} {
563 | # (nocolons , ::) -> nocolons
564 | return [list $cmd]
565 | } else {
566 | # (nocolons , ::sub) -> ::sub::nocolons nocolons
567 | return [list ${namespace}::$cmd $cmd]
568 | }
569 | } elseif {$namespace eq "::"} {
570 | # (foo::bar , ::) -> ::foo::bar
571 | return [list ::$cmd]
572 | } else {
573 | # (foo::bar , ::sub) -> ::sub::foo::bar ::foo::bar
574 | return [list ${namespace}::$cmd ::$cmd]
575 | }
576 | }
577 |
578 | # auto_import --
579 | #
580 | # Invoked during "namespace import" to make see if the imported commands
581 | # reside in an autoloaded library. If so, the commands are loaded so
582 | # that they will be available for the import links. If not, then this
583 | # procedure does nothing.
584 | #
585 | # Arguments -
586 | # pattern The pattern of commands being imported (like "foo::*")
587 | # a canonical namespace as returned by [namespace current]
588 |
589 | proc auto_import {pattern} {
590 | global auto_index
591 |
592 | # If no namespace is specified, this will be an error case
593 |
594 | if {![string match *::* $pattern]} {
595 | return
596 | }
597 |
598 | set ns [uplevel 1 [list ::namespace current]]
599 | set patternList [auto_qualify $pattern $ns]
600 |
601 | auto_load_index
602 |
603 | foreach pattern $patternList {
604 | foreach name [array names auto_index $pattern] {
605 | if {([namespace which -command $name] eq "")
606 | && ([namespace qualifiers $pattern] eq [namespace qualifiers $name])} {
607 | namespace eval :: $auto_index($name)
608 | }
609 | }
610 | }
611 | }
612 |
613 | # auto_execok --
614 | #
615 | # Returns string that indicates name of program to execute if
616 | # name corresponds to a shell builtin or an executable in the
617 | # Windows search path, or "" otherwise. Builds an associative
618 | # array auto_execs that caches information about previous checks,
619 | # for speed.
620 | #
621 | # Arguments:
622 | # name - Name of a command.
623 |
624 | if {$tcl_platform(platform) eq "windows"} {
625 | # Windows version.
626 | #
627 | # Note that info executable doesn't work under Windows, so we have to
628 | # look for files with .exe, .com, or .bat extensions. Also, the path
629 | # may be in the Path or PATH environment variables, and path
630 | # components are separated with semicolons, not colons as under Unix.
631 | #
632 | proc auto_execok name {
633 | global auto_execs env tcl_platform
634 |
635 | if {[info exists auto_execs($name)]} {
636 | return $auto_execs($name)
637 | }
638 | set auto_execs($name) ""
639 |
640 | set shellBuiltins [list cls copy date del dir echo erase md mkdir \
641 | mklink rd ren rename rmdir start time type ver vol]
642 | if {[info exists env(PATHEXT)]} {
643 | # Add an initial ; to have the {} extension check first.
644 | set execExtensions [split ";$env(PATHEXT)" ";"]
645 | } else {
646 | set execExtensions [list {} .com .exe .bat .cmd]
647 | }
648 |
649 | if {[string tolower $name] in $shellBuiltins} {
650 | # When this is command.com for some reason on Win2K, Tcl won't
651 | # exec it unless the case is right, which this corrects. COMSPEC
652 | # may not point to a real file, so do the check.
653 | set cmd $env(COMSPEC)
654 | if {[file exists $cmd]} {
655 | set cmd [file attributes $cmd -shortname]
656 | }
657 | return [set auto_execs($name) [list $cmd /c $name]]
658 | }
659 |
660 | if {[llength [file split $name]] != 1} {
661 | foreach ext $execExtensions {
662 | set file ${name}${ext}
663 | if {[file exists $file] && ![file isdirectory $file]} {
664 | return [set auto_execs($name) [list $file]]
665 | }
666 | }
667 | return ""
668 | }
669 |
670 | set path "[file dirname [info nameof]];.;"
671 | if {[info exists env(WINDIR)]} {
672 | set windir $env(WINDIR)
673 | }
674 | if {[info exists windir]} {
675 | if {$tcl_platform(os) eq "Windows NT"} {
676 | append path "$windir/system32;"
677 | }
678 | append path "$windir/system;$windir;"
679 | }
680 |
681 | foreach var {PATH Path path} {
682 | if {[info exists env($var)]} {
683 | append path ";$env($var)"
684 | }
685 | }
686 |
687 | foreach ext $execExtensions {
688 | unset -nocomplain checked
689 | foreach dir [split $path {;}] {
690 | # Skip already checked directories
691 | if {[info exists checked($dir)] || ($dir eq "")} {
692 | continue
693 | }
694 | set checked($dir) {}
695 | set file [file join $dir ${name}${ext}]
696 | if {[file exists $file] && ![file isdirectory $file]} {
697 | return [set auto_execs($name) [list $file]]
698 | }
699 | }
700 | }
701 | return ""
702 | }
703 |
704 | } else {
705 | # Unix version.
706 | #
707 | proc auto_execok name {
708 | global auto_execs env
709 |
710 | if {[info exists auto_execs($name)]} {
711 | return $auto_execs($name)
712 | }
713 | set auto_execs($name) ""
714 | if {[llength [file split $name]] != 1} {
715 | if {[file executable $name] && ![file isdirectory $name]} {
716 | set auto_execs($name) [list $name]
717 | }
718 | return $auto_execs($name)
719 | }
720 | foreach dir [split $env(PATH) :] {
721 | if {$dir eq ""} {
722 | set dir .
723 | }
724 | set file [file join $dir $name]
725 | if {[file executable $file] && ![file isdirectory $file]} {
726 | set auto_execs($name) [list $file]
727 | return $auto_execs($name)
728 | }
729 | }
730 | return ""
731 | }
732 |
733 | }
734 |
735 | # ::tcl::CopyDirectory --
736 | #
737 | # This procedure is called by Tcl's core when attempts to call the
738 | # filesystem's copydirectory function fail. The semantics of the call
739 | # are that 'dest' does not yet exist, i.e. dest should become the exact
740 | # image of src. If dest does exist, we throw an error.
741 | #
742 | # Note that making changes to this procedure can change the results
743 | # of running Tcl's tests.
744 | #
745 | # Arguments:
746 | # action - "renaming" or "copying"
747 | # src - source directory
748 | # dest - destination directory
749 | proc tcl::CopyDirectory {action src dest} {
750 | set nsrc [file normalize $src]
751 | set ndest [file normalize $dest]
752 |
753 | if {$action eq "renaming"} {
754 | # Can't rename volumes. We could give a more precise
755 | # error message here, but that would break the test suite.
756 | if {$nsrc in [file volumes]} {
757 | return -code error "error $action \"$src\" to\
758 | \"$dest\": trying to rename a volume or move a directory\
759 | into itself"
760 | }
761 | }
762 | if {[file exists $dest]} {
763 | if {$nsrc eq $ndest} {
764 | return -code error "error $action \"$src\" to\
765 | \"$dest\": trying to rename a volume or move a directory\
766 | into itself"
767 | }
768 | if {$action eq "copying"} {
769 | # We used to throw an error here, but, looking more closely
770 | # at the core copy code in tclFCmd.c, if the destination
771 | # exists, then we should only call this function if -force
772 | # is true, which means we just want to over-write. So,
773 | # the following code is now commented out.
774 | #
775 | # return -code error "error $action \"$src\" to\
776 | # \"$dest\": file already exists"
777 | } else {
778 | # Depending on the platform, and on the current
779 | # working directory, the directories '.', '..'
780 | # can be returned in various combinations. Anyway,
781 | # if any other file is returned, we must signal an error.
782 | set existing [glob -nocomplain -directory $dest * .*]
783 | lappend existing {*}[glob -nocomplain -directory $dest \
784 | -type hidden * .*]
785 | foreach s $existing {
786 | if {[file tail $s] ni {. ..}} {
787 | return -code error "error $action \"$src\" to\
788 | \"$dest\": file already exists"
789 | }
790 | }
791 | }
792 | } else {
793 | if {[string first $nsrc $ndest] != -1} {
794 | set srclen [expr {[llength [file split $nsrc]] - 1}]
795 | set ndest [lindex [file split $ndest] $srclen]
796 | if {$ndest eq [file tail $nsrc]} {
797 | return -code error "error $action \"$src\" to\
798 | \"$dest\": trying to rename a volume or move a directory\
799 | into itself"
800 | }
801 | }
802 | file mkdir $dest
803 | }
804 | # Have to be careful to capture both visible and hidden files.
805 | # We will also be more generous to the file system and not
806 | # assume the hidden and non-hidden lists are non-overlapping.
807 | #
808 | # On Unix 'hidden' files begin with '.'. On other platforms
809 | # or filesystems hidden files may have other interpretations.
810 | set filelist [concat [glob -nocomplain -directory $src *] \
811 | [glob -nocomplain -directory $src -types hidden *]]
812 |
813 | foreach s [lsort -unique $filelist] {
814 | if {[file tail $s] ni {. ..}} {
815 | file copy -force -- $s [file join $dest [file tail $s]]
816 | }
817 | }
818 | return
819 | }
820 |
--------------------------------------------------------------------------------
/venv/Scripts/Activate.ps1:
--------------------------------------------------------------------------------
1 | function global:deactivate ([switch]$NonDestructive) {
2 | # Revert to original values
3 | if (Test-Path function:_OLD_VIRTUAL_PROMPT) {
4 | copy-item function:_OLD_VIRTUAL_PROMPT function:prompt
5 | remove-item function:_OLD_VIRTUAL_PROMPT
6 | }
7 |
8 | if (Test-Path env:_OLD_VIRTUAL_PYTHONHOME) {
9 | copy-item env:_OLD_VIRTUAL_PYTHONHOME env:PYTHONHOME
10 | remove-item env:_OLD_VIRTUAL_PYTHONHOME
11 | }
12 |
13 | if (Test-Path env:_OLD_VIRTUAL_PATH) {
14 | copy-item env:_OLD_VIRTUAL_PATH env:PATH
15 | remove-item env:_OLD_VIRTUAL_PATH
16 | }
17 |
18 | if (Test-Path env:VIRTUAL_ENV) {
19 | remove-item env:VIRTUAL_ENV
20 | }
21 |
22 | if (!$NonDestructive) {
23 | # Self destruct!
24 | remove-item function:deactivate
25 | }
26 | }
27 |
28 | deactivate -nondestructive
29 |
30 | $env:VIRTUAL_ENV="G:\OCR\venv"
31 |
32 | if (! $env:VIRTUAL_ENV_DISABLE_PROMPT) {
33 | # Set the prompt to include the env name
34 | # Make sure _OLD_VIRTUAL_PROMPT is global
35 | function global:_OLD_VIRTUAL_PROMPT {""}
36 | copy-item function:prompt function:_OLD_VIRTUAL_PROMPT
37 | function global:prompt {
38 | Write-Host -NoNewline -ForegroundColor Green '(venv) '
39 | _OLD_VIRTUAL_PROMPT
40 | }
41 | }
42 |
43 | # Clear PYTHONHOME
44 | if (Test-Path env:PYTHONHOME) {
45 | copy-item env:PYTHONHOME env:_OLD_VIRTUAL_PYTHONHOME
46 | remove-item env:PYTHONHOME
47 | }
48 |
49 | # Add the venv to the PATH
50 | copy-item env:PATH env:_OLD_VIRTUAL_PATH
51 | $env:PATH = "$env:VIRTUAL_ENV\Scripts;$env:PATH"
52 |
--------------------------------------------------------------------------------
/venv/Scripts/_asyncio.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_asyncio.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_bz2.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_bz2.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_ctypes.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_ctypes.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_ctypes_test.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_ctypes_test.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_decimal.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_decimal.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_elementtree.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_elementtree.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_hashlib.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_hashlib.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_lzma.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_lzma.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_msi.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_msi.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_multiprocessing.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_multiprocessing.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_overlapped.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_overlapped.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_socket.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_socket.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_sqlite3.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_sqlite3.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_ssl.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_ssl.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_testbuffer.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_testbuffer.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_testcapi.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_testcapi.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_testconsole.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_testconsole.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_testimportmultiple.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_testimportmultiple.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_testmultiphase.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_testmultiphase.pyd
--------------------------------------------------------------------------------
/venv/Scripts/_tkinter.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/_tkinter.pyd
--------------------------------------------------------------------------------
/venv/Scripts/activate:
--------------------------------------------------------------------------------
1 | # This file must be used with "source bin/activate" *from bash*
2 | # you cannot run it directly
3 |
4 | deactivate () {
5 | # reset old environment variables
6 | if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
7 | PATH="${_OLD_VIRTUAL_PATH:-}"
8 | export PATH
9 | unset _OLD_VIRTUAL_PATH
10 | fi
11 | if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
12 | PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
13 | export PYTHONHOME
14 | unset _OLD_VIRTUAL_PYTHONHOME
15 | fi
16 |
17 | # This should detect bash and zsh, which have a hash command that must
18 | # be called to get it to forget past commands. Without forgetting
19 | # past commands the $PATH changes we made may not be respected
20 | if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
21 | hash -r
22 | fi
23 |
24 | if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
25 | PS1="${_OLD_VIRTUAL_PS1:-}"
26 | export PS1
27 | unset _OLD_VIRTUAL_PS1
28 | fi
29 |
30 | unset VIRTUAL_ENV
31 | if [ ! "$1" = "nondestructive" ] ; then
32 | # Self destruct!
33 | unset -f deactivate
34 | fi
35 | }
36 |
37 | # unset irrelevant variables
38 | deactivate nondestructive
39 |
40 | VIRTUAL_ENV="G:\OCR\venv"
41 | export VIRTUAL_ENV
42 |
43 | _OLD_VIRTUAL_PATH="$PATH"
44 | PATH="$VIRTUAL_ENV/Scripts:$PATH"
45 | export PATH
46 |
47 | # unset PYTHONHOME if set
48 | # this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
49 | # could use `if (set -u; : $PYTHONHOME) ;` in bash
50 | if [ -n "${PYTHONHOME:-}" ] ; then
51 | _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
52 | unset PYTHONHOME
53 | fi
54 |
55 | if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
56 | _OLD_VIRTUAL_PS1="${PS1:-}"
57 | if [ "x(venv) " != x ] ; then
58 | PS1="(venv) ${PS1:-}"
59 | else
60 | if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
61 | # special case for Aspen magic directories
62 | # see http://www.zetadev.com/software/aspen/
63 | PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
64 | else
65 | PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
66 | fi
67 | fi
68 | export PS1
69 | fi
70 |
71 | # This should detect bash and zsh, which have a hash command that must
72 | # be called to get it to forget past commands. Without forgetting
73 | # past commands the $PATH changes we made may not be respected
74 | if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
75 | hash -r
76 | fi
77 |
--------------------------------------------------------------------------------
/venv/Scripts/activate.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | set "VIRTUAL_ENV=G:\OCR\venv"
3 |
4 | if not defined PROMPT (
5 | set "PROMPT=$P$G"
6 | )
7 |
8 | if defined _OLD_VIRTUAL_PROMPT (
9 | set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
10 | )
11 |
12 | if defined _OLD_VIRTUAL_PYTHONHOME (
13 | set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
14 | )
15 |
16 | set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
17 | set "PROMPT=(venv) %PROMPT%"
18 |
19 | if defined PYTHONHOME (
20 | set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"
21 | set PYTHONHOME=
22 | )
23 |
24 | if defined _OLD_VIRTUAL_PATH (
25 | set "PATH=%_OLD_VIRTUAL_PATH%"
26 | ) else (
27 | set "_OLD_VIRTUAL_PATH=%PATH%"
28 | )
29 |
30 | set "PATH=%VIRTUAL_ENV%\Scripts;%PATH%"
31 |
32 | :END
33 |
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-console-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-console-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-datetime-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-datetime-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-debug-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-debug-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-errorhandling-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-errorhandling-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-file-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-file-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-file-l1-2-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-file-l1-2-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-file-l2-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-file-l2-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-handle-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-handle-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-heap-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-heap-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-interlocked-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-interlocked-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-libraryloader-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-libraryloader-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-localization-l1-2-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-localization-l1-2-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-memory-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-memory-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-namedpipe-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-namedpipe-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-processenvironment-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-processenvironment-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-processthreads-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-processthreads-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-processthreads-l1-1-1.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-processthreads-l1-1-1.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-profile-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-profile-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-rtlsupport-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-rtlsupport-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-string-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-string-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-synch-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-synch-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-synch-l1-2-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-synch-l1-2-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-sysinfo-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-sysinfo-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-timezone-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-timezone-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-core-util-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-core-util-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-conio-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-conio-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-convert-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-convert-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-environment-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-environment-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-filesystem-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-filesystem-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-heap-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-heap-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-locale-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-locale-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-math-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-math-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-multibyte-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-multibyte-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-private-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-private-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-process-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-process-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-runtime-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-runtime-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-stdio-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-stdio-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-string-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-string-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-time-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-time-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/api-ms-win-crt-utility-l1-1-0.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/api-ms-win-crt-utility-l1-1-0.dll
--------------------------------------------------------------------------------
/venv/Scripts/concrt140.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/concrt140.dll
--------------------------------------------------------------------------------
/venv/Scripts/deactivate.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | if defined _OLD_VIRTUAL_PROMPT (
4 | set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
5 | )
6 | set _OLD_VIRTUAL_PROMPT=
7 |
8 | if defined _OLD_VIRTUAL_PYTHONHOME (
9 | set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
10 | set _OLD_VIRTUAL_PYTHONHOME=
11 | )
12 |
13 | if defined _OLD_VIRTUAL_PATH (
14 | set "PATH=%_OLD_VIRTUAL_PATH%"
15 | )
16 |
17 | set _OLD_VIRTUAL_PATH=
18 |
19 | set VIRTUAL_ENV=
20 |
21 | :END
22 |
--------------------------------------------------------------------------------
/venv/Scripts/msvcp140.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/msvcp140.dll
--------------------------------------------------------------------------------
/venv/Scripts/pyexpat.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/pyexpat.pyd
--------------------------------------------------------------------------------
/venv/Scripts/python.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/python.exe
--------------------------------------------------------------------------------
/venv/Scripts/python3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/python3.dll
--------------------------------------------------------------------------------
/venv/Scripts/python3.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/python3.exe
--------------------------------------------------------------------------------
/venv/Scripts/python36.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/python36.dll
--------------------------------------------------------------------------------
/venv/Scripts/python_conda.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/python_conda.exe
--------------------------------------------------------------------------------
/venv/Scripts/pythonw.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/pythonw.exe
--------------------------------------------------------------------------------
/venv/Scripts/select.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/select.pyd
--------------------------------------------------------------------------------
/venv/Scripts/sqlite3.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/sqlite3.dll
--------------------------------------------------------------------------------
/venv/Scripts/tcl86t.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/tcl86t.dll
--------------------------------------------------------------------------------
/venv/Scripts/tk86t.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/tk86t.dll
--------------------------------------------------------------------------------
/venv/Scripts/ucrtbase.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/ucrtbase.dll
--------------------------------------------------------------------------------
/venv/Scripts/unicodedata.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/unicodedata.pyd
--------------------------------------------------------------------------------
/venv/Scripts/vccorlib140.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/vccorlib140.dll
--------------------------------------------------------------------------------
/venv/Scripts/vcomp140.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/vcomp140.dll
--------------------------------------------------------------------------------
/venv/Scripts/vcruntime140.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/vcruntime140.dll
--------------------------------------------------------------------------------
/venv/Scripts/winsound.pyd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/winsound.pyd
--------------------------------------------------------------------------------
/venv/Scripts/xlwings32-0.11.5.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/xlwings32-0.11.5.dll
--------------------------------------------------------------------------------
/venv/Scripts/xlwings64-0.11.5.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shanghaixuhuan/myOCR/215366b63314bafe37698d1e56c5a1f9323f1a06/venv/Scripts/xlwings64-0.11.5.dll
--------------------------------------------------------------------------------
/venv/pyvenv.cfg:
--------------------------------------------------------------------------------
1 | home = G:\Anaconda3
2 | include-system-site-packages = true
3 | version = 3.6.4
4 |
--------------------------------------------------------------------------------