Giter Club home page Giter Club logo

tensorflow-vgg's Introduction

Tensorflow VGG16 and VGG19

This is a Tensorflow implemention of VGG 16 and VGG 19 based on tensorflow-vgg16 and Caffe to Tensorflow. Original Caffe implementation can be found in here and here.

We have modified the implementation of tensorflow-vgg16 to use numpy loading instead of default tensorflow model loading in order to speed up the initialisation and reduce the overall memory usage. This implementation enable further modify the network, e.g. remove the FC layers, or increase the batch size.

To use the VGG networks, the npy files for VGG16 NPY or VGG19 NPY has to be downloaded.

Usage

Use this to build the VGG object

vgg = vgg19.Vgg19()
vgg.build(images)

or

vgg = vgg16.Vgg16()
vgg.build(images)

The images is a tensor with shape [None, 224, 224, 3].

Trick: the tensor can be a placeholder, a variable or even a constant.

All the VGG layers (tensors) can then be accessed using the vgg object. For example, vgg.conv1_1, vgg.conv1_2, vgg.pool5, vgg.prob, ...

test_vgg16.py and test_vgg19.py contain the sample usage.

Extra

This library has been used in my another Tensorflow image style synethesis project: stylenet

Update 1: Trainable VGG:

Added a trainable version of the VGG19 vgg19_trainable. It support train from existing vaiables or from scratch. (But the trainer is not included)

A very simple testing is added test_vgg19_trainable, switch has demo about how to train, switch off train mode for verification, and how to save.

A seperated file is added (instead of changing existing one) because I want to keep the simplicity of the original VGG networks.

Update 2: Tensorflow v1.0.0:

All the source code has been upgraded to v1.0.0.

The conversion is done by my another project tf0to1

tensorflow-vgg's People

Contributors

machrisaa avatar amylizzle avatar a514514772 avatar jamoque avatar sankichi92 avatar insikk avatar

Watchers

James Cloos 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.