GithubHelp home page GithubHelp logo

snixells / detection_util_scripts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from douglasrizzo/detection_util_scripts

0.0 0.0 0.0 48.04 MB

TF and YOLO utility scripts

License: MIT License

Python 100.00%

detection_util_scripts's Introduction

Object detection utility scripts

This repo contains a few Python scripts which may be useful for those trying to create the necessary prerequisite files to train an object detection model, either through the TensorFlow Object Detection API or by using YOLOv3.

Take a look inside the examples folder to have an idea of the types of files and contents that these scripts expect as input/generate as output.

Scripts

  • generate_csv.py reads the contents of image annotations stored in XML files, created with labelImg, and generates a single CSV file.
  • generate_pbtxt.py reads the previously generated CSV file (or any CSV file that has a column named "class") or a text file containing a single class name per line and no header, and generates a label map, one of the files needed to train a detection model using TensorFlow's Object Detection API.
  • generate_tfrecord.py reads the previously generated CSV and label map files, as well as all the images from a given directory, and generates a TFRecord file, which can then be used to train an object detection model with TensorFlow. The resulting TFRecord file is about the same size of all the original images that were included in it.
  • generate_yolo_txt.py reads the CSV file and generates one .txt file for each image mentioned in the CSV file, whith the same name of the image file. These .txt files contain the object annotations for that image, in a format which darknet uses to train its models.
  • generate_train_eval.py reads the CSV file and separates it into train and evaluation datasets, which are also CSV files. There are options to stratify by class and to select which fraction of the input CSV will be directed to the train dataset (the rest going to evaluation).

Usage

The scripts are to be called in a terminal. In order to know what arguments a particular script expects, run it with the -h flag to see a help message. For example: python generate_tfrecord.py -h

Copyright

Licenses are so complicated. This work began as a fork of Dat Tran's raccoon dataset repository, but then it became its own thing. Anyway, the license is unchanged and is in the repo.

detection_util_scripts's People

Contributors

ahtesham007 avatar datitran avatar douglasrizzo avatar experiencor avatar isaac25silva avatar victorddt 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.