GithubHelp home page GithubHelp logo

zhangxujinsh / bag-of-local-features-models Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wielandbrendel/bag-of-local-features-models

0.0 2.0 0.0 236 KB

Pretrained bag-of-local-features neural networks

License: Other

Python 4.49% Jupyter Notebook 95.51%

bag-of-local-features-models's Introduction

BagNets

In this repository you find the model specification and pretrained weights for the bag-of-local-feature models published in

Installation

pip install git+https://github.com/wielandbrendel/bag-of-local-features-models.git

Usage

The code provides simple means to initialize the models in either Pytorch or Keras. After installation please use the following code snippets to load the models:

import bagnets.pytorch
pytorch_model = bagnets.pytorch.bagnet17(pretrained=True)
import bagnets.keras
keras_model = bagnets.keras.bagnet17()

and replace bagnet16 with whatever size you want (available are bagnet9, bagnet17 and bagnet33). The last number refers to the maximum local patch size that the network can integrate over.

Image Preprocessing

The models expect inputs with the standard torchvision preprocessing, i.e.

  • with RGB channels
  • in the format [channel, x, y]
  • loaded with pixel values between 0 and 1 which are then...
  • ...normalized by mean and standard deviation, i.e. for given mean: (M1,...,Mn) and std: (S1,..,Sn) for n channels, the normalization should transform each channel of the input as input[channel] = (input[channel] - mean[channel]) / std[channel]

The mean and standard deviation are:

  • mean = [0.485, 0.456, 0.406]
  • std = [0.229, 0.224, 0.225]

Citation

If you find BagNets useful for your scientific work, please consider citing it in resulting publications:

@article{brendel2018bagnets,
  title={Approximating CNNs with Bag-of-local-Features models8works surprisingly well on ImageNet},
  author={Brendel, Wieland and Bethge, Matthias},
  journal={International Conference on Learning Representations},
  year={2019},
  url={https://openreview.net/pdf?id=SkfMWhAqYQ},
}

You can find the paper on OpenReview: https://openreview.net/pdf?id=SkfMWhAqYQ

Authors

bag-of-local-features-models's People

Contributors

wielandbrendel avatar

Watchers

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