Exemplo n.º 1
0
 def initComboBox(self):
     """训练模型下拉框初始化, 从设置中读取配置"""
     conf = util.getConfig(CONFIG_PATH)
     modelList = conf.options(CONF_MODEL_LIST_NAME)
     for m in modelList:
         curModelPath = conf.get(CONF_MODEL_LIST_NAME, m)
         self.comboBox.addItem(m)
Exemplo n.º 2
0
 def initData(self):
     """初始化列表中的数据"""
     self.modelListView.clear()
     self.conf = util.getConfig(CONFIG_PATH)
     modelList = self.conf.options(CONF_MODEL_LIST_NAME)
     for m in modelList:
         curModelPath = self.conf.get(CONF_MODEL_LIST_NAME, m)
         self.modelListView.addItem("{}: '{}'".format(m, curModelPath))
Exemplo n.º 3
0
 def accept(self):
     """确认"""
     modelName = self.modelNameInput.text()
     conf = util.getConfig(CONFIG_PATH)
     # print(modelName, self.modelPath)
     if modelName != None and self.modelPath != None:
         conf.set(CONF_MODEL_LIST_NAME, modelName, self.modelPath)
     with open(CONFIG_PATH, 'w') as f:
         conf.write(f)
     self.close()
Exemplo n.º 4
0
 def initData(self):
     """初始化数据"""
     self.conf = util.getConfig(CONFIG_PATH)
     self.picDefaultLoadDir = self.conf.get(DEFAULT_LOAD_DIR,
                                            "pic-default-load-dir")