-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
60 lines (47 loc) · 1.93 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
# Copyright 2021 Adobe
# All Rights Reserved.
# NOTICE: Adobe permits you to use, modify, and distribute this file in
# accordance with the terms of the Adobe license agreement accompanying
# it.
"""
e.g.
if use a a third party
>> python setup.py install
if use for edit
>> python setup.py develop
"""
import argparse
import setuptools
import subprocess
import os,io,re
def get_version():
current_dir = os.path.abspath(os.path.dirname(__file__))
version_file = os.path.join(current_dir, "beacon_aug", "__init__.py")
with io.open(version_file, encoding="utf-8") as f:
return re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', f.read(), re.M).group(1)
if __name__ == "__main__":
"""Main method"""
with open('requirements.txt') as f:
required = f.read().splitlines()
setuptools.setup(name='Beacon_aug',
version=get_version(),
description='Cross-library augmentation module for deep learning training',
author='Rebecca Li, Yannick Hold-Geoffroy, Geoffrey Oxholm, etc',
author_email='[email protected]',
url='https://github.com/adobe-research/beacon-aug',
packages=setuptools.find_packages(exclude=["workspace"]),
package_dir={'beacon_aug': 'beacon_aug'},
include_package_data=True,
install_requires=required,
)
# for augly dependency
subprocess.run(["conda", "install", "-c", "conda-forge", "python-magic"])
subprocess.run(["conda", "install", "-c", "conda-forge/label/cf202003", "imagemagick"])
print('''\n\n Package "beacon_aug" has successfully installed! You can try e.g.
=======================
>>>> import beacon_aug as BA
>>>> aug = BA.HorizontalFlip(p=1, library="a")
>>>> aug = BA.HorizontalFlip(p=1, library="iaa")
>>>> image_auged = aug(image=image)["image"]
'''
)