deep-person-reid/setup.py

58 lines
1.5 KiB
Python
Raw Normal View History

2019-03-21 20:53:21 +08:00
import numpy as np
2019-08-30 00:05:29 +08:00
import os.path as osp
2019-12-01 10:35:44 +08:00
from setuptools import setup, find_packages
from distutils.extension import Extension
from Cython.Build import cythonize
2019-03-20 01:26:08 +08:00
def readme():
2019-03-24 19:06:12 +08:00
with open('README.rst') as f:
2019-03-20 01:26:08 +08: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 20:53:21 +08: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-30 00:05:29 +08: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-20 01:26:08 +08:00
setup(
name='torchreid',
version=find_version(),
2020-05-05 22:58:00 +08:00
description='A library for deep learning person re-ID in PyTorch',
2019-03-20 01:26:08 +08:00
author='Kaiyang Zhou',
license='MIT',
long_description=readme(),
url='https://github.com/KaiyangZhou/deep-person-reid',
packages=find_packages(),
2019-08-30 00:05:29 +08:00
install_requires=get_requirements(),
2019-12-01 10:35:44 +08:00
keywords=['Person Re-Identification', 'Deep Learning', 'Computer Vision'],
2019-03-21 20:53:21 +08:00
ext_modules=cythonize(ext_modules)
2019-12-01 10:35:44 +08:00
)