개정판 a7d9a508
issue #000: chart -> graph
DTI_PID/DTI_PID/TrainingImageListDialog.py | ||
---|---|---|
7 | 7 |
from PyQt5.QtCore import * |
8 | 8 |
from PyQt5.QtGui import * |
9 | 9 |
from PyQt5.QtWidgets import * |
10 |
from PyQt5.QtChart import * |
|
10 |
#from PyQt5.QtChart import *
|
|
11 | 11 |
from AppDocData import AppDocData, Source |
12 | 12 |
import pytesseract |
13 | 13 |
import TrainingImageList_UI |
14 | 14 |
from TrainingEditorDialog import QTrainingEditorDialog |
15 | 15 |
import tesseract_ocr_module as TOCR |
16 |
import numpy as np |
|
17 |
import pyqtgraph as pg |
|
16 | 18 |
|
17 | 19 |
dataPath = os.path.join(os.getenv('ALLUSERSPROFILE'), 'Digital PID') |
18 | 20 |
tesseractPath = os.path.join(dataPath, 'Tesseract-OCR', 'tessdata') |
... | ... | |
512 | 514 |
@author euisung |
513 | 515 |
@date 2018.11.19 |
514 | 516 |
''' |
517 |
try: |
|
518 |
barList = [] |
|
519 |
categories = [] |
|
520 |
for char in self.charList: |
|
521 |
categories.append(char[0]) |
|
522 |
barList.append(char[1]) |
|
523 |
|
|
524 |
categoriesDict = [list(zip(range(len(categories)), categories))] |
|
525 |
|
|
526 |
plot = pg.plot(range(len(categories)), barList, title = 'Trained Characters', pen = 'r') |
|
527 |
xax = plot.getAxis('bottom') |
|
528 |
xax.setTicks(categoriesDict) |
|
529 |
plot.showGrid(x = True, y = True) |
|
530 |
|
|
531 |
if self.ui.splitter.replaceWidget(1, plot) is None: |
|
532 |
self.ui.splitter.addWidget(plot) |
|
533 |
self.ui.splitter.widget(1).resize(self.ui.splitter.widget(1).width(), 110) |
|
534 |
except Exception as ex: |
|
535 |
print('error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno)) |
|
536 |
from App import App |
|
537 |
from AppDocData import MessageType |
|
538 |
|
|
539 |
message = 'error occured({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename, sys.exc_info()[-1].tb_lineno) |
|
540 |
App.mainWnd().addMessage.emit(MessageType.Error, message) |
|
541 |
''' |
|
515 | 542 |
barList = [] |
516 | 543 |
categories = [] |
517 | 544 |
chart = QChart() |
... | ... | |
536 | 563 |
if self.ui.splitter.replaceWidget(1, chartView) is None: |
537 | 564 |
self.ui.splitter.addWidget(chartView) |
538 | 565 |
self.ui.splitter.widget(1).resize(self.ui.splitter.widget(1).width(), 110) |
566 |
''' |
|
539 | 567 |
|
540 | 568 |
''' |
541 | 569 |
@brief delete Mid Process File |
내보내기 Unified diff