Loading testModelInterface/AddImage.py +20 −3 Changes for testModelInterface/AddImage.py: 20 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ def process_image(): head="fpn", num_classes=21, ) model = model.load_from_checkpoint('../semantic_segmentation_model_new.pt') model = model.load_from_checkpoint('../' + model_choice.get()) trainer = flash.Trainer(max_epochs=3, gpus=0) # torch.cuda.device_count()) applyModel(model,trainer) Loading Loading @@ -98,8 +98,25 @@ root = tk.Tk() root.geometry("400x400") root.title("Depot d'image") # Récupérer le nom de tout les modèle présent listModel = [] for filename in os.listdir("../"): if filename.endswith(".pt"): listModel.append(filename) #Menu déroulant pour le choix du modèle model_choice = tk.StringVar(root) model_choice.set(listModel[0]) model_choice_menu = tk.OptionMenu(root, model_choice, *listModel) model_choice_menu.pack() #Ajouter de l'espace tk.Label(root, text="").pack() # Texte de bienvenue welcome_text = tk.Label(root, text="Bienvenue, veuillez déposer l'image") welcome_text = tk.Label(root, text="Bienvenue, veuillez déposer des images") #Rendre le texte plus gros welcome_text.config(font=("Courier", 13, "bold")) welcome_text.pack() # Affiche de l'image Loading @@ -111,7 +128,7 @@ btn_deposit = tk.Button(root, text="Déposer une image", command=deposit_image) btn_deposit.pack() # Bouton pour "process l'image" btn_process = tk.Button(root, text="Process l'image", command=process_image) btn_process = tk.Button(root, text="Process la/les image(s)", command=process_image) btn_process.pack() # Lancement de la boucle tkinter Loading Loading
testModelInterface/AddImage.py +20 −3 Changes for testModelInterface/AddImage.py: 20 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ def process_image(): head="fpn", num_classes=21, ) model = model.load_from_checkpoint('../semantic_segmentation_model_new.pt') model = model.load_from_checkpoint('../' + model_choice.get()) trainer = flash.Trainer(max_epochs=3, gpus=0) # torch.cuda.device_count()) applyModel(model,trainer) Loading Loading @@ -98,8 +98,25 @@ root = tk.Tk() root.geometry("400x400") root.title("Depot d'image") # Récupérer le nom de tout les modèle présent listModel = [] for filename in os.listdir("../"): if filename.endswith(".pt"): listModel.append(filename) #Menu déroulant pour le choix du modèle model_choice = tk.StringVar(root) model_choice.set(listModel[0]) model_choice_menu = tk.OptionMenu(root, model_choice, *listModel) model_choice_menu.pack() #Ajouter de l'espace tk.Label(root, text="").pack() # Texte de bienvenue welcome_text = tk.Label(root, text="Bienvenue, veuillez déposer l'image") welcome_text = tk.Label(root, text="Bienvenue, veuillez déposer des images") #Rendre le texte plus gros welcome_text.config(font=("Courier", 13, "bold")) welcome_text.pack() # Affiche de l'image Loading @@ -111,7 +128,7 @@ btn_deposit = tk.Button(root, text="Déposer une image", command=deposit_image) btn_deposit.pack() # Bouton pour "process l'image" btn_process = tk.Button(root, text="Process l'image", command=process_image) btn_process = tk.Button(root, text="Process la/les image(s)", command=process_image) btn_process.pack() # Lancement de la boucle tkinter Loading