def getAccuracy(top, accuracy): classifier = Retina_cnn.retrieveModel() paccuracy = Retina_cnn.getAccuracy(classifier) accuracy.set(paccuracy * 100) accuracyLabel = tk.Label(top, textvariable=accuracy, height=2, width=20, fg='blue', bg='orange').place(relx=0.423, rely=0.12)
def predictImg(top, image_name, predicted_output): classifier = Retina_cnn.retrieveModel() predicted_output.set(Retina_cnn.predictSingle(classifier, image_name.get())) tk.Label(top, textvariable=predicted_output, height=2, width=20, fg='blue', bg='red').place(relx=0.423, rely=0.8)
def predictRetinaImg(top, image_name, predicted_output, retina_presence_str): classifier = Retina_cnn.retrieveModel() if (Retina_cnn.predictSingle(classifier, image_name.get())): predictImg(top, image_name, predicted_output) retina_presence_str.set("Retina Present") tk.Label(top, textvariable=retina_presence_str, height=2, width=20).place(relx=0.5, rely=0.2) else: retina_presence_str.set("Retina not Present") tk.Label(top, textvariable=retina_presence_str, height=2, width=20).place(relx=0.5, rely=0.2)
def plotGraph(top): history = Retina_cnn.loadHistory() acc = history['accuracy'] # print(acc) val_acc = history['val_accuracy'] loss = history['loss'] val_loss = history['val_loss'] Gui_graphplot.createWindowforGraph(top, acc, val_acc, loss, val_loss)
def generateModel(top): Retina_cnn.savingModel()