Skip to content
프로젝트

wielandbrendel/bag-of-local-features-models

GitHub에서 보기

소개

사전 학습된 국소 특징 가방 신경망

시스템 및 인프라

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

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.pytorchnet
pytorch_model = bagnets.pytorchnet.bagnet17(pretrained=True)
import bagnets.kerasnet
keras_model = bagnets.kerasnet.bagnet17()

and replace bagnet17 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.

FAQ

  • Do I need to manually split the image into patches?

    No. You use BagNets just like any other DNN and apply it to the whole image. The BagNets are really similar to ResNets. In a nutshell we simply replaced most 3x3 convolutions by 1x1 convolutions. This effectively means that the largest receptive fields in the BagNets are of size qxq (where q is smaller than the image size), which is equivalent to splitting the image into individual patches.

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 models works 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

관련 프로젝트 살펴보기

불러오는 중…