def StartWaifu2x(self): if not QtImgMgr().data: return self.comboBox.setEnabled(False) self.changeButton.setEnabled(False) self.index = self.comboBox.currentIndex() index = self.comboBox.currentIndex() model = ToolUtil.GetModelByIndex(index) QtTask().AddConvertTask("", QtImgMgr().data, model, self.AddConvertBack, cleanFlag="QtImg") self.changeButton.setText("正在转换") return
def SwitchModel(self, index): data = self.readImg.pictureData.get(self.readImg.curIndex) if not data: return if not data.model: return if not data.data: return index2, _, _ = ToolUtil.GetModelAndScale(data.model) if index2 == index: return data.model = ToolUtil.GetModelByIndex(index) data.waifuData = None data.waifuState = data.WaifuStateStart data.waifuDataSize = 0 data.scaleW, data.scaleH = 0, 0 data.waifuTick = 0 self.label_2.setText("去噪等级:" + str(1)) self.label_3.setText("放大倍数:" + str(1)) self.SetData(waifuSize=QSize(), waifuDataLen=0, waifuTick=0) self.readImg.ShowImg() self.readImg.CheckLoadPicture() return