Giter Club home page Giter Club logo

tensorflow-api-object-detection's Introduction

Tensorflow-API-Object-Detection

Tensorflow API SSD MobileNet V2 Object Detection

1. Install Library

pip install -r requirement.txt
pip install -U cython
git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi/PythonAPI
make
pip install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"

2. Split Dataset to train, test

# usage: partition_dataset.py [-h] [-i IMAGEDIR] [-o OUTPUTDIR] [-r RATIO] [-x]
python ./scripts/partion_dataset.py -i ./scripts/Dataset/ -x -r 0.1

3. Create Label Map

item {
  id: 1
  name: 'id'
}

4. Create TensorFlow Records

First, run command line

protoc object_detection/protos/*.proto --python_out=.

Then, run above command to create tf train record and test record

# usage: create_tf_record.py [-h] [-x XML_DIR] [-l LABELS_PATH] [-o OUTPUT_PATH] [-i IMAGE_DIR] [-c CSV_PATH]

# create train record
python ./scripts/create_tf_record.py -x ./scripts/TrainValDataset/train/ -l ./scripts/label_map.pbxt -o ./scripts/TrainValDataset/train.record

# create test record
python ./scripts/create_tf_record.py -x ./scripts/TrainValDataset/test/ -l ./scripts/label_map.pbtxt -o ./scripts/TrainValDataset/test.record

5. Train

Run above command to train model

python ./object_detection/model_main_tf2.py --model_dir=./ssd_mobilenet_v2/ --pipeline_config_path=./ssd_mobilenet_v2/pipeline.config 

6. Export the trained model

 python ./object_detection/exporter_main_v2.py --input_type image_tensor --pipeline_config_path ./ssd_mobilenet_v2/pipeline.config --trained_checkpoint_dir ./ssd_mobilenet_v2/ckpt/ --output_directory ./ssd_mobilenet_v2/exported_model/

tensorflow-api-object-detection's People

Contributors

buiquangmanhhp1999 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

overleaff

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.