This is a simple machine learning prediction API built using Python, Flask, and a trained ML model.
It allows you to send data through Postman and receive prediction results instantly.
- Simple and lightweight Flask API
- Accepts image input through Postman
- Returns model prediction in real time.
- Includes example request + response
- Easy to deploy and extend
/project
│── models
| |── Cats_Dogs_IMG_Classification_2.ipynb
| |── final_model.keras
│── main.py
│── requirements.txt
│── README.md
│── License
- Python – Core development
- Flask – Web application framework
- Tensorflow, NumPy – Data processing & ML model training
- Matplotlib – Interactive plots
- Keras – Model & metadata storage
-
Clone the repository:
git clone https://github.com/YourUsername/CNN-Image-Classification-System.git cd CNN-Image-Classification-System -
Create virtual environment (optional but recommended):
python -m venv venv venv\Scripts\activate # For Windows # OR source venv/bin/activate # For macOS/Linux
-
Install dependencies:
pip install -r requirements.txt
-
Run the Flask server:
python main.py
Server will start at:
👉 http://127.0.0.1:5000
- Download from:
https://www.postman.com/downloads/ - Open the Postman app
- Click New → HTTP Request
- Select POST
- Enter your API URL:
http://127.0.0.1:5000/predict
-
In Postman: Body → form-data
-
Add the following key–value pair:
KEY TYPE VALUE file File (choose an image file) - Key must be exactly: file
- Type must be: File
- Allowed formats: .jpg, .jpeg, .png
Click Send and you’ll receive a prediction similar to:
{
"prediction": "dog",
"confidence": 0.9123
}
or
{
"prediction": "cat",
"confidence": 0.7344
}
See requirements.txt for exact package versions.
Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to improve.
This project is licensed under the MIT License – see the LICENSE file for details.