Giter Site home page Giter Site logo

image-classification's Introduction

Image-Classification

This repository contains a simple Flask web application for image classification using a pre-trained neural network model. Users can upload an image through the web interface, and the application will predict whether the image contains a cat or a dog. Additionally, the prediction results are stored in a MySQL database along with the uploaded image.

Prerequisites: Before running the application, ensure you have the following prerequisites installed:

Python Flask TensorFlow NumPy MySQL Connector Other dependencies as listed in the README file

You can install the dependencies using the following command:

bash Copy code pip install -r requirements.txt Setup MySQL Database Setup:

Make sure you have MySQL installed and running on your system:

Create a database named predicted_logs. Update the database connection details in the app.py file (host, user, password). Model File:

Ensure that you have a trained model file (cat_dog_classifier.h5) available. You can use your own pre-trained model or train one using relevant data. Run the Application:

Execute the app.py script to start the Flask application:

bash Copy code python app.py The application will be accessible at http://127.0.0.1:5000/ in your web browser.

Usage:

Access the web interface at http://127.0.0.1:5000/. Upload an image using the provided form. Click the "Predict" button to submit the image for classification. The result will be displayed on the web page along with the uploaded image.

Project Structure:

app.py: The main Flask application script containing the web application logic. uploads: A folder where uploaded images are temporarily stored. cat_dog_classifier.h5: Pre-trained neural network model for cat and dog classification. templates: Folder containing HTML templates for rendering the web interface. Database Schema

The MySQL database (predicted_logs) has a table named prediction_data with the following columns:

id: Auto-incremented primary key. image: Binary data of the uploaded image. predicted_result: The predicted result (e.g., "It's a cat"). prediction_time: Timestamp indicating when the prediction was made.

License:

This project is licensed under the MIT License.

image-classification's People

Contributors

abishekra avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.