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.

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.