Giter VIP home page Giter VIP logo

inception_v3's Introduction

Inception_V3

A training, validation, and predict demo by using inception v3.

Usage

Install Bazel 0.4.3 or higer version.

Install Tensorflow 0.12

$ source init.sh

Build training data.

Create a tar.gz file with structure below:

$ less sample.tar.gz
     rw-r--r-- worker/worker 823 2017-01-21 fish2.0/A1/953275.jpg
     rw-r--r-- worker/worker 823 2017-01-21  fish2.0/A2/1067563.jpg
     rw-r--r-- worker/worker 823 2017-01-21  fish2.0/A3/2353330.jpg
     rw-r--r-- worker/worker 823 2017-01-21  fish2.0/A4/1664412.jpg
     rw-r--r-- worker/worker 823 2017-01-21  fish2.0/A5/1264412.jpg
$ # Generate training dataset
$ sh preprocess.sh
$ ls 
 .
├── labels.txt
├── train
│   ├── negative
│   └── positive
└── validation
    ├── negative
    └── positive

$  sh build_data.sh

Train the data

To make sure that you have pre-trained Inception V3 model like model.ckpt-157585.

$ sh train.sh

Now you will get Checkpoint file

-rw-r--r-- 1 worker w  72K 01-23 12:51 model.ckpt-2000.index
-rw-r--r-- 1 worker w  519 01-23 12:51 checkpoint
-rw-r--r-- 1 worker w  13M 01-23 12:52 model.ckpt-2000.meta

You can run eval.sh to see the validation result.

$ sh eval.sh
2017-01-23 18:11:13.276846: starting evaluation on (train).
2017-01-23 18:11:35.051256: precision @ 1 = 1.0000 recall @ 5 = 1.0000 [224 examples]

Prepare to predict new data via Inception V3

$ sh build_test_data.sh

You will see

$ ls
test-00000-of-00001

Get the prediction.

$ sh predict.sh 10
2017-01-23 18:16:54.551870: starting evaluation on (test).
1167803.jpg 2
1343160.jpg 1
2369878.jpg 5
1343563.jpg 1
1210248.jpg 5
1220936.jpg 5
2241516.jpg 5
1440936.jpg 1
1265147.jpg 1
2305191.jpg 1

Modification

  1. Fixed the multi-thread problem during prediction (In a low efficiency way. LOL).
  2. Print the file name and corresponding prediction result.

inception_v3's People

Contributors

cyber-neuron 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.