import tkinter as tk
from tkinter import filedialog
from PIL import ImageTk, Image
import os
import argparse
import numpy as np
db_path = "/fulldatabase/"
output = None
output_path = None
def test():
root = tk.Tk()
root.withdraw()
dirname = tk.filedialog.askdirectory(parent=root, initialdir="./", title='select input query folder')
root.destroy()
return (dirname)
if __name__ == "__main__":
in_dir = test()
path = os.listdir(in_dir)
parser = argparse.ArgumentParser()
parser.add_argument('--output', '-o')
args = parser.parse_args()
output_path = args.output
window = tk.Tk()
window.title("My App")
window.geometry("1024x800")
app = Application(window, in_dir, path)
window.mainloop()
output.close()
I have an input query folder with a set of different flower images say rose_3, lily_5, and jasmine_2 where the digit after underscore represents its instance number.
I want to select an image from the input folder and display it on a tkinter window.
I also want to display all other images of roses (which is read from the full database, i.e another folder) say rose_1, rose_2, rose_4, and rose_5 (if I have 5 images for roses in the database) on the same tkinter window on its right side one below the other at the same time.
All this is working perfectly fine with this code, but the GUI often freezes. Can anybody help me with this?