This repository contains the code for an API server that performs image classification using a pre-trained Vegetable and Fruit Classifier model. The API server is built using Python and Flask framework.
- Clone the repository:
git clone <repository_url>
- Install the required dependencies:
pip install -r requirements.txt
- Download the pre-trained model weights and place them in the project directory.
- Start the API server:
python App.py
-
The server will start running on http://localhost:5000.
-
Make a POST request to http://localhost:5000/classify endpoint with an image file as the payload. The server will return the classification result in the response.
- POST /classify: Perform image classification on the provided image file.
a. Request Parameters:
image: The image file to be classified.
b. Response:
On success, the response will include the classification result in JSON format:
{
"classification": "apple"
}
On failure, the response will include an error message:
{
"error": "No image found"
}
-
You can modify the pre-processing steps in the classify function in app.py according to your requirements.
-
Update the class_labels list in app.py with the appropriate labels based on your classification classes.
Contributions are welcome! If you have any suggestions, improvements, or bug fixes, please open an issue or submit a pull request.
This project is licensed under the MIT License.
Feel free to customize and modify the README according to your specific needs, including adding more sections such as Dependencies, Testing, Deployment, etc.
Let me know if you need any further assistance!