Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wielandbrendel committed Aug 12, 2018
1 parent 3876ba7 commit 599587c
Show file tree
Hide file tree
Showing 8 changed files with 475 additions and 2 deletions.
163 changes: 163 additions & 0 deletions .gitignore
@@ -0,0 +1,163 @@
worktrees/
.mypy_cache
Makefile
wip/

# Created by https://www.gitignore.io/api/osx,vim,linux,python

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### OSX ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

### Vim ###
# swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
# session
Session.vim
# temporary
.netrwhist
# auto-generated tag files
tags

# End of https://www.gitignore.io/api/osx,vim,linux,python
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
T License

Copyright (c) 2017 Jonas Rauber & Wieland Brendel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

60 changes: 60 additions & 0 deletions README.rst
@@ -0,0 +1,60 @@
=======
BagNets
=======

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

`Approximating CNNs with Bag-of-local-Features models8works surprisingly well on ImageNet <http://arxiv.org/abs/XXXX.XXXX>`__.
Wieland Brendel and Matthias Bethge, arXiv:XXXX.XXXX

Installation
------------

.. code-block:: bash
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:

.. code-block:: python
import bagnets
pytorch_model = bagnets.pytorch.bagnet16(pretrained=True)
.. code-block:: python
import bagnets
keras_model = bagnets.keras.bagnet16(pretrained=True)
and replace bagnet16 with whatever size you want (available are bagnet8, bagnet16 and bagnet32). The last number refers to the
maximum local patch size that the network can integrate over.

Citation
--------

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

.. code-block::
@article{brendel2018bagnets,
title={Approximating CNNs with Bag-of-local-Features models8works surprisingly well on ImageNet},
author={Brendel, Wieland and Bethge, Matthias},
journal={arXiv preprint arXiv:XXXX.XXXX},
year={2018},
url={http://arxiv.org/abs/XXXX.XXXX},
archivePrefix={arXiv},
eprint={XXXX.XXXX},
}
You can find the paper on arXiv: https://arxiv.org/abs/XXXX.XXXX

Authors
-------

* `Wieland Brendel <https://github.com/wielandbrendel>`_
Empty file added bagnets/__init__.py
Empty file.
Empty file added bagnets/keras.py
Empty file.

0 comments on commit 599587c

Please sign in to comment.