Coder Social home page Coder Social logo

bowen-jiang / women-techmakers-intern-meeetup Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lakshya90/women-techmakers-intern-meeetup

0.0 1.0 0.0 68 KB

Contains code for tensorflow codelab using inception on flower photos

Python 16.32% Jupyter Notebook 83.68%

women-techmakers-intern-meeetup's Introduction

TensorFlow Codelab

Step 1 : Let’s check if TensorFlow is correctly installed.

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session() # It will print some warnings here.
print(sess.run(hello))    #Output : Hello, TensorFlow!

Step 2 : Retrieving the images

mkdir tf_files  #Creating a working directory
cd tf_files

curl -O http://download.tensorflow.org/example_images/flower_photos.tgz
tar xzf flower_photos.tgz

ls -l #Checking for flower_photos folder
#Output : A folder named flower_photos inside which there are 5 sub folders namely daisy, tulips, sunflowers, roses and dandelion.

Step 3 : (Re)training Inception

curl -O      https://raw.githubusercontent.com/tensorflow/tensorflow/r1.1/tensorflow/examples/image_retraining/retrain.py

python retrain.py \
--bottleneck_dir=bottlenecks \
--how_many_training_steps=500 \
--model_dir=inception \
--summaries_dir=training_summaries/basic \
--output_graph=retrained_graph.pb \
--output_labels=retrained_labels.txt \
--image_dir=flower_photos

Step 4 : Using the Retrained Model

#Classifying an image
curl -L https://goo.gl/3lTKZs > label_image.py

#Run the python file on a daisy
python label_image.py flower_photos/daisy/21652746_cc379e0eea_m.jpg

#Output : 	daisy (score = 0.99071)
#sunflowers (score = 0.00595)
#dandelion (score = 0.00252)
#roses (score = 0.00049)
#tulips (score = 0.00032)

Step 5 : Going above and beyond!

#Trying Other Hyperparameters --learning_rate = 0.005(more time, high precision)[Default : 0.01]

#Training on Your Own Categories --image_dir=<root folder containing subfolders having folder names as label names, and the images inside each folder should be pictures that correspond to that label>

Feedback form : https://goo.gl/forms/XRkcKwApgrqjtZcG2

women-techmakers-intern-meeetup's People

Contributors

lakshya90 avatar

Watchers

 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.