This is a Streamlit app that allows users to upload an image and see the prediction of the image's class. The app is built using the following libraries:
- numpy
- matplotlib
- streamlit
- tensorflow
- PIL
The main function of the app is main()
. This function first creates a title and a description for the app. It then creates a file uploader widget and displays the image that the user uploads. The function then resizes the image to 32x32 pixels and converts it to a NumPy array. The array is then reshaped to 1x32x32x3, which is the format that the Cifar10 model expects.
The function then loads the Cifar10 model and makes a prediction for the image. The prediction is a list of probabilities, one for each class in the Cifar10 dataset. The function then creates a bar chart to visualize the predictions. The bar chart shows the probability of each class, with the highest probability on top.
The function finally displays the bar chart to the user.
Here are the steps on how to use the app:
- Open the app in a web browser.
- Click the "Upload an image" button and select an image from your computer.
- The image will be displayed in the app.
- The app will make a prediction for the image and display a bar chart of the predictions.
I hope you find this app helpful!