Coder Social home page Coder Social logo

iq-scm / tensorflow-model-zoo.torch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cadene/tensorflow-model-zoo.torch

0.0 0.0 0.0 160.49 MB

InceptionV3, InceptionV4, Inception-Resnet pretrained models for Torch7 and PyTorch

License: Other

Shell 0.95% JavaScript 0.39% C++ 15.85% Python 79.43% Lua 0.42% TypeScript 0.08% Makefile 0.06% HTML 1.71% GLSL 0.01% Jupyter Notebook 1.12%

tensorflow-model-zoo.torch's Introduction

Tensorflow Model Zoo for Torch7 and PyTorch (OBSOLETE)

13/07/2017: Please use the new repo pretrained-models.pytorch which includes inceptionv4 and inceptionresnetv2 with a nicer API.

This is a porting of tensorflow pretrained models made by Remi Cadene and Micael Carvalho. Special thanks to Moustapha Cissé. All models have been tested on Imagenet.

This work was inspired by inception-v3.torch.

Using pretrained models

Torch7

Requirements

Please install torchnet-vision.

luarocks install --server=http://luarocks.org/dev torchnet-vision

Models available:

  • inceptionv3
  • inceptionv4
  • inceptionresnetv2
  • resnet{18, 34, 50, 101, 152, 200}
  • overfeat
  • vggm
  • vgg16

Simple example

require 'image'
tnt = require 'torchnet'
vision = require 'torchnet-vision'
model = vision.models.inceptionresnetv2
net = model.load()

augmentation = tnt.transform.compose{
   vision.image.transformimage.randomScale{
   	minSize = 299, maxSize = 350
   },
   vision.image.transformimage.randomCrop(299),
   vision.image.transformimage.colorNormalize{
      mean = model.mean, std  = model.std
   },
   function(img) return img:float() end
}

net:evaluate()
output = net:forward(augmentation(image.lena()))

PyTorch

Currently available in this repo only On pytorch/vision maybe!

Models available:

  • inceptionv4
  • inceptionresnetv2

Simple example

import torch
from inceptionv4.pytorch_load import inceptionv4
net = inceptionv4()
input = torch.autograd.Variable(torch.ones(1,3,299,299))
output = net.forward(input)

Reproducing the porting

Requirements

  • Tensorflow
  • Torch7
  • PyTorch
  • hdf5 for python3
  • hdf5 for lua

Example of commands

In Tensorflow: Download tensorflow parameters and extract them in ./dump directory.

python3 inceptionv4/tensorflow_dump.py

In Torch7 or PyTorch: Create the network, load the parameters, launch few tests and save the network in ./save directory.

th inceptionv4/torch_load.lua
python3 inceptionv4/pytorch_load.py

tensorflow-model-zoo.torch's People

Contributors

cadene 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.