An AI-powered image classifier that identifies landscape categories from uploaded photos. Classifies images into: Buildings, Forests, Mountains, Glacier, Street, Sea.
- Backend: Flask API (
app.py) loads a pre-trained Keras model (model.h5) and exposes a/predictendpoint - Frontend: Static HTML/CSS/JS (
web/) that sends images to the backend and displays the top 3 predictions with confidence scores
- Python 3.11 (TensorFlow does not support Python 3.12+ yet)
model.h5is included in the repository
git clone https://github.com/kenzitjandra/LandscapeClassifier.git
cd LandscapeClassifierpy -3.11 -m venv venvWindows:
venv\Scripts\activateMac/Linux:
source venv/bin/activatepip install -r requirements.txtpython app.pyThen open http://localhost:5000 in your browser. Upload an image and click Classify Image.
LandscapeClassifier/
├── app.py # Flask backend + prediction logic
├── model.h5 # Trained Keras model (not in repo)
└── web/
├── index.html # Frontend UI
└── style.css # Styles
POST /predict
Accepts a multipart form upload with a field named file.
{
"top_predictions": [
{ "label": "Forests", "confidence": 92.4 },
{ "label": "Mountains", "confidence": 5.1 },
{ "label": "Sea", "confidence": 1.3 }
]
}