A FastAI-based model to classify landscape photos into one of the four seasons of the year.
- Classify images into: spring, summer, autumn, winter
- Display predicted label and per-class probabilities
- Fully reproducible pipeline
You can install the required packages in two ways:
-
pip install -r requirements.txt
-
First cell of the notebook automatically installs the required libraries
After cloning the repository, open the notebook. It is recommended to run it from top to bottom.
Note: The notebook will generate the dataset and train the model, which may take some time.
Next, upload an image and provide its path to predict_season(learn, img_path), where:
learn: the trained FastAI Learner object (use thelearnvariable from the notebook)img_path: path to the image file you want to classify
The model will return the prediction in the following format:
Predicted season: spring
Probabilities:
- autumn: 0.0004
- spring: 0.9992
- summer: 0.0005
- winter: 0.0000
This project is based on the fast.ai Practical Deep Learning for Coders course's lesson notebook by Jeremy Howard: Is it a Bird? Creating a model from your own data.
Images were downloaded using DuckDuckGo search.