Load pre-trained age and gender prediction models using OpenCV's deep neural network module.
Define mean values for preprocessing images and labels for age and gender prediction.
Open a file dialog to allow the user to select an image file.
Read the selected image using skimage.io.imread, call the detect_and_display function to perform face detection and display predictions.
Resize the image and detect faces using a Haar cascade classifier. For each detected face, extract the face, preprocess it, and use the age and gender models for predictions. Display the original image along with the detected faces, cropped faces, and age and gender predictions using matplotlib.
Create a Tkinter window with the title "Age and Gender Prediction" and a size of 400x200 pixels. Create a label widget displaying a message about uploading an image.
Create a button widget labeled "Upload Image" that triggers the upload_image function when clicked. Customize its appearance with background color, text color, and font.
Start the Tkinter event loop to run the GUI and wait for user interactions.