-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
85 lines (74 loc) · 2.52 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# -*- coding: utf-8 -*-
"""
.. codeauthor:: Daniel Seichter <daniel.seichter@tu-ilmenau.de>
.. codeauthor:: Soehnke Fischedick <soehnke-benedikt.fischedick@tu-ilmenau.de>
"""
import os
import sys
from setuptools import find_packages
from setuptools import setup
def run_setup():
# get version
version_namespace = {}
with open(os.path.join('nicr_mt_scene_analysis', 'version.py')) as f:
exec(f.read(), version_namespace)
version = version_namespace['_get_version'](with_suffix=False)
requirements = [
'matplotlib',
'numpy',
'pillow',
'scipy',
'nicr_scene_analysis_datasets>=0.5.6'
]
if sys.version_info <= (3, 7):
requirements.append('torchmetrics==0.8.2')
else:
requirements.append('torchmetrics==0.10.2')
# torch and torchvision should be installed before running this!
try:
import torch
except ImportError:
raise ImportError(
"Torch not found. Please install PyTorch before on "
"your own: https://pytorch.org/get-started/locally/"
)
try:
import torchvision
except ImportError:
raise ImportError(
"TorchVision not found. Please install TorchVision before on "
"your own: https://pytorch.org/get-started/locally/"
)
if sys.version_info <= (3, 7):
# python 3.6 does not support dataclasses (install backport)
requirements.append('dataclasses')
# OpenCV might be installed using another name
try:
import cv2
except ImportError:
requirements.append('opencv-python')
# setup
setup(name='nicr_mt_scene_analysis',
version='{}.{}.{}'.format(*version),
description='Python package for multi-task scene analysis',
author='Daniel Seichter, Söhnke Benedikt Fischedick',
author_email='daniel.seichter@tu-ilmenau.de, '
'soehnke-benedikt.fischedick@tu-ilmenau.de',
license='Copyright 2021-2023, Neuroinformatics and Cognitive '
'Robotics Lab TU Ilmenau, Ilmenau, Germany',
install_requires=requirements,
packages=find_packages(),
extras_require={
'test': [
'scikit-image',
'pytest>=3.0.2',
]
},
include_package_data=True,
package_data={
'nicr_mt_scene_analysis': [
'visualization/FreeMonoBold.ttf',
]
})
if __name__ == '__main__':
run_setup()