This is a web application that uses a trained InceptionV3 model to classify leather quality. The model can classify leather images into 4 different categories.
- Modern, responsive web interface
- Drag and drop image upload
- Real-time image preview
- Classification results with confidence scores
- Support for common image formats (JPG, PNG)
- Python 3.7+
- TensorFlow 2.x
- Flask
- Other dependencies listed in requirements.txt
- Clone the repository:
git clone <repository-url>
cd leather-classifier- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Make sure you have the model file:
- The model file
inceptionNetV3_100eVAL_16b_v2_model.h5should be in the root directory - This file contains the trained InceptionV3 model for leather classification
- Start the Flask server:
python app.py- Open a web browser and navigate to:
http://localhost:5000
For a minimal prediction service (no UI/login) use simple_api.py:
- Install requirements (FastAPI/uvicorn already listed):
pip install -r requirements.txt
- Ensure the Inception
.h5model is available and set the path (defaults toinception.h5in repo root):set MODEL_INCEPTION_PATH=inception.h5 # Windows PowerShell export MODEL_INCEPTION_PATH=inception.h5 # Unix shells
- Start the API with uvicorn:
uvicorn simple_api:app --host 0.0.0.0 --port 8000
- Send predictions via HTTP:
curl -X POST "http://localhost:8000/predict" \ -H "Content-Type: multipart/form-data" \ -F "file=@path/to/leather.jpg"
This spins up a CORS-enabled FastAPI server that loads the model once and returns JSON predictions.
The original Flask UI, templates, static assets, and alternate FastAPI stack were moved into legacy/ for safekeeping:
legacy/flask_app/– originalapp.py, templates, and static fileslegacy/fullstack_api/– earlier FastAPI service with database helperslegacy/docs/– previous Elastic Beanstalk runbooklegacy/models/– unused/alternate.h5artifacts (e.g., AlexNet)
Only simple_api.py is required for the current proof-of-concept deployment.
- Click the upload area or drag and drop an image file
- Preview the image
- Click "Classify Leather" to get the prediction
- View the classification result and confidence score
- Base Model: InceptionV3
- Input Size: 224x224 pixels
- Classes: 4 leather quality categories
- Training Accuracy: >97%
- Validation Accuracy: >97%
- Frontend: HTML5, CSS3, JavaScript
- Backend: Flask (Python)
- Deep Learning: TensorFlow/Keras
- UI Framework: Bootstrap 5
[Your License Information]