deep-person-reid/setup.py

62 lines
1.5 KiB
Python
Raw Normal View History

2019-03-19 17:26:08 +00:00
from setuptools import find_packages, setup
2019-03-21 12:53:21 +00:00
from distutils.extension import Extension
from Cython.Build import cythonize
import numpy as np
2019-08-29 17:05:29 +01:00
import os.path as osp
2019-03-19 17:26:08 +00:00
def readme():
2019-03-24 11:06:12 +00:00
with open('README.rst') as f:
2019-03-19 17:26:08 +00:00
content = f.read()
return content
def find_version():
version_file = 'torchreid/__init__.py'
with open(version_file, 'r') as f:
exec(compile(f.read(), version_file, 'exec'))
return locals()['__version__']
2019-03-21 12:53:21 +00:00
def numpy_include():
try:
numpy_include = np.get_include()
except AttributeError:
numpy_include = np.get_numpy_include()
return numpy_include
ext_modules = [
Extension(
'torchreid.metrics.rank_cylib.rank_cy',
['torchreid/metrics/rank_cylib/rank_cy.pyx'],
include_dirs=[numpy_include()],
)
]
2019-08-29 17:05:29 +01:00
def get_requirements(filename='requirements.txt'):
here = osp.dirname(osp.realpath(__file__))
with open(osp.join(here, filename), 'r') as f:
requires = [line.replace('\n', '') for line in f.readlines()]
return requires
2019-03-19 17:26:08 +00:00
setup(
name='torchreid',
version=find_version(),
description='Pytorch framework for deep-learning person re-identification',
author='Kaiyang Zhou',
author_email='k.zhou.vision@gmail.com',
license='MIT',
long_description=readme(),
url='https://github.com/KaiyangZhou/deep-person-reid',
packages=find_packages(),
2019-08-29 17:05:29 +01:00
install_requires=get_requirements(),
2019-03-19 17:26:08 +00:00
keywords=[
'Person Re-Identification',
'Deep Learning',
'Computer Vision'
2019-03-21 12:53:21 +00:00
],
ext_modules=cythonize(ext_modules)
2019-03-19 17:26:08 +00:00
)