Giter VIP home page Giter VIP logo

recognizer's Introduction

Image&Video Weapon Recognizer by Yolov5

First, you can run my example code, and then train your own model and use it in the program.

Weapon Recognizer

Program consist of yolov5 model, user interface form on Qt and recognize script.

To run Recognizer clone repo:

git clone https://github.com/andrey-kireev-1/Recognizer.git

Install python requirements:

pip install -r requirements.txt

Open and run app.py. Here you can select recognition accuracy and files (images: .jpg, .png; videos: .avi, .mp4).

menu

After selecting a file, object recognition will start. 4 categories of weapons can be recognized: pistol, machine gun, knife, hand grenade. For example, the input and output image could be like this:

example

And video:

image

Download different photos and videos with weapons and try to recognize them. Enjoy :)

How to create your own model to recognize:

Collect a set of images with your object. Label your images (for example, with: Make Sense).

Divide the collected and labeled set of images into 3 folders: train, valid, test. (Further, I recommend using Google Colab, but you can also work locally.) Create a folder in Google Drive, put the folders train, valid, test and dataset.yaml file there (replace the folder paths according to your Google Drive).

Next: Upload on Google Drive train_model.ipynb, open it in Google Colab, change folders paths and run this file. The model will start training.

train

After completing the training of the model, download the file best.pt from the path /content/yolov5/runs/train/exp/weights/best.pt. Close Google Colab. Place your best.pt file into your cloning repo local folder. Now your program will recognize your own object.


Kireev 2022

recognizer's People

Contributors

andrey-kireev-1 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.