Skip to content

Commit aa4354f

Browse files
committed
Big re-org, working towards making pip/module as 'timm'
1 parent 871f4c1 commit aa4354f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+132
-86
lines changed

inference.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
import numpy as np
1212
import torch
1313

14-
from models import create_model, apply_test_time_pool
15-
from data import Dataset, create_loader, resolve_data_config
16-
from utils import AverageMeter
14+
from timm.models import create_model, apply_test_time_pool
15+
from timm.data import Dataset, create_loader, resolve_data_config
16+
from timm.utils import AverageMeter
1717

1818
torch.backends.cudnn.benchmark = True
1919

@@ -55,6 +55,9 @@
5555
def main():
5656
args = parser.parse_args()
5757

58+
# might as well try to do something useful...
59+
args.pretrained = args.pretrained or not args.checkpoint
60+
5861
# create model
5962
model = create_model(
6063
args.model,

optim/adam_tf.py

Whitespace-only changes.

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
torch~=1.0
2+
torchvision

setup.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
""" Setup
2+
"""
3+
from setuptools import setup, find_packages
4+
from codecs import open
5+
from os import path
6+
7+
here = path.abspath(path.dirname(__file__))
8+
9+
# Get the long description from the README file
10+
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
11+
long_description = f.read()
12+
13+
exec(open('timm/version.py').read())
14+
setup(
15+
name='timm',
16+
version=__version__,
17+
description='(Unofficial) PyTorch Image Models',
18+
long_description=long_description,
19+
url='https://github.com/rwightman/pytorch-image-models',
20+
author='Ross Wightman',
21+
author_email='hello@rwightman.com',
22+
classifiers=[ # Optional
23+
# How mature is this project? Common values are
24+
# 3 - Alpha
25+
# 4 - Beta
26+
# 5 - Production/Stable
27+
'Development Status :: 3 - Alpha',
28+
'Intended Audience :: Developers',
29+
'Topic :: Software Development :: Build Tools',
30+
'License :: OSI Approved :: Apache License',
31+
'Programming Language :: Python :: 3.6',
32+
],
33+
34+
# Note that this is a string of words separated by whitespace, not a list.
35+
keywords='pytorch pretrained models efficientnet mobilenetv3 mnasnet',
36+
37+
# You can just specify package directories manually here if your project is
38+
# simple. Or you can use find_packages().
39+
#
40+
# Alternatively, if you just want to distribute a single Python file, use
41+
# the `py_modules` argument instead as follows, which will expect a file
42+
# called `my_module.py` to exist:
43+
#
44+
# py_modules=["my_module"],
45+
#
46+
packages=find_packages(exclude=['convert']),
47+
48+
# This field lists other packages that your project depends on to run.
49+
# Any package you put here will be installed by pip when your project is
50+
# installed, so they must be valid existing projects.
51+
#
52+
# For an analysis of "install_requires" vs pip's requirements files see:
53+
# https://packaging.python.org/en/latest/requirements.html
54+
install_requires=['torch', 'torchvision'],
55+
)

timm/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from .version import __version__
2+
from .models import create_model
File renamed without changes.

data/config.py renamed to timm/data/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from data.constants import *
1+
from .constants import *
22

33

44
def resolve_data_config(model, args, default_cfg={}, verbose=True):
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)