개정판 00cf5468
issue #000: AI test
Change-Id: I76f8c5d7431f2144b3ca03a52351bdfea071f7ce
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
1926 | 1926 |
bigs = [] |
1927 | 1927 |
|
1928 | 1928 |
symbol_list = app_doc_data.getTargetSymbolList(all=True) |
1929 |
#symbol_list = app_doc_data.getTargetSymbolList(all=False) |
|
1929 | 1930 |
for symbol in symbol_list: |
1930 |
if symbol.width and symbol.height: |
|
1931 |
if symbol.iType == 38 or symbol.iType == 33 or symbol.iType == 0 or symbol.iType == 40: |
|
1932 |
continue |
|
1933 |
elif symbol.width and symbol.height: |
|
1931 | 1934 |
if symbol.width > 300 or symbol.height > 300: |
1932 | 1935 |
bigs.append(symbol.getName()) |
1936 |
elif (symbol.width < 38 or symbol.height < 38) or (symbol.width > 450 or symbol.height > 450): |
|
1937 |
continue |
|
1933 | 1938 |
else: |
1934 | 1939 |
smalls.append(symbol.getName()) |
1935 | 1940 |
|
... | ... | |
2012 | 2017 |
for item in tile_symbols: |
2013 | 2018 |
rect = item.sceneBoundingRect() |
2014 | 2019 |
label, xMin, yMin, xMax, yMax = item.name, int(rect.x() - 5 - x), int(rect.y() - 5 - y), int(rect.x() + rect.width() + 5 - x), int(rect.y() + rect.height() + 5 - y) |
2020 |
label = 'small' if index == 0 else 'big' # for single class test |
|
2015 | 2021 |
xMin = xMin if xMin > 0 else 0 |
2016 | 2022 |
yMin = yMin if yMin > 0 else 0 |
2017 | 2023 |
xMax = xMax if xMax < size else size |
DTI_PID/DTI_PID/TrainingSymbolImageListDialog.py | ||
---|---|---|
102 | 102 |
bigs = [] |
103 | 103 |
#for label in self.labelList: |
104 | 104 |
# classes.append(label[0]) |
105 |
''' |
|
105 | 106 |
symbol_list = app_doc_data.getTargetSymbolList(all=True) |
106 | 107 |
for symbol in symbol_list: |
107 | 108 |
if symbol.width and symbol.height: |
108 | 109 |
classes.append(symbol.getName()) |
109 | 110 |
if symbol.width > 300 or symbol.height > 300: |
110 | 111 |
bigs.append(symbol.getName()) |
112 |
''' |
|
111 | 113 |
|
112 | 114 |
dlg = QTrainingAlgorithmDialog(self) |
113 | 115 |
if QDialog.Accepted == dlg.exec_(): |
114 |
QMessageBox.about(self, self.tr("Notice"), self.tr('Successfully requested. ')) |
|
116 |
#QMessageBox.about(self, self.tr("Notice"), self.tr('Successfully requested. '))
|
|
115 | 117 |
|
116 |
#app_web_service = AppWebService()
|
|
118 |
app_web_service = AppWebService() |
|
117 | 119 |
#res = app_web_service.request_execute_training(project.name, classes, bigs) |
120 |
res = app_web_service.request_execute_training(project.name, ['small'], ['big']) |
|
118 | 121 |
|
119 | 122 |
def upload_training_data(self): |
120 | 123 |
""" upload tile image and xml file to server """ |
DTI_PID/WebServer/app/__init__.py | ||
---|---|---|
4 | 4 |
from flask import Flask, render_template, Blueprint |
5 | 5 |
from flask_restx import Api, fields, marshal_with, Resource, reqparse |
6 | 6 |
from app.recognition.index import recognition_service |
7 |
# from app.training.index import training_service
|
|
7 |
from app.training.index import training_service |
|
8 | 8 |
from app.api.controllers.ProjectController import api as project_ns |
9 | 9 |
from app.api.controllers.ModelController import api as model_ns |
10 | 10 |
from app.api.controllers.license_controller import api as license_ns |
... | ... | |
34 | 34 |
# 위에서 추가한 파일을 연동해주는 역할 |
35 | 35 |
# app.register_blueprint(license_service) |
36 | 36 |
app.register_blueprint(recognition_service) |
37 |
# app.register_blueprint(training_service)
|
|
37 |
app.register_blueprint(training_service) |
|
38 | 38 |
app.register_blueprint(license_service) |
39 | 39 |
|
40 | 40 |
api = Api(app, |
DTI_PID/WebServer/run.py | ||
---|---|---|
1 | 1 |
from app import app |
2 | 2 |
|
3 | 3 |
if __name__ == '__main__': |
4 |
app.run(port=8080, debug=False, host='0.0.0.0')
|
|
4 |
app.run(port=8080, debug=True, host='0.0.0.0')
|
|
5 | 5 |
#app.run(debug=False) |
내보내기 Unified diff