GithubHelp home page GithubHelp logo

transferlearningforobjectdetection's Introduction

Transfer Learning for Object Detection Task, using InceptionV3 and YOLO in tensorflow

The goal is to predict all the bounding boxes that containing an object and the category of the object for each bounding box.

We used InceptionV3 as the base feature extractor and trained a new classifier, we implemented the loss function proposed in YOLO's paper as the loss function.

Clone The Git

mkdir project_dir && cd project_dir

git clone https://github.com/tonyzhang1231/TransferLearningForObjectDetection

Get The Pascal VOC Data

mkdir image_dir && cd image_dir

wget https://pjreddie.com/media/files/VOCtrainval_11-May-2012.tar

wget https://pjreddie.com/media/files/VOCtrainval_06-Nov-2007.tar

wget https://pjreddie.com/media/files/VOCtest_06-Nov-2007.tar

tar xf VOCtrainval_11-May-2012.tar

tar xf VOCtrainval_06-Nov-2007.tar

tar xf VOCtest_06-Nov-2007.tar

Generate Labels for VOC

We need to generate the label files that our model uses. we need a .txt file for each image with a line for each ground truth object in the image that looks like:

<object-class> <x> <y> <width> <height>

x, y are the coordinate of the bounding box. all x, y, w, h are between 0 and 1, relative to the size of the image.

Copy the voc_label.py to image_dir and run this file

cp project_dir/voc_label.py image_dir/

cd image_dir && python voc_label.py

In the image_dir, run the following command to get the train, val and test data

cat 2007_train.txt 2012_*.txt > train.txt

cat 2007_val.txt > validation.txt

cat 2007_test.txt > test.txt

Change the settings in the run_retrain_InceptionV3_YOLO.sh file

Change the IMAGE_DIR and result_store_dir and anything else if you want

Retrain the model

sh run_retrain_InceptionV3_YOLO.sh

Requirements

  • tensorflow-gpu==1.4.1
  • python 2.7.12

highly recommend to use python environment

reference

transferlearningforobjectdetection's People

Contributors

tonyzhang1231 avatar

Watchers

 avatar  avatar

transferlearningforobjectdetection's Issues

How to use the new model?

Hi, thanks for your sharing.
I've retrained the model by following your instructions, but how to use this new model to do OBJECT DETECTION jobs? Could you please show me some examples?
Thanks.

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.