def OnSelectModel(self, evt): dlg = wx.FileDialog(self, "Selectionnez le modele", os.path.join(os.getcwd(),MODEL_FOLDER), DEFAULT_MODEL_FILE, wildcard = "Model files (*.svm)|*.svm", style = wx.OPEN) retour = dlg.ShowModal() self.chemin = dlg.GetPath().encode("latin-1") fichier = dlg.GetFilename().encode("latin-1") dlg.Destroy() if retour == wx.ID_OK and fichier != "": self.model = Break_Egoshare_Captcha.load_model(self.chemin, self, fichier) self.Update() if self.captcha_selected and self.model_selected: #Lancement du calcul self.OnLaunch(None)
def OnSelectModel(self, evt): dlg = wx.FileDialog(self, "Selectionnez le modele", os.path.join(os.getcwd(), MODEL_FOLDER), DEFAULT_MODEL_FILE, wildcard="Model files (*.svm)|*.svm", style=wx.OPEN) retour = dlg.ShowModal() self.chemin = dlg.GetPath().encode("latin-1") fichier = dlg.GetFilename().encode("latin-1") dlg.Destroy() if retour == wx.ID_OK and fichier != "": self.model = Break_Egoshare_Captcha.load_model( self.chemin, self, fichier) self.Update() if self.captcha_selected and self.model_selected: #Lancement du calcul self.OnLaunch(None)
def OnSelectCaptcha(self, evt): dlg = wx.FileDialog(self, "Selectionnez l'image", os.path.join(os.getcwd(), CAPTCHA_FOLDER), DEFAULT_CAPTCHA_FILE, wildcard="Image files (*.jpg;)|*.jpg", style=wx.OPEN) retour = dlg.ShowModal() self.chemin = dlg.GetPath().encode("latin-1") self.folder = dlg.GetDirectory().encode("latin-1") fichier = dlg.GetFilename() dlg.Destroy() if retour == wx.ID_OK and fichier != "": self.beau_captcha, self.letter1, self.letter2, self.letter3, self.letter1_algo, self.letter2_algo, self.letter3_algo = Break_Egoshare_Captcha.preprocess_captcha_part( self.chemin, self.folder, self) self.setCaptchaImage(self.beau_captcha) self.setThumbs(self.letter1, self.letter2, self.letter3) self.captcha_selected = True self.setResults("", "", "", "", "", "") self.Update() if self.captcha_selected and self.model_selected: #Lancement du calcul self.OnLaunch(None)
def OnSelectCaptcha(self, evt): dlg = wx.FileDialog(self, "Selectionnez l'image", os.path.join(os.getcwd(), CAPTCHA_FOLDER), DEFAULT_CAPTCHA_FILE, wildcard = "Image files (*.jpg;)|*.jpg", style = wx.OPEN) retour = dlg.ShowModal() self.chemin = dlg.GetPath().encode("latin-1") self.folder = dlg.GetDirectory().encode("latin-1") fichier = dlg.GetFilename() dlg.Destroy() if retour == wx.ID_OK and fichier != "": self.beau_captcha, self.letter1, self.letter2, self.letter3, self.letter1_algo, self.letter2_algo, self.letter3_algo = Break_Egoshare_Captcha.preprocess_captcha_part(self.chemin, self.folder, self) self.setCaptchaImage(self.beau_captcha) self.setThumbs(self.letter1, self.letter2, self.letter3) self.captcha_selected = True self.setResults("", "", "", "", "", "") self.Update() if self.captcha_selected and self.model_selected: #Lancement du calcul self.OnLaunch(None)