Coder Social home page Coder Social logo

knife_detector_webapp's Introduction

Knife Detection Web Application

This web application uses TensorFlow.js to detect whether an uploaded image contains a knife or not. It's a simple example of image classification using a pre-trained machine learning model.

Getting Started

Follow these steps to set up and run the Knife Detection Web Application locally:

Prerequisites

You will need:

  • Python (for server-side processing)
  • TensorFlow.js (for client-side machine learning)
  • Flask (for the web server)

Installation

Clone this repository to your local machine:

git clone https://github.com/your-username/knife-detection.git

Getting Started

  1. Navigate to the Project Directory:

    cd knife-detection

Usage

Convert Your Keras Model

In your Python environment, use the tensorflowjs_converter tool to convert your Keras model to TensorFlow.js format. Run the following command in your terminal/command prompt:

tensorflowjs_converter --input_format keras path/to/knife_detection_model.h5 path/to/converted_model

Replace path/to/knife_detection_model.h5 with the path to your saved Keras model, and path/to/converted_model with the desired output directory where the TensorFlow.js model will be saved.

Run the Web Application

Start the Flask web server by running:

python app.py

This will start the server, and you should see output indicating that the app is running locally.

Open a Web Browser Open a web browser and navigate to http://localhost. You should see the Knife Detection Web Application.

How to Use

Upload an Image:

Use the "Choose File" button to upload an image.

Detect Knife or Not:

Click the "Detect" button to classify the uploaded image as "Knife" or "Not Knife."

View Result:

The result will be displayed on the web page.

knife_detector_webapp's People

Contributors

anshi02 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.