Coder Social home page Coder Social logo

tensorflow-gun-detection's Introduction

tensorflow-gun-detection

Scores

Model Mobile SSD Faster RCNN
Test Loss 1.5 0.1016
Trained Rounds 5114 7167

Instructions

  • Uncompress the train & test images

    • Images inside images are compressed into train.tar.gz and test.tar.gz folders.
    • Navigate to images folder and type "bash uncompress.sh" in your terminal.
  • Create csv records for the xml files

    • Navigate to images and run xml_to_csv.py file
  • Create tfrecords

    • Navigate to images and see the generate_tfrecords.py script for instructions.
  • Once you generate xml files and tfrecords, the files should be available under images/data

  • Create a folder called training in the root folder.

  • If you want to do transfer learning pull the model & config files from tensorflow zoo and put the in the root folder.

  • Move the config file to training/ folder and change the config file to match the paths.

  • To train the model:

    • python train.py --logstderr --train_dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_pets.config
  • Export inference graphs

  • Paste the graph folders to outputs/ folder

  • Count the no.of bounding boxes

    • python image_detection.py

utils/image_resizer.py

  • usage
    • python image_resizer.py -input=input_folder_images -output=output_folder -height=800 -width=600

Notes:

  • To compress the images which are inside train & test folders inside data/images/processed

    • tar -cvzf train.tar.gz train
    • tar -cvzf test.tar.gz test
  • Rectlabel App in Mac / LabelImg open source:

    • The bounding boxes around the images were created using Rectlabel tool available for MAC.
    • We can also use Labelimg open source tool for this task.

References:

  • Modified version of xml_to_csv.py from racoon github repo.
  • generate_tfrecord.py from racoon github repo.

tensorflow-gun-detection's People

Contributors

datasciencenow avatar mdinesh9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tensorflow-gun-detection's Issues

Images dataset

Could you please share the link to training images for the dataset?

Wrong detection

Hey there,
After the training (around 3k steps) it detects almost everything as a gun.
Example photos:

Cat
AK47

Total loss chart:

Should I train it more or I've done some mistakes in configuration?

Dependency problem

Running "generate_tfrecord.py" :

Traceback (most recent call last):
  File "images/generate_tfrecord.py", line 20, in <module>
    from object_detection.utils import dataset_util
ImportError: No module named object_detection.utils

Where is the object_detection file ?
Thanks.

No train.py in project

python train.py --logstderr --train_dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_pets.config

But there is no train.py in this project.

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.